Re: OpenSSL error

2018-09-06 Thread dieter
Peng Yu writes: > ... > from OpenSSL import rand, crypto, SSL > File > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSSL/SSL.py", > line 118, in > SSL_ST_INIT = _lib.SSL_ST_INIT > AttributeError: 'module' object has no attribute 'SSL_ST_INIT' That

Re: don't quite understand mailing list

2018-09-06 Thread Marko Rauhamaa
mm0fmf : > On 06/09/2018 21:06, Ethan Furman wrote: >> On 09/06/2018 12:42 PM, Reto Brunner wrote: >>> What do you think the link, which is attached to every email you >>> receive from the list, is for? Listinfo sounds very promising, >>> doesn't it? >>> >>> And if you actually go to it you'll find

Re: Debug script under pdb, how to avoid a bunch of errors caused by the exit()?

2018-09-06 Thread Jach Fong
I tried the following tests under pdb, 1. WinPython 3.6.6 on Vista, still saw those errors. 2. Python 3.4 on Win7, still saw those errors. 3. Python 3.6.3 on Win7, it's fine, no errors. Hmmm... seems both Python and OS are related? --Jach Peter via Python-list at 2018/9/7 AM 06:33 wrote: I'm o

Re: Object-oriented philosophy

2018-09-06 Thread Steven D'Aprano
On Thu, 06 Sep 2018 22:00:26 +0100, MRAB wrote: > On 2018-09-06 21:24, Michael F. Stemper wrote: [...] >>try: >> P_0s = xmlmodel.findall( 'RatedPower' )[0].text >> self.P_0 = float( P_0s ) >>except: [...] > A word of advice: don't use a "bare" except, i.e. one that doesn't > sp

Re: don't quite understand mailing list

2018-09-06 Thread Steven D'Aprano
On Thu, 06 Sep 2018 13:06:22 -0700, Ethan Furman wrote: > On 09/06/2018 12:42 PM, Reto Brunner wrote: > >> What do you think the link, which is attached to every email you >> receive from the list, is for? Listinfo sounds very promising, doesn't >> it? >> >> And if you actually go to it you'll fi

Re: PEP 526 - var annotations and the spirit of python

2018-09-06 Thread Abdur-Rahmaan Janhangeer
hey, greetings, how did you come across this thread? Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/listinfo/python-list

Re: Why emumerated list is empty on 2nd round of print?

2018-09-06 Thread Steven D'Aprano
On Thu, 06 Sep 2018 11:50:17 -0700, Viet Nguyen via Python-list wrote: > If I do this "aList = enumerate(numList)", isn't it > stored permanently in aList now? Yes, but the question is "what is *it* that is stored? The answer is, it isn't a list, despite the name you choose. It is an enumerate i

Re: PEP 526 - var annotations and the spirit of python

2018-09-06 Thread sjatkins
On Sunday, July 1, 2018 at 10:06:49 AM UTC-7, Abdur-Rahmaan Janhangeer wrote: > was viewing pep526, so, finally, python cannot do without hinting the type > as other languages? > will python finally move to > int x = 3 where int is a pre annotation? > > i am not arguing it's usefulness but rather,

Re: Cross platform mutex to prevent script running more than instance?

2018-09-06 Thread eryk sun
On Tue, Sep 4, 2018 at 5:47 PM, Cameron Simpson wrote: > > The downside with mkdir, and also with pd files really, is that a program or > OS abort can leave them lying around. Being persistent objects, some kind of > cleanup is needed. While the OP needs a cross-platform solution, if it's just Wi

Re: Debug script under pdb, how to avoid a bunch of errors caused by the exit()?

2018-09-06 Thread Peter via Python-list
I'm on 3.7.0 on Win 10, and get a different result. No traceback. Perhaps it's a bug in 3.4 that was fixed subsequently. C:\test> py -m pdb bugInPDB.py > c:\test\buginpdb.py(1)() -> password = 'bad' (Pdb) tbreak 3 Breakpoint 1 at c:\test\buginpdb.py:3 (Pdb) cont Deleted breakpoint 1 at c:\test\b

Re: don't quite understand mailing list

2018-09-06 Thread Gene Heskett
On Thursday 06 September 2018 16:44:20 mm0fmf wrote: > On 06/09/2018 21:06, Ethan Furman wrote: > > On 09/06/2018 12:42 PM, Reto Brunner wrote: > >> What do you think the link, which is attached to every email you > >> receive from the list, is for? Listinfo sounds very promising, > >> doesn't it?

Re: ModuleNotFoundError: No module named 'encodings'

2018-09-06 Thread Thomas Jollans
On 09/06/2018 09:46 PM, Jason Qian via Python-list wrote: Hi Need some help. I have a C++ application that invokes Python. ... Py_SetPythonHome("python_path"); This isn't actually a line in your code, is it? For one thing, Py_SetPythonHome expects a wchar_t*... Py_Initialize(); This wor

Re: Object-oriented philosophy

2018-09-06 Thread MRAB
On 2018-09-06 21:24, Michael F. Stemper wrote: On 2018-09-06 09:35, Rhodri James wrote: On 06/09/18 15:04, Michael F. Stemper wrote: Net net is that the only thing that ended up being common was the __init__ methods. Two of the classes have identical __init__ methods; the third has a superset o

Re: don't quite understand mailing list

2018-09-06 Thread Ethan Furman
On 09/06/2018 01:44 PM, mm0fmf wrote: Seriously if someone has a swanky signature advertising that they are a rocket scientist viz. "Software Contractor, Missiles and Fire Control" and yet doesn't know what a language runtime is or how mailing lists work then they are asking for that kind of r

Re: don't quite understand mailing list

2018-09-06 Thread Chris Angelico
On Fri, Sep 7, 2018 at 6:44 AM, mm0fmf wrote: > On 06/09/2018 21:06, Ethan Furman wrote: >> >> On 09/06/2018 12:42 PM, Reto Brunner wrote: >> >>> What do you think the link, which is attached to every email you receive >>> from the list, is for? Listinfo sounds very promising, doesn't it? >>> >>>

Re: don't quite understand mailing list

2018-09-06 Thread mm0fmf
On 06/09/2018 21:06, Ethan Furman wrote: On 09/06/2018 12:42 PM, Reto Brunner wrote: What do you think the link, which is attached to every email you receive from the list, is for? Listinfo sounds very promising, doesn't it? And if you actually go to it you'll find: "To unsubscribe from Python

Re: Object-oriented philosophy

2018-09-06 Thread Michael F. Stemper
On 2018-09-06 12:32, Stefan Ram wrote: > "Michael F. Stemper" writes: >> Is there really any benefit to this change? Yes, I've eliminated >> some (a few lines per class) duplicate code. On the other hand, >> I've added the parent class and the (probably small, but not >> non-existent) overhead of

Re: Object-oriented philosophy

2018-09-06 Thread Michael F. Stemper
On 2018-09-06 10:40, Abdur-Rahmaan Janhangeer wrote: > Also, get someone, preferrable a python engineer to review your code. Sounds like an advertisement to me. -- Michael F. Stemper Why doesn't anybody care about apathy? -- https://mail.python.org/mailman/listinfo/python-list

Re: Object-oriented philosophy

2018-09-06 Thread Michael F. Stemper
On 2018-09-06 09:35, Rhodri James wrote: > On 06/09/18 15:04, Michael F. Stemper wrote: >> Net net is that the only thing that ended up being common was the >> __init__ methods. Two of the classes have identical __init__ >> methods; the third has a superset of that method. The other methods >> all

Re: Object-oriented philosophy

2018-09-06 Thread Michael F. Stemper
On 2018-09-06 09:34, Marko Rauhamaa wrote: > "Michael F. Stemper" : > >> Since the three classes all had common methods (by design), I >> thought that maybe refactoring these three classes to inherit from >> a parent class would be beneficial. I went ahead and did so. >> (Outlines of before and af

Re: don't quite understand mailing list

2018-09-06 Thread Ethan Furman
On 09/06/2018 12:42 PM, Reto Brunner wrote: What do you think the link, which is attached to every email you receive from the list, is for? Listinfo sounds very promising, doesn't it? And if you actually go to it you'll find: "To unsubscribe from Python-list, get a password reminder, or change

Re: Object-oriented philosophy

2018-09-06 Thread Rob Gaddi
On 09/06/2018 09:07 AM, Thomas Jollans wrote: On 2018-09-06 17:40, Abdur-Rahmaan Janhangeer wrote: Also, get someone, preferrable a python engineer to review your code. Does anyone here know anyone who would refer to themselves as a "Python engineer" with a straight face? I merely ask... -- T

ModuleNotFoundError: No module named 'encodings'

2018-09-06 Thread Jason Qian via Python-list
Hi Need some help. I have a C++ application that invokes Python. ... Py_SetPythonHome("python_path"); Py_Initialize(); This works fine on Python 3.6.4 version, but got errors on Python 3.7.0 when calling Py_Initialize(), Fatal Python error: initfsencoding: unable to load the file system codec

Re: don't quite understand mailing list

2018-09-06 Thread Reto Brunner
On Thu, Sep 06, 2018 at 07:10:10PM +, VanDyk, Richard T wrote: > Can you please take me off the mailing list or prevent questions from coming > to me. Can you advise me on my problem or point me in the right direction? > Thanks. > https://mail.python.org/mailman/listinfo/python-list What do y

Re: Why emumerated list is empty on 2nd round of print?

2018-09-06 Thread Viet Nguyen via Python-list
On Thursday, September 6, 2018 at 12:12:20 PM UTC-7, David Raymond wrote: > The actual "enumerate" object is really just holding a current index and a > reference to the original list. So if you alter the original list while > you're iterating through it you'll see the changes. If you want a full

Re: Object-oriented philosophy

2018-09-06 Thread Thomas Jollans
On 2018-09-06 17:40, Abdur-Rahmaan Janhangeer wrote: > Also, get someone, preferrable a python engineer to review your code. Does anyone here know anyone who would refer to themselves as a "Python engineer" with a straight face? I merely ask... -- Thomas -- https://mail.python.org/mailman/listin

don't quite understand mailing list

2018-09-06 Thread VanDyk, Richard T
Greetings; I sent in a question on how to install robot framework on python 3.7 using pip (or any other way). None of the commands on the >>> seem to work for me. I was asked to update the c/c++ runtime which I don't know what that means. I was also asked to subscribe to the mailing list. I did

Re: Why emumerated list is empty on 2nd round of print?

2018-09-06 Thread Chris Angelico
On Fri, Sep 7, 2018 at 4:50 AM, Viet Nguyen via Python-list wrote: >> Because it's not an enumerated list, it's an enumerated iterator. >> Generally, you'll just use that directly in the loop: >> >> for i, value in enumerate(numbers): >> >> There's generally no need to hang onto it from one loop t

RE: Why emumerated list is empty on 2nd round of print?

2018-09-06 Thread David Raymond
The actual "enumerate" object is really just holding a current index and a reference to the original list. So if you alter the original list while you're iterating through it you'll see the changes. If you want a full copy then you can just wrap it with list() Python 3.7.0 (v3.7.0:1bf9cc5093, J

Re: Why emumerated list is empty on 2nd round of print?

2018-09-06 Thread Viet Nguyen via Python-list
On Thursday, September 6, 2018 at 10:34:19 AM UTC-7, Chris Angelico wrote: > On Fri, Sep 7, 2018 at 3:26 AM, Viet Nguyen via Python-list > wrote: > numList > > [2, 7, 22, 30, 1, 8] > > > aList = enumerate(numList) > > > for i,j in aList:print(i,j) > > > > 0 2 > > 1 7 > > 2 22 > > 3

Re: Why emumerated list is empty on 2nd round of print?

2018-09-06 Thread Chris Angelico
On Fri, Sep 7, 2018 at 3:26 AM, Viet Nguyen via Python-list wrote: numList > [2, 7, 22, 30, 1, 8] > aList = enumerate(numList) > for i,j in aList:print(i,j) > > 0 2 > 1 7 > 2 22 > 3 30 > 4 1 > 5 8 > for i,j in aList:print(i,j) > Because it's not an enumerated list, it's a

Why emumerated list is empty on 2nd round of print?

2018-09-06 Thread Viet Nguyen via Python-list
>>> numList [2, 7, 22, 30, 1, 8] >>> aList = enumerate(numList) >>> for i,j in aList:print(i,j) 0 2 1 7 2 22 3 30 4 1 5 8 >>> for i,j in aList:print(i,j) >>> -- https://mail.python.org/mailman/listinfo/python-list

Re: Debug script under pdb, how to avoid a bunch of errors caused by the exit()?

2018-09-06 Thread Oscar Benjamin
On Thu, 6 Sep 2018 at 10:59, Jach Fong wrote: > > Here the script file, test0.py: > -- > password = 'bad' > if password == 'bad': > print('bad password') > exit() > else: > print('good password') > > print('something else to do') > >

OpenSSL error

2018-09-06 Thread Peng Yu
Hi, I got the following error. Does anybody know how to fix it? Thanks. $ pip Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/bin/pip", line 7, in from pip._internal import main File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python

Re: fsxNet Usenet gateway problem again

2018-09-06 Thread Thomas Jollans
On 2018-09-06 15:50, Michael Torrie wrote: > On 09/05/2018 02:30 PM, Chris Angelico wrote: >> I don't think this was spamming the list with the same question; a >> glitch somewhere in a netnews server appears to be re-posting some old >> posts. > > I wonder why this bbs gateway in New Zealand keep

Re: Object-oriented philosophy

2018-09-06 Thread Abdur-Rahmaan Janhangeer
Also, get someone, preferrable a python engineer to review your code. yours, Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/listinfo/python-list

Re: Object-oriented philosophy

2018-09-06 Thread Rhodri James
On 06/09/18 15:04, Michael F. Stemper wrote: Net net is that the only thing that ended up being common was the __init__ methods. Two of the classes have identical __init__ methods; the third has a superset of that method. The other methods all have completely different implementations. This isn't

EuroPython 2018: Videos for Friday available

2018-09-06 Thread M.-A. Lemburg
We are pleased to announce the third and last batch of cut videos from EuroPython 2018 in Edinburgh, Scotland, UK. * EuroPython 2018 YouTube Playlist * https://www.youtube.com/watch?v=UXSr1OL5JKo&t=0s&index=130&list=PL8uoeex94UhFrNUV2m5MigREebUms39U5 In the last batch, we have

Re: Object-oriented philosophy

2018-09-06 Thread Marko Rauhamaa
"Michael F. Stemper" : > Since the three classes all had common methods (by design), I > thought that maybe refactoring these three classes to inherit from > a parent class would be beneficial. I went ahead and did so. > (Outlines of before and after are at the end of the post.) > > Net net is tha

Object-oriented philosophy

2018-09-06 Thread Michael F. Stemper
Over the summer, I've been working on a simulation. After months of design and redesign, I finally coded it up in two days over Labor Day weekend. Works great. The core of the simulation is a set of models of three different types of electrical loads (characterized based on how they respond to vol

fsxNet Usenet gateway problem again

2018-09-06 Thread Michael Torrie
On 09/05/2018 02:30 PM, Chris Angelico wrote: > I don't think this was spamming the list with the same question; a > glitch somewhere in a netnews server appears to be re-posting some old > posts. I wonder why this bbs gateway in New Zealand keeps doing this. Seems like someone contacts the postm

Re: CURSES WINDOWS

2018-09-06 Thread Anssi Saari
Peter via Python-list writes: >>     from _curses import * >> ModuleNotFoundError: No module named '_curses' Oh yes, I tested in Cygwin and maybe it doesn't count? But for Windows there's a curses wheel available at https://www.lfd.uci.edu/~gohlke/pythonlibs/#curses -- https://mail.python.org/

Re: Any SML coders able to translate this to Python?

2018-09-06 Thread Marko Rauhamaa
Chris Angelico : > The request was to translate this into Python, not to slavishly > imitate every possible semantic difference even if it won't actually > affect behaviour. I trust Steven to be able to refactor the code into something more likable. His only tripping point was the meaning of the "

Debug script under pdb, how to avoid a bunch of errors caused by the exit()?

2018-09-06 Thread Jach Fong
Here the script file, test0.py: -- password = 'bad' if password == 'bad': print('bad password') exit() else: print('good password') print('something else to do') When running it under Python3.4 Windows Vista, no problem at all. D:

Re: Any SML coders able to translate this to Python?

2018-09-06 Thread Chris Angelico
On Thu, Sep 6, 2018 at 7:22 PM, Antoon Pardon wrote: > On 06-09-18 10:50, Chris Angelico wrote: >> On Thu, Sep 6, 2018 at 6:44 PM, Marko Rauhamaa wrote: >>> Chris Angelico : >>> On Thu, Sep 6, 2018 at 2:29 PM, Marko Rauhamaa wrote: > Marko Rauhamaa (Marko Rauhamaa): >> Steven D'Apr

Re: Any SML coders able to translate this to Python?

2018-09-06 Thread Antoon Pardon
On 06-09-18 10:50, Chris Angelico wrote: > On Thu, Sep 6, 2018 at 6:44 PM, Marko Rauhamaa wrote: >> Chris Angelico : >> >>> On Thu, Sep 6, 2018 at 2:29 PM, Marko Rauhamaa wrote: Marko Rauhamaa (Marko Rauhamaa): > Steven D'Aprano : >> I have this snippet of SML code which I'm trying

Re: Any SML coders able to translate this to Python?

2018-09-06 Thread Marko Rauhamaa
Chris Angelico : > On Thu, Sep 6, 2018 at 6:44 PM, Marko Rauhamaa wrote: > And even more idiomatically, Python doesn't require a new scope just > for a new variable. So a much more idiomatic translation would be to > simply ensure that the inner variable can't collide, and then ignore > the funct

Re: Any SML coders able to translate this to Python?

2018-09-06 Thread Chris Angelico
On Thu, Sep 6, 2018 at 6:44 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Thu, Sep 6, 2018 at 2:29 PM, Marko Rauhamaa wrote: >>> Marko Rauhamaa (Marko Rauhamaa): Steven D'Aprano : > I have this snippet of SML code which I'm trying to translate to Python: > > fun isqrt n =

Re: Any SML coders able to translate this to Python?

2018-09-06 Thread Marko Rauhamaa
Chris Angelico : > On Thu, Sep 6, 2018 at 2:29 PM, Marko Rauhamaa wrote: >> Marko Rauhamaa (Marko Rauhamaa): >>> Steven D'Aprano : I have this snippet of SML code which I'm trying to translate to Python: fun isqrt n = if n=0 then 0 else let val r = isqrt (n/4) >>

Re: Any SML coders able to translate this to Python?

2018-09-06 Thread Chris Angelico
On Thu, Sep 6, 2018 at 2:29 PM, Marko Rauhamaa wrote: > Marko Rauhamaa (Marko Rauhamaa): >> Steven D'Aprano : >>> I have this snippet of SML code which I'm trying to translate to Python: >>> >>> fun isqrt n = if n=0 then 0 >>> else let val r = isqrt (n/4) >>> in >>>