Re: subprocess equivalent for "os.execvp()"?

2023-01-09 Thread Eryk Sun
On 1/9/23, c.bu...@posteo.jp wrote: > > On Python for Windows what is the appropriate way how a process can call > itself again? > > Let me give you an example [1]: > There is a project "bitcli" having two entry points > > [project.scripts] > bitcli = "bitcli.__main__:main" > bitcli-root = "bitcli

Re: subprocess equivalent for "os.execvp()"?

2023-01-09 Thread c . buhtz
Dear Eryk, Am 08.01.2023 17:22 schrieb Eryk Sun: Avoid using any of the `os.exec*` functions on Windows. There's no support for replacing a Windows process image, so the `exec*()` functions simply spawn a child process and terminate the current one. Thanks for bringing this up. On Python for

Re: subprocess equivalent for "os.execvp()"?

2023-01-08 Thread Eryk Sun
On 1/8/23, c.bu...@posteo.jp wrote: > > is there an equivalent in the subprocess module for "os.execvp()" to > replace the current process with the new called one? A note for Windows users Avoid using any of the `os.exec*` functions on Windows. There's no support for replacing a Windows process

Re: subprocess equivalent for "os.execvp()"?

2023-01-08 Thread Chris Angelico
On Sun, 8 Jan 2023 at 21:51, wrote: > > Hello, > > is there an equivalent in the subprocess module for "os.execvp()" to > replace the current process with the new called one? It won't make a subprocess, so no. It's in the os module - under the name execvp. You found it already :) ChrisA -- http

Re: Subprocess Connection error

2021-11-23 Thread Dan Stromberg
Hi. It's important to include the full text of whatever error messages you're getting. If you can, you should also include your code, or better: include an http://sscce.org/ Can you start the python interpreter from bash, powershell or cmd.exe? If not, please again include the full text of any e

Re: Subprocess Connection Error

2020-10-17 Thread Greg Ewing
On 17/10/20 4:04 pm, Dave Dungan wrote: One more thing, the book says to save it as "types.py". Which is probably a bad thing to do, because there is a built-in module called "types" that this will shadow. If IDLE happens to use that module, bad things could happen. Have you tried using a diff

Re: Subprocess Connection Error

2020-10-17 Thread Terry Reedy
On 10/17/2020 5:00 PM, Dan Stromberg wrote: Does this help? https://stackoverflow.com/questions/29567051/python-error-idles-subprocess-didnt-make-connection-either-idle-cant-start I believe I included every legitimate answer on stackoverflow, including that post, in the doc section linked bel

Re: Subprocess Connection Error

2020-10-17 Thread Dan Stromberg
Does this help? https://stackoverflow.com/questions/29567051/python-error-idles-subprocess-didnt-make-connection-either-idle-cant-start On Sat, Oct 17, 2020 at 12:44 PM Dave Dungan via Python-list < python-list@python.org> wrote: > Hello, > > I bought a book called Coding for Beginners to learn

Re: Subprocess Popen confusion

2020-05-19 Thread Barry Scott
> On 18 May 2020, at 21:50, Dick Holmes wrote: snip > Per Peter's suggestion I tried readline and it works "as expected". I > also discovered that the reason the read operations were stalling was > that they followed a write and the write doesn't actually occur until > "flush" is called ev

Re: Subprocess Popen confusion

2020-05-18 Thread Dick Holmes
In article , __pete...@web.de says... > > Dick Holmes wrote: > > > https://occovid19.ochealthinfo.com/coronavirus-in-oc > > > I'm trying to > > communicate using a continuing dialog between two > > processes on the same system. > > I think pexpect > > https://pexpect.readthedocs.io/en/stable

Re: Subprocess Popen confusion

2020-05-14 Thread Dick Holmes
In article , __pete...@web.de says... > > Dick Holmes wrote: > > > https://occovid19.ochealthinfo.com/coronavirus-in-oc > > > I'm trying to > > communicate using a continuing dialog between two > > processes on the same system. > > I think pexpect > > https://pexpect.readthedocs.io/en/stable

Re: Subprocess Popen confusion

2020-05-14 Thread Terry Reedy
On 5/13/2020 11:13 PM, Dick Holmes wrote: https://occovid19.ochealthinfo.com/coronavirus-in-oc I'm trying to communicate using a continuing dialog between two processes on the same system Try multiprocessing and pipes. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-lis

Re: Subprocess Popen confusion

2020-05-14 Thread Peter Otten
Dick Holmes wrote: > https://occovid19.ochealthinfo.com/coronavirus-in-oc > I'm trying to > communicate using a continuing dialog between two > processes on the same system. I think pexpect https://pexpect.readthedocs.io/en/stable/index.html does this naturally, but I don't know if Windows su

Re: Subprocess

2019-06-17 Thread Terry Reedy
On 6/17/2019 11:36 AM, Terry Reedy wrote: On 6/14/2019 11:09 AM, Douglas Beard via Python-list wrote: Error: IDLE's Subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall is blocking the connection.python has been working fine until today. I used the python

Re: Subprocess

2019-06-17 Thread Terry Reedy
On 6/14/2019 11:09 AM, Douglas Beard via Python-list wrote: Error: IDLE's Subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall is blocking the connection.python has been working fine until today. I used the python repair but no luck. it does not seem my

Re: subprocess svn checkout password issue

2019-03-18 Thread Barry
> On 15 Mar 2019, at 22:17, Martin De Kauwe wrote: > > Hi, > > I'm trying to write a script that will make a checkout from a svn repo and > build the result for the user. However, when I attempt to interface with the > shell it asks the user for their filename and I don't know how to captur

Re: subprocess svn checkout password issue

2019-03-16 Thread Michael Torrie
On 03/16/2019 10:08 AM, Grant Edwards wrote: > I don't know about svn specifically, but in the past it was typical > for programs requiring passwords and assuming interactive usage to > issue the password prompt to and read the password from /dev/tty, > rather than stdin/stdout. That allowed their

Re: subprocess svn checkout password issue

2019-03-16 Thread Grant Edwards
On 2019-03-16, dieter wrote: > Otherwise, you must monitor what it written to the subprocess' > "stdout" and "stderr", recognized the interaction request > perform the interaction with the user and send the result > to the subprocess' stdin. I don't know about svn specifically, but in the past i

Re: subprocess svn checkout password issue

2019-03-16 Thread Dan Sommers
On 3/16/19 1:50 AM, Martin De Kauwe wrote: On Saturday, 16 March 2019 16:50:23 UTC+11, dieter wrote: Martin De Kauwe writes: > I'm trying to write a script that will make a checkout from a svn repo and build the result for the user. However, when I attempt to interface with the shell it asks

Re: subprocess svn checkout password issue

2019-03-15 Thread Martin De Kauwe
On Saturday, 16 March 2019 16:50:23 UTC+11, dieter wrote: > Martin De Kauwe writes: > > > I'm trying to write a script that will make a checkout from a svn repo and > > build the result for the user. However, when I attempt to interface with > > the shell it asks the user for their filename an

Re: subprocess svn checkout password issue

2019-03-15 Thread dieter
Martin De Kauwe writes: > I'm trying to write a script that will make a checkout from a svn repo and > build the result for the user. However, when I attempt to interface with the > shell it asks the user for their filename and I don't know how to capture > this with my implementation. > > us

Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-04 Thread Peter Otten
Mohan Mohta wrote: > Hello, > I am trying to grep the keyword (which I got from report_file ) from > report_file > > I tried multiple ways but am unable to get it to work. > > Below are the methods I tried. > > > fp=open(txt_file,'r') > for line in fp : > line=line.strip() >

Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-04 Thread Chris Angelico
On Fri, Jan 4, 2019 at 10:16 PM wrote: > > On Thursday, January 3, 2019 at 9:40:43 PM UTC+1, Chris Angelico wrote: > > On Fri, Jan 4, 2019 at 7:37 AM Mohan Mohta wrote: > > > I am no expert in python but I found grep is lot faster in than the > > > methods of reading files from python point

Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-04 Thread marco . nawijn
On Thursday, January 3, 2019 at 9:40:43 PM UTC+1, Chris Angelico wrote: > On Fri, Jan 4, 2019 at 7:37 AM Mohan Mohta wrote: > > I am no expert in python but I found grep is lot faster in than the methods > > of reading files from python point me to direction if you know of > > anything faste

Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-03 Thread Chris Angelico
On Fri, Jan 4, 2019 at 7:37 AM Mohan Mohta wrote: > I am no expert in python but I found grep is lot faster in than the methods > of reading files from python point me to direction if you know of > anything faster I would appreciate it. > Try doing things the simple and easy way in Python,

Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-03 Thread Mohan Mohta
On Thursday, January 3, 2019 at 1:49:31 PM UTC-6, Chris Angelico wrote: > On Fri, Jan 4, 2019 at 6:46 AM Mohan Mohta wrote: > > > > Hello, > > I am trying to grep the keyword (which I got from report_file ) from > > report_file > > > > I tried multiple ways but am unable to get it to work. > > H

RE: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-03 Thread David Raymond
Agreeing with the other poster that it's probably not the best way to handle it. But for the sake of helping with subprocess: https://docs.python.org/3.7/library/subprocess.html#popen-objects Popen Objects don't have read() as the error says. That's on their .stdout and .stderr streams. So you'd

Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-03 Thread Chris Angelico
On Fri, Jan 4, 2019 at 6:46 AM Mohan Mohta wrote: > > Hello, > I am trying to grep the keyword (which I got from report_file ) from > report_file > > I tried multiple ways but am unable to get it to work. How about, instead, you simply open the file and iterate through it, looking for the keywor

Re: Subprocess Startup Error

2018-03-06 Thread Terry Reedy
On 3/6/2018 6:00 PM, Jeremy Jamar St. Julien wrote: Whenever I try to open the python shell it says IDLE’s subprocess didn’t make a connection. You must be referring to IDLE's GUI Shell, not Python's normal console text (TUI?) shell or REPL. IDLE normally runs its GUI in one process and you

Re: subprocess call question

2017-12-14 Thread Wanderer
That works. Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: subprocess call question

2017-12-14 Thread MRAB
On 2017-12-14 17:35, Wanderer wrote: This dos batch files works on windows 7 "C:\Program Files (x86)\DOOM 3\qoom3.exe" +set fs_game_base darkmod +set fs_game training_mission but this python subprocess.call doesn't subprocess.call(['C:/Program Files (x86)/DOOM 3/qoom3.exe', '+set fs_game_base

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: 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: 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) >

Re: subprocess problem

2017-02-15 Thread Andreas Paeffgen
On 2017-02-11 02:23:12 +, Cameron Simpson said: def your_function(...): with open('/path/to/your/logfile.txt', 'a') as logfp: print("PATH=".os.environ['PATH'], file=logfp) p=Popen(...) p.communicate(...) print("p.returncode=%r" % (p.returncode)) and any

Re: subprocess problem

2017-02-10 Thread Cameron Simpson
On 10Feb2017 11:54, Andreas Paeffgen wrote: Thanks for all the great advice. I tested all the possibilities. So far no luck. If i start the app from a terminal, the solutions work. But not, if i start the app-bundle (There is no connection to a terminal) 1. Copied the path to p.subprocess 2.

Re: subprocess problem

2017-02-10 Thread Andreas Paeffgen
Thanks for all the great advice. I tested all the possibilities. So far no luck. If i start the app from a terminal, the solutions work. But not, if i start the app-bundle (There is no connection to a terminal) 1. Copied the path to p.subprocess 2. Used the def wich: python function 3. Used sh

Re: subprocess problem

2017-02-09 Thread Cameron Simpson
On 10Feb2017 00:03, eryk sun wrote: On Thu, Feb 9, 2017 at 10:50 PM, Cameron Simpson wrote: This is why I suggested the check_returncode() method, which examines the error code. You must be thinking of the returncode attribute, which isn't a method. check_returncode() is a method of the Comp

Re: subprocess problem

2017-02-09 Thread eryk sun
On Fri, Feb 10, 2017 at 12:05 AM, Wildman via Python-list wrote: > > Corrected code: > > def which(target) > for p in pathlist: > fullpath = p + "/" + target > if os.path.isfile(fullpath) and os.access(fullpath, os.X_OK): > return fullpath, True > return None, F

Re: subprocess problem

2017-02-09 Thread MRAB
On 2017-02-10 00:05, Wildman via Python-list wrote: On Fri, 10 Feb 2017 09:53:32 +1100, Cameron Simpson wrote: On 09Feb2017 11:59, Wildman wrote: Here is a method I frequently use to replace the which command. (air code) import os pathlist = os.environ["PATH"].split(":") def which(target)

Re: subprocess problem

2017-02-09 Thread Wildman via Python-list
On Fri, 10 Feb 2017 09:53:32 +1100, Cameron Simpson wrote: > On 09Feb2017 11:59, Wildman wrote: >>Here is a method I frequently use to replace the which >>command. (air code) >> >>import os >>pathlist = os.environ["PATH"].split(":") >> >>def which(target) >>for p in pathlist: >>fullpa

Re: subprocess problem

2017-02-09 Thread eryk sun
On Thu, Feb 9, 2017 at 10:50 PM, Cameron Simpson wrote: > This is why I suggested the check_returncode() method, which examines the > error code. You must be thinking of the returncode attribute, which isn't a method. check_returncode() is a method of the CompletedProcess object that's returned b

Re: subprocess problem

2017-02-09 Thread Cameron Simpson
On 09Feb2017 11:59, Wildman wrote: Here is a method I frequently use to replace the which command. (air code) import os pathlist = os.environ["PATH"].split(":") def which(target) for p in pathlist: fullpath = p + "/" + target if os.path.isfile(fullpath): return full

Re: subprocess problem

2017-02-09 Thread Cameron Simpson
On 09Feb2017 11:16, Andreas Paeffgen wrote: I guess which does not return an error code. If it does not find anything, the return is just blank. If it finds something, the path is returned. So the change of code did not help, because there is just no error message. Could there be a $path prob

Re: subprocess problem

2017-02-09 Thread Günther Dietrich
Am 09.02.17 um 18:16 schrieb Andreas Paeffgen: > I guess which does not return an error code. In fact, id does return a return code. Here an example: | honk:~ gdie$ which bash; echo $? | /bin/bash | 0 | honk:~ gdie$ which wzlbrmpf; echo $? | 1 It is 0 on success, 1 for a failure. Exactly the res

Re: subprocess problem

2017-02-09 Thread Wildman via Python-list
On Thu, 09 Feb 2017 11:16:18 -0600, Andreas Paeffgen wrote: > I guess which does not return an error code. If it does not find > anything, the return is just blank. If it finds something, the path is > returned. > > So the change of code did not help, because there is just no error message. > C

Re: subprocess problem

2017-02-09 Thread Andreas Paeffgen
I guess which does not return an error code. If it does not find anything, the return is just blank. If it finds something, the path is returned. So the change of code did not help, because there is just no error message. Could there be a $path problem in the subprocess started inside the binar

Re: subprocess problem

2017-02-09 Thread Andreas Paeffgen
Maybe i could use another trick to circumvent the problems in the frozen app? The frozen apps can be downloaded here: https://sourceforge.net/projects/panconvert/files/Newest/ @Cameron: 1. I use PyQT5 for a creating a gui app. To run the app on other systems, where no QT5 and PyQT5 is install

Re: subprocess problem

2017-02-09 Thread Wolfgang Maier
On 09.02.2017 01:56, Andreas Paeffgen wrote: The Problem with the subprocess code is: Using the sourcecode functioning as normal. The frozen app with cx_freeze on every platform just returns an empty result Here is the code in short: def get_path_pandoc(): settings = QSettings('Pandoc', '

Re: subprocess problem

2017-02-09 Thread Wolfgang Maier
On 09.02.2017 01:56, Andreas Paeffgen wrote: The Problem with the subprocess code is: Using the sourcecode functioning as normal. The frozen app with cx_freeze on every platform just returns an empty result Here is the code in short: def get_path_pandoc(): settings = QSettings('Pandoc', '

Re: subprocess problem

2017-02-08 Thread Cameron Simpson
On 08Feb2017 18:56, Andreas Paeffgen wrote: The Problem with the subprocess code is: Using the sourcecode functioning as normal. The frozen app with cx_freeze on every platform just returns an empty result I don't know what the sentence above above cx_freeze means. Here is the code in short

Re: Subprocess Startup Error

2016-08-09 Thread Lawrence D’Oliveiro
On Wednesday, August 10, 2016 at 8:12:10 AM UTC+12, xlarged...@aol.com wrote: > "Either IDLE can't start a subprocess or personal firewall software is > blocking the connection." Q: Why does Windows print such explanatory error messages? A: To give you a hint as to the cause of the problem. -- h

Re: subprocess: xterm -c cat, need to send data to cat and have it displayed in the xterm window

2016-07-12 Thread Lawrence D’Oliveiro
On Tuesday, July 12, 2016 at 3:20:35 PM UTC+12, Veek. M wrote: > I then need to get it translated which also works and then display in > XTerm using cat. -- https://mail.python.org/mailman/listinfo/python-list

Re: subprocess: xterm -c cat, need to send data to cat and have it displayed in the xterm window

2016-07-12 Thread Veek. M
Steven D'Aprano wrote: > On Tuesday 12 July 2016 13:20, Veek. M wrote: > >> Script grabs some image data and runs imagemagick on it to extract >> some chinese. Then tesseract OCR to get the actual unicode. >> >> I then need to get it translated which also works and then display in >> XTerm using

Re: subprocess: xterm -c cat, need to send data to cat and have it displayed in the xterm window

2016-07-12 Thread Random832
On Tue, Jul 12, 2016, at 02:27, Steven D'Aprano wrote: > On Tuesday 12 July 2016 13:20, Veek. M wrote: > > I then need to get it translated which also works and then display in > > XTerm using cat. > > Why not just print it? Why do you have to use cat? Well, displaying something in a new xterm (i

Re: subprocess: xterm -c cat, need to send data to cat and have it displayed in the xterm window

2016-07-11 Thread Steven D'Aprano
On Tuesday 12 July 2016 13:20, Veek. M wrote: > Script grabs some image data and runs imagemagick on it to extract some > chinese. Then tesseract OCR to get the actual unicode. > > I then need to get it translated which also works and then display in > XTerm using cat. Why not just print it? Why

Re: subprocess: xterm -c cat, need to send data to cat and have it displayed in the xterm window

2016-07-11 Thread Steven D'Aprano
On Tuesday 12 July 2016 16:27, Steven D'Aprano wrote: > On Tuesday 12 July 2016 13:20, Veek. M wrote: > >> Script grabs some image data and runs imagemagick on it to extract some >> chinese. Then tesseract OCR to get the actual unicode. >> >> I then need to get it translated which also works and

Re: subprocess startup error

2016-07-02 Thread matej123cekk
try to download pywin (i think that pywin will working ok) url to download https://sourceforge.net/projects/pywin32/files/pywin32/ -- https://mail.python.org/mailman/listinfo/python-list

Re: subprocess startup error

2016-07-02 Thread Terry Reedy
On 7/1/2016 11:43 PM, Veek. M wrote: Shweta Dinnimani wrote: hi hello, I'm begineer to python programming.. I had installed python 3.5.1 version on my windows 7 system. I was fine earlier and now when i was trying the programs on string i'm facing the subprocess startup error. IDLE is not conn

Re: subprocess startup error

2016-07-01 Thread Veek. M
Shweta Dinnimani wrote: > hi > > hello, I'm begineer to python programming.. I had installed python > 3.5.1 version on my windows 7 system. I was fine earlier and now when > i was trying the programs on string i'm facing the subprocess startup > error. IDLE is not connecting. And python shell is

Re: subprocess startup error

2016-02-27 Thread Terry Reedy
On 2/26/2016 10:08 AM, Wolfgang Maier wrote: On 26.02.2016 15:57, Emile van Sebille wrote: On 2/26/2016 6:49 AM, Oscar Benjamin wrote: On 26 February 2016 at 13:30, Peter Otten <__pete...@web.de> wrote: Shweta Dinnimani wrote: i saved my file as string.py since than i'm facing this error Re

Re: subprocess startup error

2016-02-27 Thread Terry Reedy
On 2/26/2016 9:49 AM, Oscar Benjamin wrote: On 26 February 2016 at 13:30, Peter Otten <__pete...@web.de> wrote: Shweta Dinnimani wrote: hello, I'm begineer to python programming.. I had installed python 3.5.1 version on my windows 7 system. I was fine earlier and now when i was trying the prog

Re: subprocess startup error

2016-02-26 Thread Mark Lawrence
On 26/02/2016 15:08, Wolfgang Maier wrote: On 26.02.2016 15:57, Emile van Sebille wrote: On 2/26/2016 6:49 AM, Oscar Benjamin wrote: On 26 February 2016 at 13:30, Peter Otten <__pete...@web.de> wrote: Shweta Dinnimani wrote: i saved my file as string.py since than i'm facing this error Rena

Re: subprocess startup error

2016-02-26 Thread Wolfgang Maier
On 26.02.2016 15:57, Emile van Sebille wrote: On 2/26/2016 6:49 AM, Oscar Benjamin wrote: On 26 February 2016 at 13:30, Peter Otten <__pete...@web.de> wrote: Shweta Dinnimani wrote: i saved my file as string.py since than i'm facing this error Rename that file to something that does not clas

Re: subprocess startup error

2016-02-26 Thread Emile van Sebille
On 2/26/2016 6:49 AM, Oscar Benjamin wrote: On 26 February 2016 at 13:30, Peter Otten <__pete...@web.de> wrote: Shweta Dinnimani wrote: i saved my file as string.py since than i'm facing this error Rename that file to something that does not clash with the module names in the standard library

Re: subprocess startup error

2016-02-26 Thread Oscar Benjamin
On 26 February 2016 at 13:30, Peter Otten <__pete...@web.de> wrote: > Shweta Dinnimani wrote: >>> >>> hello, I'm begineer to python programming.. I had installed python 3.5.1 >>> version on my windows 7 system. I was fine earlier and now when i was >>> trying the programs on string i'm facing the s

Re: subprocess startup error

2016-02-26 Thread Peter Otten
Shweta Dinnimani wrote: > forgot to mention.. > > i saved my file as string.py since than i'm facing this error Rename that file to something that does not clash with the module names in the standard library, mystring.py for example, and IDLE should work again. > On Fri, Feb 26, 2016 at 6:50 P

Re: subprocess startup error

2016-02-26 Thread Shweta Dinnimani
forgot to mention.. i saved my file as string.py since than i'm facing this error On Fri, Feb 26, 2016 at 6:50 PM, Shweta Dinnimani wrote: > hi > > hello, I'm begineer to python programming.. I had installed python 3.5.1 > version on my windows 7 system. I was fine earlier and now when i was >

Re: subprocess check_output

2016-01-07 Thread Chris Angelico
On Thu, Jan 7, 2016 at 9:14 PM, Marko Rauhamaa wrote: > Marko Rauhamaa : > >> Chris Angelico : >> >>> you ask the correct question of "why isn't my CSS file being read?" >> >> TL;DR > > Sorry, getting confused with homonyms: > > >>> CSS gurus suggest, along similar lines, changing the background c

Re: subprocess check_output

2016-01-07 Thread Marko Rauhamaa
Marko Rauhamaa : > Chris Angelico : > >> you ask the correct question of "why isn't my CSS file being read?" > > TL;DR Sorry, getting confused with homonyms: >> CSS gurus suggest, along similar lines, changing the background color >> of something to red. Marko -- https://mail.python.org/mailm

Re: subprocess check_output

2016-01-07 Thread Chris Angelico
On Thu, Jan 7, 2016 at 8:33 PM, me wrote: > On 2016-01-05, Chris Angelico wrote: >> Oh, and then you keep editing and save again? Nah, I've *never* done >> that... Never! > > I'm quite surprised, buddy. You should definitely try. I know, right! It's so exciting to suddenly discover that you have

Re: subprocess check_output

2016-01-05 Thread Chris Angelico
On Tue, Jan 5, 2016 at 10:15 PM, me wrote: > On 2016-01-02, Chris Angelico wrote: >> down to "whoops, I forgot to save the file" or "whoops, I was in the >> wrong directory"... > > Amen, bro. > > Exceptionally true if you ever need for some reason to put your code in > another directory, but you

Re: subprocess check_output

2016-01-05 Thread me
On 2016-01-02, Chris Angelico wrote: > down to "whoops, I forgot to save the file" or "whoops, I was in the > wrong directory"... Amen, bro. Exceptionally true if you ever need for some reason to put your code in another directory, but you forget to close the files in your editor. :D -- https:/

Re: subprocess check_output

2016-01-02 Thread Chris Angelico
On Sun, Jan 3, 2016 at 7:39 AM, Carlos Barera wrote: > Turns out it wasn't running against the server I thought it was. > Apologies for the spam. Heh. No problem. That's part of why I suggested running it from the shell. There are two possibilities: either it also fails from the shell (in which c

Re: subprocess check_output

2016-01-02 Thread Carlos Barera
Turns out it wasn't running against the server I thought it was. Apologies for the spam. -carlos On Wed, Dec 30, 2015 at 11:02 PM Cameron Simpson wrote: > On 30Dec2015 21:14, Carlos Barera wrote: > >Trying to run a specific command (ibstat) installed in /usr/sbin on an > >Ubuntu 15.04 machine

Re: subprocess check_output

2015-12-30 Thread Chris Angelico
On Thu, Dec 31, 2015 at 8:02 AM, Cameron Simpson wrote: > On 30Dec2015 21:14, Carlos Barera wrote: >> >> Trying to run a specific command (ibstat) installed in /usr/sbin on an >> Ubuntu 15.04 machine, using subprocess.check_output and getting "/bin/sh: >> /usr/sbin/ibstat: No such file or direct

Re: subprocess check_output

2015-12-30 Thread Cameron Simpson
On 30Dec2015 21:14, Carlos Barera wrote: Trying to run a specific command (ibstat) installed in /usr/sbin on an Ubuntu 15.04 machine, using subprocess.check_output and getting "/bin/sh: /usr/sbin/ibstat: No such file or directory" I tried the following: - running the command providing full pat

Re: subprocess and stdin.write(), stdout.read()

2015-03-24 Thread Nobody
On Tue, 24 Mar 2015 12:08:24 -0700, Tobiah wrote: > But if I want to send a string to stdin, how can I do that without > stdin.write()? p.communicate(string) > This seems to work: Only because the amounts of data involved are small enough to avoid deadlock. If both sides write more dat

Re: subprocess and stdin.write(), stdout.read()

2015-03-24 Thread Chris Kaynor
On Tue, Mar 24, 2015 at 12:08 PM, Tobiah wrote: > The docs for the subprocess.Popen() say: > > Use communicate() rather than .stdin.write, .stdout.read > or .stderr.read to avoid deadlocks due to any of the other > OS pipe buffers filling up and blocking the child process >

Re: subprocess command fails

2015-02-21 Thread Larry Hudson
On 02/20/2015 08:47 PM, Brad s wrote: [...] print("command = %r" % (cmdargv,)) sfmove = subprocess.call(cmdargv) also, is the % to Python what precision is to C++? No. It is like the % in C's printf(). -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: subprocess command fails

2015-02-20 Thread Cameron Simpson
On 20Feb2015 21:14, Brad s wrote: Time adjustment error: # python3.4 timefix.py 2015022105 2015-02-21 05:00:00 Traceback (most recent call last): File "timefix.py", line 15, in ndate = datetime.datetime.strptime(timeadd, '%Y%m%d%H') TypeError: must be str, not datetime.datetime # cat ti

Re: subprocess command fails

2015-02-20 Thread Brad s
fixed with now = datetime.datetime.now() later = now + datetime.timedelta(days=2*365) striplater = later.strftime('%Y%m%d%H') # python3.4 makekeys.py Enter the domain to configure keys for? test1234.com Generating key pair..

Re: subprocess command fails

2015-02-20 Thread Brad s
Time adjustment error: # python3.4 timefix.py 2015022105 2015-02-21 05:00:00 Traceback (most recent call last): File "timefix.py", line 15, in ndate = datetime.datetime.strptime(timeadd, '%Y%m%d%H') TypeError: must be str, not datetime.datetime # cat timefix.py #!/usr/bin/python3.4 impor

Re: subprocess command fails

2015-02-20 Thread Brad s
Yes, the program deletes the same files it produces. It looks to see if old stuff is there and if it exist, it deletes the files and creates and entirely new DNS zone with keys and then it is supposed to sign it. The last step is where it is still failing but your code helped me to figure out wh

Re: subprocess command fails

2015-02-20 Thread Cameron Simpson
On 20Feb2015 15:30, Brad s wrote: I am trying to execute a subprocess, something done in my script a couple of times. But on the last one, it outputs an error I cannot find the solution to. The exact same command using the same files produced at the command line works just fine. Hi Brad,

Re: subprocess module usage

2014-09-01 Thread Akira Li
Earl Lapus writes: > Hi, > > I made simple test program using the subprocess module (see attached: > exec_cmd.py). I ran it passing variations of 'ls' command options. > > I encounter exceptions every time I use '-l' options. Example runs > where exception occurs: > # ./exec_cmd.py ls -al > # ./e

Re: subprocess module usage

2014-09-01 Thread Chris Angelico
On Mon, Sep 1, 2014 at 6:46 PM, Cameron Simpson wrote: > Not really. If the arguments are coming in from the command line, someone (a > user, even if that user is the programmer) typed them. Even if not > malicious, they can still be mistaken. Or just unfortunate. I'm guessing that what he means

Re: subprocess module usage

2014-09-01 Thread Cameron Simpson
On 01Sep2014 14:33, Earl Lapus wrote: On Mon, Sep 1, 2014 at 1:39 PM, Chris Angelico wrote: Glad it's working! But please, don't just take my word for it and make a black-box change to your code. When you invoke subprocesses, be sure you understand what's going on, and when shell=True is appro

Re: subprocess module usage

2014-08-31 Thread Earl Lapus
On Mon, Sep 1, 2014 at 1:39 PM, Chris Angelico wrote: > > Glad it's working! But please, don't just take my word for it and make > a black-box change to your code. When you invoke subprocesses, be sure > you understand what's going on, and when shell=True is appropriate and > when shell=False is a

Re: subprocess module usage

2014-08-31 Thread Earl Lapus
On Mon, Sep 1, 2014 at 11:55 AM, Chris Angelico wrote: > > But secondly, you're already splitting the argument (or rather, taking > it from your own parameters, already split), so you don't want to go > through the shell. In fact, going through the shell would only make > your life harder. Change

  1   2   3   4   5   6   >