Re: In asyncio, does the event_loop still running after run_until_complete returned?

2018-04-03 Thread Ian Kelly
On Tue, Apr 3, 2018 at 9:20 PM, wrote: > What's the purpose of resetting self._stopping back to False in finally > clause? Presumably so that the loop won't immediately stop again if you restart it. -- https://mail.python.org/mailman/listinfo/python-list

Re: julian 0.14 library

2018-04-03 Thread Chris Angelico
On Wed, Apr 4, 2018 at 12:24 PM, sum abiut wrote: > Hi, > Has anyone try this https://pypi.python.org/pypi/julian/0.14 > > i got this error trying to import julian > import julian > Traceback (most recent call last): > File "", line 1, in > File "/usr/local/lib/python2.7/dist-packages/ju

Re: In asyncio, does the event_loop still running after run_until_complete returned?

2018-04-03 Thread jfong
Ian於 2018年4月3日星期二 UTC+8下午1時38分57秒寫道: > On Mon, Apr 2, 2018 at 9:01 PM, wrote: > > def run_forever(self): > """Run until stop() is called.""" >try: > events._set_running_loop(self) > while True: > self._run_once() > if se

Re: Python aliases under Windows?

2018-04-03 Thread eryk sun
On Tue, Apr 3, 2018 at 8:16 PM, Kirill Balunov wrote: > > will `py -3.6 ...` work if Python36 is not on the Path? Yes, by default it will work. When installed for all users, the launcher is installed in the Windows directory. For a per-user install, the launcher is installed in a subdirectory of

Re: In asyncio, does the event_loop still running after run_until_complete returned?

2018-04-03 Thread Steven D'Aprano
On Mon, 02 Apr 2018 23:37:51 -0600, Ian Kelly wrote: > If it helps to demystify things, here is a simplified version of what > run_until_complete actually does: > > def run_until_complete(self, future): > """Run until the Future is done. > > If the argument is a coroutine, it

julian 0.14 library

2018-04-03 Thread sum abiut
Hi, Has anyone try this https://pypi.python.org/pypi/julian/0.14 i got this error trying to import julian >>> import julian Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/julian/__init__.py", line 1, in from julian.julian import to_jd

Re: Python aliases under Windows?

2018-04-03 Thread Terry Reedy
On 4/3/2018 4:16 PM, Kirill Balunov wrote: Thank you Ian, Terry, Eryk! Now I understand the purpose of py launcher in general. I don't have Windows near, will `py -3.6 ...` work if Python36 is not on the Path? Yes. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: logging.FileHandler diff Py2 v Py3

2018-04-03 Thread Skip Montanaro
> > >> I think the culprit is io.open() rather than the logging module. Why > does > Thanks, Peter. It never even occurred to me to look at the source code around the call. I saw open() and thought "built-in open". I forgot that the io package supplanted a bunch of lower level i/o. I'll poke arou

Re: Python aliases under Windows?

2018-04-03 Thread Kirill Balunov
2018-04-03 22:04 GMT+03:00 eryk sun : > On Tue, Apr 3, 2018 at 3:43 PM, Ian Kelly wrote: > > > > Because py.exe is really meant to solve a slightly different problem. > > On Unix if you have a .py script and you run it directly, without > > specifying which interpreter to use, the convention is t

Re: Python aliases under Windows?

2018-04-03 Thread eryk sun
On Tue, Apr 3, 2018 at 3:43 PM, Ian Kelly wrote: > > Because py.exe is really meant to solve a slightly different problem. > On Unix if you have a .py script and you run it directly, without > specifying which interpreter to use, the convention is to start the > script with a shebang line, and the

Re: logging.FileHandler diff Py2 v Py3

2018-04-03 Thread Peter Otten
Paul Moore wrote: > On 3 April 2018 at 17:54, Peter Otten <__pete...@web.de> wrote: >> I think the culprit is io.open() rather than the logging module. Why does >> > io.open("/dev/stderr", "a") >> Traceback (most recent call last): >> File "", line 1, in >> OSError: [Errno 29] Illegal seek

Re: semicolon at end of python's statements

2018-04-03 Thread Tobiah
On 04/03/2018 09:48 AM, kar...@gmail.com wrote: Semicolon is optional. If you put a semicolon at the end of the of a statement, you can keep writing statements. a=3;b=2 PyCharm still complains about two statements on one line and sites Pep 8. I never used to pay much attention to Pep 8, but

Re: Python aliases under Windows?

2018-04-03 Thread Terry Reedy
On 4/3/2018 11:43 AM, Ian Kelly wrote: On Tue, Apr 3, 2018 at 9:00 AM, Kirill Balunov wrote: In fact, I do not really understand why the _py launcher_ way is easier or better than `python3` or `python3.6` way even on Windows. There are already `pip.exe`, `pip3.exe`, `pip3.6.exe` which solve the

Re: logging.FileHandler diff Py2 v Py3

2018-04-03 Thread Paul Moore
On 3 April 2018 at 17:54, Peter Otten <__pete...@web.de> wrote: > I think the culprit is io.open() rather than the logging module. Why does > io.open("/dev/stderr", "a") > Traceback (most recent call last): > File "", line 1, in > OSError: [Errno 29] Illegal seek > > even try to seek()? Be

Re: logging.FileHandler diff Py2 v Py3

2018-04-03 Thread Peter Otten
Skip Montanaro wrote: > I've encountered a problem in an application I'm porting from Python > 2.7 to 3.6. The logginng.FileHandler class likes "/dev/stderr" as a > destination in Python 2, but complains in Python 3. > > Python 2.7.14: > import logging logging.FileHandler("/dev/stderr"

Re: semicolon at end of python's statements

2018-04-03 Thread karuse
Semicolon is optional. If you put a semicolon at the end of the of a statement, you can keep writing statements. a=3;b=2 -- https://mail.python.org/mailman/listinfo/python-list

Re: semicolon at end of python's statements

2018-04-03 Thread Tobiah
On 04/01/2018 11:31 PM, dlt.joaq...@gmail.com wrote: El miércoles, 28 de agosto de 2013, 21:18:26 (UTC-3), Mohsen Pahlevanzadeh escribió: Dear all, I'm C++ programmer and unfortunately put semicolon at end of my statements in python. Quesion: What's really defferences between putting semico

Re: Python aliases under Windows?

2018-04-03 Thread Ian Kelly
On Tue, Apr 3, 2018 at 9:00 AM, Kirill Balunov wrote: > In fact, I do not really understand why the _py launcher_ way is easier or > better than `python3` or `python3.6` way even on Windows. There are already > `pip.exe`, `pip3.exe`, `pip3.6.exe` which solve the same problem, but they > are all r

logging.FileHandler diff Py2 v Py3

2018-04-03 Thread Skip Montanaro
I've encountered a problem in an application I'm porting from Python 2.7 to 3.6. The logginng.FileHandler class likes "/dev/stderr" as a destination in Python 2, but complains in Python 3. Python 2.7.14: >>> import logging >>> logging.FileHandler("/dev/stderr") Python 3.6.4: >>> import logging

Re: Python aliases under Windows?

2018-04-03 Thread Kirill Balunov
2018-04-03 16:45 GMT+03:00 Paul Moore : > On 3 April 2018 at 10:24, Kirill Balunov wrote: > > Perhaps this is a silly question but still...There is PEP 394 "The > "python" > > Command on Unix-Like Systems" which I find very reasonable, no matter how > > it is respected. Why was not _somewhat_ the

Re: Python aliases under Windows?

2018-04-03 Thread Kirill Balunov
2018-04-03 16:15 GMT+03:00 Ian Kelly : > Creating python2.bat and python3.bat instead would take up less > additional disk space and would not need to be modified every time you > reinstall a new release of the same minor version. > > Thank you! > > This > > copy-rename works for me, but it will

Re: Python aliases under Windows?

2018-04-03 Thread Paul Moore
On 3 April 2018 at 10:24, Kirill Balunov wrote: > Perhaps this is a silly question but still...There is PEP 394 "The "python" > Command on Unix-Like Systems" which I find very reasonable, no matter how > it is respected. Why was not _somewhat_ the same done for Windows? History, mainly. Plus the

Re: Python aliases under Windows?

2018-04-03 Thread Ian Kelly
On Tue, Apr 3, 2018 at 3:24 AM, Kirill Balunov wrote: > Perhaps this is a silly question but still...There is PEP 394 "The "python" > Command on Unix-Like Systems" which I find very reasonable, no matter how > it is respected. Why was not _somewhat_ the same done for Windows? PEP 394 is meant to

Re: Python aliases under Windows?

2018-04-03 Thread Kirill Balunov
2018-04-03 12:27 GMT+03:00 Chris Angelico : > > Why doesn't it? That's what its job is. > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > Because it affects my workflow under Windows and Linux. I have two options: 1. To wriie a shell script for `py` under Linux. 2. To copy-

Re: Python aliases under Windows?

2018-04-03 Thread Chris Angelico
On Tue, Apr 3, 2018 at 7:24 PM, Kirill Balunov wrote: > Perhaps this is a silly question but still...There is PEP 394 "The "python" > Command on Unix-Like Systems" which I find very reasonable, no matter how > it is respected. Why was not _somewhat_ the same done for Windows? > > Sometimes I use,

Python aliases under Windows?

2018-04-03 Thread Kirill Balunov
Perhaps this is a silly question but still...There is PEP 394 "The "python" Command on Unix-Like Systems" which I find very reasonable, no matter how it is respected. Why was not _somewhat_ the same done for Windows? Sometimes I use, especially in IPython, to run externally: ! python3 -m dis ! py