Re: name 'aLOCK' is not defined When I add aLOCK = threading.RLock() behind if __name__ == "__main__"

2018-08-09 Thread Steven D'Aprano
On Fri, 10 Aug 2018 08:15:09 +0200, Karsten Hilbert wrote: > On Fri, Aug 10, 2018 at 12:24:25AM +0800, xuanwu348 wrote: > >> Yes, move the code from positionA(can run normally) to >> positionB(exception with name undefined) I find this content >> "https://docs.python.org/3.3/tutorial/classes.html

Re: Embedded Python and multiprocessing on Windows?

2018-08-09 Thread Léo El Amri via Python-list
On 09/08/2018 19:33, Apple wrote:> So my program runs one script file, and multiprocessing commands from that script file seem to fail to spawn new processes. > > However, if that script file calls a function in a separate script file that > it has imported, and that function calls multiprocessin

Re: Re: name 'aLOCK' is not defined When I add aLOCK = threading.RLock() behind if __name__ == "__main__"

2018-08-09 Thread Karsten Hilbert
On Fri, Aug 10, 2018 at 12:24:25AM +0800, xuanwu348 wrote: > Yes, move the code from positionA(can run normally) to positionB(exception > with name undefined) > I find this content > "https://docs.python.org/3.3/tutorial/classes.html#python-scopes-and-namespaces"; > But I still don't undewrstand

[Promotion] Book for Data Science Aspirants

2018-08-09 Thread Karthikeyan A K
Hello Python people, Two years ago, my profession changed, I had to do data science work. When I started it, I (though I knew Python) found it to be extremely difficult and I had these doubts: What to learn? Where to learn? Am I doing things right? Where can I find a person who would guide me i

回复: Re: name 'aLOCK' is not defined When I add aLOCK = threading.RLock() behind if __name__ == "__main__"

2018-08-09 Thread jinliang
Thanks, I think I get the answer. thanks all, have a good day! 从三星移动设备发送 原始邮件 发件人: MRAB 日期:2018-08-10 03:05 (GMT+08:00) 收件人: python-list@python.org 主题: Re: name 'aLOCK' is not defined When I add aLOCK = threading.RLock() behind if __name__ == "__main__" On 2018-08-09

Python MySQL Guide

2018-08-09 Thread vishalhule24
Refer this complete guide on working with Python and MySQL https://pynative.com/python-mysql-tutorial/ -- https://mail.python.org/mailman/listinfo/python-list

tabs vs. spaces

2018-08-09 Thread Larry Martell
https://www.youtube.com/watch?v=SsoOG6ZeyUI&feature=youtu.be -- https://mail.python.org/mailman/listinfo/python-list

Re: name 'aLOCK' is not defined When I add aLOCK = threading.RLock() behind if __name__ == "__main__"

2018-08-09 Thread MRAB
On 2018-08-09 16:16, xuanwu348 wrote: Hi team Good day The problem I meet when I add "aLOCK = threading.RLock()" to PositionB, the program will report error "name 'aLOCK' is not defined ", but when I change this code to PositionA, it can run normally, is there any difference for the code betwe

Re: Why this regex for string literals can't handle escaped quotes?.... '"(\\.|[^"])*"'

2018-08-09 Thread cseberino
Wow. Thanks. That cleared everything up. cs -- https://mail.python.org/mailman/listinfo/python-list

Re: Why this regex for string literals can't handle escaped quotes?.... '"(\\.|[^"])*"'

2018-08-09 Thread Peter Otten
cseber...@gmail.com wrote: > Why this regex for string literals > can't handle escaped quotes? '"(\\.|[^"])*"' > > See this... > string_re = '"(\\.|[^"])*"' > re.match(string_re, '""') > <_sre.SRE_Match object; span=(0, 6), match='""'> > re.match(string_re, '"aa\"aa"

Re:Re: name 'aLOCK' is not defined When I add aLOCK = threading.RLock() behind if __name__ == "__main__"

2018-08-09 Thread xuanwu348
Thanks for your reply! Yes, move the code from positionA(can run normally) to positionB(exception with name undefined) I find this content "https://docs.python.org/3.3/tutorial/classes.html#python-scopes-and-namespaces"; But I still don't undewrstand the differenct of scopes-and-namespaces betwe

Re: name 'aLOCK' is not defined When I add aLOCK = threading.RLock() behind if __name__ == "__main__"

2018-08-09 Thread Karsten Hilbert
On Thu, Aug 09, 2018 at 11:16:37PM +0800, xuanwu348 wrote: > The problem I meet when I add "aLOCK = threading.RLock()" to PositionB, the > program will report error "name 'aLOCK' is not defined ", You mean to say: *move*, not *add*. That is why aLock is out of scope. /python3-doc/h

Why this regex for string literals can't handle escaped quotes?.... '"(\\.|[^"])*"'

2018-08-09 Thread cseberino
Why this regex for string literals can't handle escaped quotes? '"(\\.|[^"])*"' See this... >>> string_re = '"(\\.|[^"])*"' >>> re.match(string_re, '""') <_sre.SRE_Match object; span=(0, 6), match='""'> >>> re.match(string_re, '"aa\"aa"') <_sre.SRE_Match object; span=(0, 4), match=

name 'aLOCK' is not defined When I add aLOCK = threading.RLock() behind if __name__ == "__main__"

2018-08-09 Thread xuanwu348
Hi team Good day The problem I meet when I add "aLOCK = threading.RLock()" to PositionB, the program will report error "name 'aLOCK' is not defined ", but when I change this code to PositionA, it can run normally, is there any difference for the code between 'if __name__ == "__main__:"', can you

Re: failed to execute scapy commands from remote server

2018-08-09 Thread Rhodri James
On 09/08/18 13:11, Iranna Mathapati wrote: 2. When I try to execute scapy cmds in remote server I get the below error child_remote.sendline=sendp(arp3,iface='enp6s0f0',count=100) Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/site-packages/

failed to execute scapy commands from remote server

2018-08-09 Thread Iranna Mathapati
Hi Team, I have to ssh a remote server and execute scapy commands there. but its able to execute all linux commands from remote server handle I use pexpect and hitting issue. 1. SSH to remote shell via pexpect from current server parser_ip_add='192.168.1.83' child_remote = pexpec

Re: using python's logo in your own logo

2018-08-09 Thread Chris Angelico
On Thu, Aug 9, 2018 at 8:38 PM, Alister via Python-list wrote: > On Thu, 09 Aug 2018 12:13:07 +0400, Abdur-Rahmaan Janhangeer wrote: > >> in short, >> >> can you use python's logo in your own logo without credit? >> >> yours, >> >> Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauriti

Re: using python's logo in your own logo

2018-08-09 Thread Alister via Python-list
On Thu, 09 Aug 2018 12:13:07 +0400, Abdur-Rahmaan Janhangeer wrote: > in short, > > can you use python's logo in your own logo without credit? > > yours, > > Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius I would expect the answer to that to be a big NO. I am pretty sure

Re: using python's logo in your own logo

2018-08-09 Thread Thomas Jollans
On 09/08/18 10:13, Abdur-Rahmaan Janhangeer wrote: > in short, > > can you use python's logo in your own logo without credit? > > yours, > > Abdur-Rahmaan Janhangeer > https://github.com/Abdur-rahmaanJ > Mauritius > See https://www.python.org/community/logos/ and https://www.python.org/psf/tra

using python's logo in your own logo

2018-08-09 Thread Abdur-Rahmaan Janhangeer
in short, can you use python's logo in your own logo without credit? yours, Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/listinfo/python-list

Re: Non-unicode file names

2018-08-09 Thread Thomas Jollans
On 09/08/18 05:13, INADA Naoki wrote: > Please use Python 3.7. > > Python 3.7 has several improvements on this area. Thanks! Darkly remembering something about UTF-8 mode, I suspected it might... > > * When PEP 538 or 540 is used, default error handler for stdio is > surrogateescape > * You can