Re: degrees and radians.

2016-09-08 Thread Lawrence D’Oliveiro
On Tuesday, May 7, 2002 at 9:15:50 AM UTC+12, Fernando Pérez wrote: > Plus, if you really need those conversions, it's less typing and more > efficient (no function call) to simply use a multiplicative constant... This I have found to be the best idea. In Qahirah

Re: easy way to return a list of absolute file or directory path within a directory

2016-09-08 Thread iMath
On Wednesday, September 7, 2016 at 4:00:31 PM UTC+8, Steven D'Aprano wrote: > On Wednesday 07 September 2016 17:08, iMath wrote: > > > Any easier solutions on returning a list of absolute file or directory path > > within a directory? Mine is > > > > list(map(lambda entry: os.path.join(directory,

Re: How to split value where is comma ?

2016-09-08 Thread Robin Becker
On 08/09/2016 03:54, D'Arcy J.M. Cain wrote: On Wed, 7 Sep 2016 16:04:40 + Joaquin Alzola wrote: .. This email is confidential and may be subject to privilege. If you are not the intended recipient, please do not copy or disclose its content but contact the sender immediately upon

nested loops in Python

2016-09-08 Thread Igor Kozin
Why nested loops are so slow in Python? Is it because new contexts are created? For more details, see http://stackoverflow.com/questions/26611043/numpy-vs-cython-nested-loop-so-slow http://stackoverflow.com/questions/39371021/efficient-loop-over-numpy-array Thanks! -- https://mail.python.org/mail

Re: nested loops in Python

2016-09-08 Thread Chris Angelico
On Thu, Sep 8, 2016 at 8:20 PM, Igor Kozin wrote: > Why nested loops are so slow in Python? Is it because new contexts are > created? > For more details, see > http://stackoverflow.com/questions/26611043/numpy-vs-cython-nested-loop-so-slow > http://stackoverflow.com/questions/39371021/efficient-l

Re: Does This Scare You?

2016-09-08 Thread eryk sun
On Thu, Sep 8, 2016 at 1:30 AM, Lawrence D’Oliveiro wrote: > On Monday, August 22, 2016 at 4:18:39 PM UTC+12, eryk sun wrote: >> It would help to consult a reverse-engineered implementation of >> RtlGetFullPathName_Ustr and RtlIsDosDeviceName_Ustr. I'll check the >> ReactOS source code. > >

Re: Fwd: Fwd: Python freeze fails with warning: the use of `tempnam' is dangerous, better use `mkstemp'

2016-09-08 Thread Alexander N. Moibenko
Yes, of course I did not write posixmodule.c, it is a part of the python 2.7 distribution and I have no idea how to not use it and I believe I have no control over it, unless I go inside of python distribution and modify it. Is this what you are recommending? On 09/07/2016 05:36 PM, Ben Finne

Re: Fwd: Fwd: Python freeze fails with warning: the use of `tempnam' is dangerous, better use `mkstemp'

2016-09-08 Thread Alexander N. Moibenko
In fact I tried issuing commands manually, but they did not give me any hint more than I already had. In python 2.6 this all works with the same libc, of course (because I tried to compile on the same machine). Thanks anyway. On 09/08/2016 01:22 AM, dieter wrote: "Alexander N. Moibenko"

Re: Fwd: Fwd: Python freeze fails with warning: the use of `tempnam' is dangerous, better use `mkstemp'

2016-09-08 Thread Chris Angelico
On Fri, Sep 9, 2016 at 12:48 AM, Alexander N. Moibenko wrote: > In fact I tried issuing commands manually, but they did not give me any hint > more than I already had. > > In python 2.6 this all works with the same libc, of course (because I tried > to compile on the same machine). > Can you prov

Re: How to split value where is comma ?

2016-09-08 Thread John Gordon
In Joaquin Alzola writes: > Use the split > a.split(",") > for x in a: > print(x) This won't work. split() returns a list of split elements but the original string remains unchanged. You want something like this instead: newlist = a.split(",") for x in newlist: print(x) --

Re: Fwd: Fwd: Python freeze fails with warning: the use of `tempnam' is dangerous, better use `mkstemp'

2016-09-08 Thread Alexander N. Moibenko
Yes this Linux Red Hat 6. [enstore@dmsen02 enstore-log]$ cat /etc/redhat-release Scientific Linux Fermi release 6.5 (Ramsey) Please note that the same set of modules buils with python 2.6.3 and fails with python 2.7 ( I mean any pyhon 2.7 release). On 09/08/2016 09:51 AM, Chris Angelico w

Re: Fwd: Fwd: Python freeze fails with warning: the use of `tempnam' is dangerous, better use `mkstemp'

2016-09-08 Thread Rustom Mody
On Thursday, September 8, 2016 at 8:57:23 PM UTC+5:30, Alexander N. Moibenko wrote: > Yes this Linux Red Hat 6. > > [enstore@dmsen02 enstore-log]$ cat /etc/redhat-release > Scientific Linux Fermi release 6.5 (Ramsey) > Please note that the same set of modules buils with python 2.6.3 and > fails

How to diagnose CERTIFICATE_VERIFY_FAILED on Windows for websites working in browsers?

2016-09-08 Thread Chi Hsuan Yen
Hi Python enthusiasts, I'm working on youtube-dl, a handy tool for downloading videos from various websites. There are occasional bug reports with SSL error CERTIFICATE_VERIFY_FAILED when people are trying to download videos from youtube.com [1] or dailymotion.com [2]. The issue about youtube.com

Re: Fwd: Fwd: Python freeze fails with warning: the use of `tempnam' is dangerous, better use `mkstemp'

2016-09-08 Thread Alexander N. Moibenko
On 09/08/2016 11:06 AM, Rustom Mody wrote: On Thursday, September 8, 2016 at 8:57:23 PM UTC+5:30, Alexander N. Moibenko wrote: Yes this Linux Red Hat 6. [enstore@dmsen02 enstore-log]$ cat /etc/redhat-release Scientific Linux Fermi release 6.5 (Ramsey) Please note that the same set of modules

Re: Fwd: Fwd: Python freeze fails with warning: the use of `tempnam' is dangerous, better use `mkstemp'

2016-09-08 Thread Chris Angelico
On Fri, Sep 9, 2016 at 1:12 AM, Alexander N. Moibenko wrote: > Yes this Linux Red Hat 6. > > [enstore@dmsen02 enstore-log]$ cat /etc/redhat-release > Scientific Linux Fermi release 6.5 (Ramsey) > Please note that the same set of modules buils with python 2.6.3 and fails > with python 2.7 ( I m

Re: nested loops in Python

2016-09-08 Thread Christian Gollwitzer
Am 08.09.16 um 12:20 schrieb Igor Kozin: Why nested loops are so slow in Python? Is it because new contexts are created? For more details, see http://stackoverflow.com/questions/26611043/numpy-vs-cython-nested-loop-so-slow http://stackoverflow.com/questions/39371021/efficient-loop-over-numpy-arra

Re: Fwd: Fwd: Python freeze fails with warning: the use of `tempnam' is dangerous, better use `mkstemp'

2016-09-08 Thread Chris Angelico
On Fri, Sep 9, 2016 at 2:50 AM, Alexander N. Moibenko wrote: > The output is long so, I am replying to you only: Not too long, fortunately. Replying back to the list with a trimmed version. > make[1]: Entering directory `/opt/enstore/src/ENCPBIN_TEMP' (Curious path name.) > /opt/enstore/Python

Re: Fwd: Fwd: Python freeze fails with warning: the use of `tempnam' is dangerous, better use `mkstemp'

2016-09-08 Thread Alexander N. Moibenko
On 09/08/2016 12:19 PM, Chris Angelico wrote: On Fri, Sep 9, 2016 at 2:50 AM, Alexander N. Moibenko wrote: The output is long so, I am replying to you only: Not too long, fortunately. Replying back to the list with a trimmed version. make[1]: Entering directory `/opt/enstore/src/ENCPBIN_TE

Re: How to split value where is comma ?

2016-09-08 Thread Larry Hudson via Python-list
On 09/08/2016 07:57 AM, John Gordon wrote: In Joaquin Alzola writes: Use the split a.split(",") for x in a: print(x) This won't work. split() returns a list of split elements but the original string remains unchanged. You want something like this instead: newlist = a.split(",")

RE: How to split value where is comma ?

2016-09-08 Thread Joaquin Alzola
https://mail.python.org/mailman/listinfo/python-list

Need some suggestions in grouping of items

2016-09-08 Thread GP
I have a list of items: ShelvesToPack = [{'ShelfLength': 2278.0, 'ShelfWidth': 356.0, 'ShelfArea': 759152.0, 'ItemNames': 1}, {'ShelfLength': 1220.0, 'ShelfWidth': 610.0, 'ShelfArea': 372100.0, 'ItemNames': 2}, {'ShelfLength': 2310.0, 'ShelfWidth': 762.0, 'ShelfArea': 1760220.0, '

What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-08 Thread Ben Finney
Joaquin Alzola writes: > world? > > Cannot do anything. That's not true; you can do more than we. > Added by the MTA of the company not by my client. Right. So, here are things you can do (that we cannot) about this: * Complain, with reasoned explanation, to the management responsible for

RE: What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-08 Thread Joaquin Alzola
Hi Ben Thanks for the advice. > * Complain Basically what all comes down is to complain. I wonder if in a company of 80,000 people I will manage to change that behaviour. This email is confidential and may be subject to privilege. If you are not the intended recipient, please do not copy or di

Re: What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-08 Thread Chris Angelico
On Fri, Sep 9, 2016 at 7:17 AM, Joaquin Alzola wrote: > Hi Ben > > Thanks for the advice. > >> * Complain > > Basically what all comes down is to complain. I wonder if in a company of > 80,000 people I will manage to change that behaviour. > This email is confidential and may be subject to privil

RE: What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-08 Thread Lew Pitcher
On Thursday September 8 2016 17:17, in comp.lang.python, "Joaquin Alzola" wrote: > Hi Ben > > Thanks for the advice. > >> * Complain > > Basically what all comes down is to complain. I wonder if in a company of > 80,000 people I will manage to change that behaviour. Why don't you, at least, i

Re: What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-08 Thread Grant Edwards
On 2016-09-08, Joaquin Alzola wrote: > Basically what all comes down is to complain. I wonder if in a > company of 80,000 people I will manage to change that behaviour. Perhaps others have complained. If enough people complain, maybe they'll do something. After all, that boilerplate just makes

Re: What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-08 Thread Random832
On Thu, Sep 8, 2016, at 18:13, Grant Edwards wrote: > After all, that boilerplate just makes the corporation look stupid and > incompetent. Any email that leaves the corporate network must be > assumed to be visible to world+dog. Anybody who thinks differently is > deluded and should not be allow

Re: What you can do about legalese nonsense on email

2016-09-08 Thread Ben Finney
Chris Angelico writes: > On Fri, Sep 9, 2016 at 7:17 AM, Joaquin Alzola > wrote: > > Hi Ben > > > > Thanks for the advice. You're welcome, I hope it leads to positive change. > > Basically what all comes down is to complain. I wonder if in a > > company of 80,000 people I will manage to change

Re: Need some suggestions in grouping of items

2016-09-08 Thread MRAB
On 2016-09-08 21:50, GP wrote: I have a list of items: ShelvesToPack = [{'ShelfLength': 2278.0, 'ShelfWidth': 356.0, 'ShelfArea': 759152.0, 'ItemNames': 1}, {'ShelfLength': 1220.0, 'ShelfWidth': 610.0, 'ShelfArea': 372100.0, 'ItemNames': 2}, {'ShelfLength': 2310.0, 'ShelfWidth':

pymssql

2016-09-08 Thread sum abiut
Hi, i have used pymssql to connet to windows database but i want to be able iterate and only print out some specific fields. here is what i did conn=pymssql.connect(server,username,password,database) cus=conn.cursor() cus.execute("SELECT * FROM glbud ") for row in cus: pr

Re: What you can do about legalese nonsense on email

2016-09-08 Thread Terry Reedy
On 9/8/2016 4:52 PM, Ben Finney wrote: Joaquin Alzola writes: That's not true; you can do more than we. Added by the MTA of the company not by my client. Right. So, here are things you can do (that we cannot) about this: Something that some 'we' could do is ask the python-list manager

Re: What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-08 Thread Chris Angelico
On Fri, Sep 9, 2016 at 11:05 AM, Dennis Lee Bieber wrote: > I suspect, like the last two companies I've worked for -- corporate IT > policy is to block any access to non-corporate email systems. (Heck, my > current company is so paranoid that it adds "EXT:" to the subject of > incoming ema

Re: C Python extension to export an Function

2016-09-08 Thread Lawrence D’Oliveiro
On Friday, September 2, 2016 at 3:59:21 AM UTC+12, Stefan Behnel wrote: > Manually written C-API code is simply too difficult to maintain, and also > too difficult to get right in the first place. There are just too many ways > to introduce reference leaks, crashes and long standing unnoticed bugs

Re: pymssql

2016-09-08 Thread Lawrence D’Oliveiro
On Friday, September 9, 2016 at 12:48:50 PM UTC+12, sum abiut wrote: > cus.execute("SELECT * FROM glbud ") Never use “select *”, except for testing. > for row in cus: >print(row) > this works perfect, but when i try to iterate through and only print out > specific fields i got

Re: What you can do about legalese nonsense on email

2016-09-08 Thread Ben Finney
Terry Reedy writes: > Something that some 'we' could do is ask the python-list > manager/programmers, or more broadly, the mailman developers, to > recognize an 'end of message' line, such as '--end message--' and > delete it and anything appended thereafter. No, that would be mangling messages

Re: pymssql

2016-09-08 Thread sum abiut
ok did some changes: conn=pymssql.connect(server,username,password,database) cus=conn.cursor( cus.execute("SELECT budget_code,budget_description,rate_type FROM glbud") for row in cus: print(row) the above code display the selected column but when i iterate and try to print the fields, its

Re: What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-08 Thread Jussi Piitulainen
Grant Edwards writes: > On 2016-09-08, Joaquin Alzola wrote: > >> Basically what all comes down is to complain. I wonder if in a >> company of 80,000 people I will manage to change that behaviour. > > Perhaps others have complained. If enough people complain, maybe > they'll do something. > > Aft

Re: Fwd: Fwd: Python freeze fails with warning: the use of `tempnam' is dangerous, better use `mkstemp'

2016-09-08 Thread dieter
"Alexander N. Moibenko" writes: > In fact I tried issuing commands manually, but they did not give me > any hint more than I already had. When I remember right, then "gcc" has an option to show details about the calling of the phase commands ("gcc" is a coordinating programm delegating the real w

Re: How to diagnose CERTIFICATE_VERIFY_FAILED on Windows for websites working in browsers?

2016-09-08 Thread dieter
Chi Hsuan Yen writes: > ... > Apparently OpenSSL verifies the whole certificate chain and > report an error as soon as it finds an invalid certificate in the chain. As it must, if you require verification. When I remember right, you can disable the verification altogether (though you should not

Re: How to split value where is comma ?

2016-09-08 Thread Rustom Mody
On Friday, September 9, 2016 at 1:36:24 AM UTC+5:30, Larry Hudson wrote: > On 09/08/2016 07:57 AM, John Gordon wrote: > > In Joaquin Alzola writes: > > > >> Use the split > > > >> a.split(",") > >> for x in a: > >> print(x) > > > > This won't work. split() returns a list of split elements but the

Re: How to diagnose CERTIFICATE_VERIFY_FAILED on Windows for websites working in browsers?

2016-09-08 Thread Chi Hsuan Yen
On Fri, Sep 9, 2016 at 2:22 PM, dieter wrote: > Chi Hsuan Yen writes: > > ... > > Apparently OpenSSL verifies the whole certificate chain and > > report an error as soon as it finds an invalid certificate in the chain. > > As it must, if you require verification. > > When I remember right, you c

Re: How to split value where is comma ?

2016-09-08 Thread Rustom Mody
On Friday, September 9, 2016 at 11:51:25 AM UTC+5:30, Rustom Mody wrote: > And if the original 'a' looked something like > >>> a="p:1,q:2,r:42" > > then you probably want something like: > > >>> {k:v for item in a.split(',') for k,v in [item.split(':')]} > {'q': '2', 'p': '1', 'r': '42'} > >>> W

How to extend a tuple of tuples?

2016-09-08 Thread Frank Millman
Hi all This should be easy, but I cannot figure it out. Assume you have a tuple of tuples - a = ((1, 2), (3, 4)) You want to add a new tuple to it, so that it becomes - ((1, 2), (3, 4), (5, 6)) The obvious way does not work - a += (5, 6) ((1, 2), (3, 4), 5, 6) I have discovered that

Re: How to diagnose CERTIFICATE_VERIFY_FAILED on Windows for websites working in browsers?

2016-09-08 Thread dieter
Chi Hsuan Yen writes: > ... > Thanks a lot! I just lost my direction when trying to understand how > certificate verification works in Python. It sets things up for "OpenSSL" and then delegates all details to it. -- https://mail.python.org/mailman/listinfo/python-list