Re: Python question

2017-03-24 Thread Cameron Simpson
On 24Mar2017 18:08, Abdul Abdul wrote: I hope you are doing fine. I have added a question on StackOverflow and thought you might have an idea on it. This is the question Hi Adbul, Please j

Re: Subprocess .wait() is not waiting

2017-03-24 Thread adam.c.bernier
On Friday, March 24, 2017 at 2:27:09 PM UTC-7, eryk sun wrote: > On Fri, Mar 24, 2017 at 8:44 PM, adam.c.bernier wrote: > > On Friday, March 24, 2017 at 1:37:49 PM UTC-7, eryk sun wrote: > > > >> Without knowing the command you're running, all we can do is > >> speculate. It could be that it's an

Re: Subprocess .wait() is not waiting

2017-03-24 Thread eryk sun
On Fri, Mar 24, 2017 at 8:44 PM, adam.c.bernier wrote: > On Friday, March 24, 2017 at 1:37:49 PM UTC-7, eryk sun wrote: > >> Without knowing the command you're running, all we can do is >> speculate. It could be that it's an application that uses a single >> instance, in which case running another

Re: Subprocess .wait() is not waiting

2017-03-24 Thread eryk sun
On Fri, Mar 24, 2017 at 8:24 PM, Ian Kelly wrote: > On Fri, Mar 24, 2017 at 2:09 PM, Chris Angelico wrote: > >> Errr been a while since I messed with Windows from memory, I >> think you can "start /wait programname" to make it wait?? Worth a try, >> at least. > > start /wait is for batch

Re: Subprocess .wait() is not waiting

2017-03-24 Thread adam.c.bernier
On Friday, March 24, 2017 at 1:37:49 PM UTC-7, eryk sun wrote: > On Fri, Mar 24, 2017 at 6:42 PM, adam.c.bernier wrote: > > > > I am on Windows 7. Python 2.7 > > > > I'm trying to have a program run another program using `subprocess.Popen` > > > > import subprocess as sp > > > > args = shl

Re: Subprocess .wait() is not waiting

2017-03-24 Thread adam.c.bernier
On Friday, March 24, 2017 at 1:09:49 PM UTC-7, Chris Angelico wrote: > On Sat, Mar 25, 2017 at 6:55 AM, adam.c.bernier wrote: > > On Friday, March 24, 2017 at 12:55:30 PM UTC-7, adam.c.bernier wrote: > >> On Friday, March 24, 2017 at 12:51:02 PM UTC-7, Chris Angelico wrote: > >> > On Sat, Mar 25,

Re: Subprocess .wait() is not waiting

2017-03-24 Thread eryk sun
On Fri, Mar 24, 2017 at 6:42 PM, adam.c.bernier wrote: > > I am on Windows 7. Python 2.7 > > I'm trying to have a program run another program using `subprocess.Popen` > > import subprocess as sp > > args = shlex.split(args) Is this command supposed to run cross-platform? If not, then spli

Re: Subprocess .wait() is not waiting

2017-03-24 Thread Ian Kelly
On Fri, Mar 24, 2017 at 2:09 PM, Chris Angelico wrote: > On Sat, Mar 25, 2017 at 6:55 AM, adam.c.bernier wrote: >> On Friday, March 24, 2017 at 12:55:30 PM UTC-7, adam.c.bernier wrote: >>> On Friday, March 24, 2017 at 12:51:02 PM UTC-7, Chris Angelico wrote: >>> > On Sat, Mar 25, 2017 at 6:40 AM,

Re: Surprised by the lack of constant folding

2017-03-24 Thread duncan smith
On 24/03/17 19:35, Tim Chase wrote: > Playing around, I came across the following > > $ python3 > Python 3.4.2 (default, Oct 8 2014, 10:45:20) > [GCC 4.9.1] on linux > Type "help", "copyright", "credits" or "license" for more information. from dis import dis def f(x): > ... return

Re: Subprocess .wait() is not waiting

2017-03-24 Thread Chris Angelico
On Sat, Mar 25, 2017 at 6:55 AM, adam.c.bernier wrote: > On Friday, March 24, 2017 at 12:55:30 PM UTC-7, adam.c.bernier wrote: >> On Friday, March 24, 2017 at 12:51:02 PM UTC-7, Chris Angelico wrote: >> > On Sat, Mar 25, 2017 at 6:40 AM, Ian Kelly wrote: >> > > If that's what's happening it would

Re: Subprocess .wait() is not waiting

2017-03-24 Thread adam.c.bernier
On Friday, March 24, 2017 at 12:41:22 PM UTC-7, Ian wrote: > On Fri, Mar 24, 2017 at 12:42 PM, adam.c.bernier > wrote: > > Hi, > > > > I am on Windows 7. Python 2.7 > > > > I'm trying to have a program run another program using `subprocess.Popen` > > > > import subprocess as sp > > > > ar

Re: Subprocess .wait() is not waiting

2017-03-24 Thread adam.c.bernier
On Friday, March 24, 2017 at 12:55:30 PM UTC-7, adam.c.bernier wrote: > On Friday, March 24, 2017 at 12:51:02 PM UTC-7, Chris Angelico wrote: > > On Sat, Mar 25, 2017 at 6:40 AM, Ian Kelly wrote: > > > If that's what's happening it would be a bug. Are you sure that the > > > other program isn't si

Re: Subprocess .wait() is not waiting

2017-03-24 Thread adam.c.bernier
On Friday, March 24, 2017 at 12:51:02 PM UTC-7, Chris Angelico wrote: > On Sat, Mar 25, 2017 at 6:40 AM, Ian Kelly wrote: > > If that's what's happening it would be a bug. Are you sure that the > > other program isn't simply crashing or otherwise failing to complete? > > > > Or possibly is runnin

Re: Subprocess .wait() is not waiting

2017-03-24 Thread Chris Angelico
On Sat, Mar 25, 2017 at 6:40 AM, Ian Kelly wrote: > If that's what's happening it would be a bug. Are you sure that the > other program isn't simply crashing or otherwise failing to complete? > Or possibly is running asynchronously. Is this a GUI app? A lot of Windows GUI programs don't wait when

Re: Surprised by the lack of constant folding

2017-03-24 Thread Ian Kelly
On Fri, Mar 24, 2017 at 1:35 PM, Tim Chase wrote: > Playing around, I came across the following > > $ python3 > Python 3.4.2 (default, Oct 8 2014, 10:45:20) > [GCC 4.9.1] on linux > Type "help", "copyright", "credits" or "license" for more information. from dis import dis def f(x): > ..

Re: Surprised by the lack of constant folding

2017-03-24 Thread Chris Angelico
On Sat, Mar 25, 2017 at 6:35 AM, Tim Chase wrote: > $ python3 > Python 3.4.2 (default, Oct 8 2014, 10:45:20) > [GCC 4.9.1] on linux > Type "help", "copyright", "credits" or "license" for more information. from dis import dis def f(x): > ... return x * 1024 * 1024 > ... dis(f) >

Re: Subprocess .wait() is not waiting

2017-03-24 Thread Ian Kelly
On Fri, Mar 24, 2017 at 12:42 PM, adam.c.bernier wrote: > Hi, > > I am on Windows 7. Python 2.7 > > I'm trying to have a program run another program using `subprocess.Popen` > > import subprocess as sp > > args = shlex.split(args) > proc = sp.Popen(args,stdout=sp.PIPE,stderr=sp.PIPE) >

Surprised by the lack of constant folding

2017-03-24 Thread Tim Chase
Playing around, I came across the following $ python3 Python 3.4.2 (default, Oct 8 2014, 10:45:20) [GCC 4.9.1] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from dis import dis >>> def f(x): ... return x * 1024 * 1024 ... >>> dis(f) 2 0 LOAD

Subprocess .wait() is not waiting

2017-03-24 Thread adam.c.bernier
Hi, I am on Windows 7. Python 2.7 I'm trying to have a program run another program using `subprocess.Popen` import subprocess as sp args = shlex.split(args) proc = sp.Popen(args,stdout=sp.PIPE,stderr=sp.PIPE) out, err = proc.communicate() proc.wait() But it *sometimes* does

Re: syntax error in first-time user script

2017-03-24 Thread Terry Reedy
On 3/23/2017 9:57 PM, john polo wrote: If I use IDLE shell: "python comment.py" "SyntaxError: invalid syntax" IDLE's Shell runs your input with nearly identical results as with the standard interactive interpreter, including exceptions. I know I can open the file in the editor and use F5

Python question

2017-03-24 Thread Abdul Abdul
Hello, I hope you are doing fine. I have added a question on StackOverflow and thought you might have an idea on it. This is the question . Thanks a lot for your kind support. Best, Abder --

Re: syntax error in first-time user script

2017-03-24 Thread john polo
On 3/24/2017 9:11 AM, Bob Gailer wrote: On Mar 24, 2017 4:53 AM, "john polo" > wrote: > > Greetings, > I am attempting to learn Python. I have no programming background. I'm on a computer with Windows 7. I checked the PATH in System Variables and Python and Python\S

Re: syntax error in first-time user script

2017-03-24 Thread Bob Gailer
On Mar 24, 2017 4:53 AM, "john polo" wrote: > > Greetings, > I am attempting to learn Python. I have no programming background. I'm on a computer with Windows 7. I checked the PATH in System Variables and Python and Python\Scripts are in the path. I have a book, Python for Biologists and it suppli

Re: Manager for project templates, that allows "incremental" feature addition

2017-03-24 Thread Lele Gaifax
Paul Moore writes: > On Thursday, 23 March 2017 15:56:43 UTC, Paul Moore wrote: > > Sadly, it doesn't support Windows, which is what I use. FYI, I just saw https://pypi.python.org/pypi/what/0.4.0, that seems an alternative port of Inquirer.js. Unfortunately it's Py2 only :-\ If you can t

EuroPython 2017: Get ready for EuroPython Call for Proposals

2017-03-24 Thread M.-A. Lemburg
Thinking of giving your contribution to EuroPython? Starting from March 27th you can submit a proposal on every aspect of Python: programming from novice to advanced levels, applications and frameworks, or how you have been involved in introducing Python into your organization. We offer a variety

Re: syntax error in first-time user script

2017-03-24 Thread Peter Otten
john polo wrote: > Greetings, > I am attempting to learn Python. I have no programming background. I'm > on a computer with Windows 7. I checked the PATH in System Variables and > Python and Python\Scripts are in the path. I have a book, Python for > Biologists and it supplies example scripts, one

Re: SNMP

2017-03-24 Thread Kouli
Have a look at https://snimpy.readthedocs.io/en/latest/ On Fri, Mar 24, 2017 at 12:07 AM, Matt wrote: > What is easiest way to read and write SNMP values with Python? > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

syntax error in first-time user script

2017-03-24 Thread john polo
Greetings, I am attempting to learn Python. I have no programming background. I'm on a computer with Windows 7. I checked the PATH in System Variables and Python and Python\Scripts are in the path. I have a book, Python for Biologists and it supplies example scripts, one is called comment.py.