ed to the subprocess module.
Where are they?
Here:
https://docs.python.org/3/library/subprocess.html#subprocess.getstatusoutput
--
https://mail.python.org/mailman/listinfo/python-list
utput() have been moved to the subprocess
> module.
>
> Where are they?
Doh, never mind. They were only moved in Python3. I didn't realize
that the "In Python 3.x" qualifier from the beginning of the previous
sentence applied to the entire paragraph.
--
Grant Edwards
I'm trying to update a python2 app to make it python3 compatible. It
uses commands.getstatusoutput(), which according to
https://docs.python.org/2/library/commands.html#commands.getstatusoutput
... getstatusoutput() and getoutput() have been moved to the subprocess module.
Where are
On Mon, Nov 12, 2018 at 11:20 PM Anssi Saari wrote:
>
> Chris Angelico writes:
>
> > On Fri, Nov 9, 2018 at 11:11 PM Anssi Saari wrote:
> >>
> >> Chris Angelico writes:
> >>
> >> > No helper needed. Safe against command injection. Uses the known
> >> > format of the command's output; if you wan
Chris Angelico writes:
> On Fri, Nov 9, 2018 at 11:11 PM Anssi Saari wrote:
>>
>> Chris Angelico writes:
>>
>> > No helper needed. Safe against command injection. Uses the known
>> > format of the command's output; if you want other information as well
>> > as the type, you could get that too.
srinivasan wrote:
> Even after changing as per the below
> "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3"
> or:
> 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3'
> or:
> "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3"
>
> Still my output is:
> */dev/mmcblk1p1: LABEL="efi" UUID="1084
On Fri, Nov 9, 2018 at 11:11 PM Anssi Saari wrote:
>
> Chris Angelico writes:
>
> > No helper needed. Safe against command injection. Uses the known
> > format of the command's output; if you want other information as well
> > as the type, you could get that too.
>
> Can someone let me in on this
Chris Angelico writes:
> No helper needed. Safe against command injection. Uses the known
> format of the command's output; if you want other information as well
> as the type, you could get that too.
Can someone let me in on this secret helper module? Doesn't seem to
match the helper module in
Many Thanks a lot , I can use for reliably "lsblk %s -n -o FSTYPE" in the
reused code of mine as below
cmd = "lsblk %s -n -o FSTYPE" % partition_path
return self._helper.execute_cmd_output_string(cmd)
I really appreciate for all your support w.r.t this..
I feel I have kick start
srinivasan writes:
> Even after changing as per the below
> "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3"
> or:
> 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3'
> or:
> "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3"
>
> Still my output is:
> */dev/mmcblk1p1: LABEL="efi" UUID="108
On Wed, Nov 7, 2018 at 11:42 PM srinivasan wrote:
>
> Some I managed to fix temporarily as below, might be useful for others. Also
> please correct me if anything wrong or for any improvements in the below
>
> cmd = "blkid -o export %s" % partition_path
> out = self._helper.execut
Some I managed to fix temporarily as below, might be useful for others.
Also please correct me if anything wrong or for any improvements in the
below
cmd = "blkid -o export %s" % partition_path
out = self._helper.execute_cmd_output_string(cmd)
var = out.split("TYPE=", 1)[1]
On Wed, Nov 7, 2018 at 11:36 PM Qian Cai wrote:
>
> srinivasan wrote:
> > Even after changing as per the below
> > "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3"
> > or:
> > 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3'
> > or:
> > "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3"
>
srinivasan wrote:
> Even after changing as per the below
> "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3"
> or:
> 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3'
> or:
> "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3"
>
> Still my output is:
> */dev/mmcblk1p1: LABEL="efi" UUID="1084
Even after changing as per the below
"blkid -o export %s | grep 'TYPE' | cut -d'=' -f3"
or:
'blkid -o export %s | grep "TYPE" | cut -d"=" -f3'
or:
"blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3"
Still my output is:
*/dev/mmcblk1p1: LABEL="efi" UUID="1084-AA42" TYPE="vfat"*
My expected outp
On Wed, 2018-11-07 at 10:22 +0100, srinivasan wrote:
> blkid -o export %s | grep \'TYPE\' | cut -d\"=\" -f3
You don't need to escape the single quotes.
Try either:
"blkid -o export %s | grep 'TYPE' | cut -d'=' -f3"
or:
'blkid -o export %s | grep "TYPE" | cut -d"=" -f3'
or:
"blkid -o export %s | g
x27;TYPE' | cut -d"
> and BETA=" -f3"
>
> Other issues may also be there.
> -Original Message-
> From: Tutor On Behalf Of
> Alan Gauld via Tutor
> Sent: Tuesday, November 6, 2018 7:37 PM
> To: tu...@python.org
> Cc: python-...@python.org
> Subje
On 06/11/2018 18:10, srinivasan wrote:
root:~/qa/test_library# python3 sd.py
File "sd.py", line 99
*cmd = "blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)*
* ^*
*SyntaxError: can't assign to literal*
Look at the 'cut' element of the pipeline. You have used double quotes
Dear Python Experts Team,
As am newbie to python development, I am trying to use the below function
to get verify the filesystem type of the SD card parition using bash
command in python using subprocess module, I ma seeing the below Error
"SyntaxError: can't assign to liter
Gary,
Thank you for the response. I made a small typo in my original post,
which you correctly picked up. My original generator actually did not
have the stdout parameter (see below). Only the new generator has this
parameter, as it's now being passed into the generator from the caller's
e
alled on
the returned generator. I verified this behavior with print
statements inside my code, as well as, inside the subprocess module.
My work around was to simply move the call to subprocess.check_output
outside of the generator function (see below) to its caller (a
non-generator function). With
e to send its output to stdout. However, if the command line
directed sqlcmd.exe to send its output to a file,
subprocess.check_output would never be called when next was called on
the returned generator. I verified this behavior with print statements
inside my code, as well as, inside th
Praveen Kumar writes:
> Previously this basic server is executed using *openvt* but I thought
> it would be nice to have a daemon process for it and used
> python-daemon.
An important difference is that a daemon process has no controlling
terminal, by definition.
> Issue I am facing is after so
On Mon, Oct 20, 2014 at 2:16 AM, Praveen Kumar
wrote:
> I am writing a very basic server side application[0] which get data
> from a client and create a virtual machine using provided data and
> also tells client about what's going on during *virt-install* command
> execution. Previously this basi
Hi,
I am writing a very basic server side application[0] which get data
from a client and create a virtual machine using provided data and
also tells client about what's going on during *virt-install* command
execution. Previously this basic server is executed using *openvt* but
I thought it would
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 e
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
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
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
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
On Mon, Sep 1, 2014 at 3:24 PM, Earl Lapus wrote:
> 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 thro
On Mon, Sep 1, 2014 at 1:28 PM, Earl Lapus wrote:
> So, what could be causing this behavior? Is this expected or is there
> something wrong with how I'm using the subprocess module?
The latter. Your problem is with your shell= option.
Firstly, the parameter should be either shell=Tr
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
# ./exec_cmd.py ls -l
iMath wrote:
>we don't have permission to use the temporary file while it has not
>been closed,but when the file is closed , it will be destroyed by
>default(delete=True),but once we set delete=False,then we couldn't
>depend on the convenience of letting the temporary file automatically
>delete it
在 2013年12月6日星期五UTC+8下午10时59分43秒,Chris Angelico写道:
> On Sat, Dec 7, 2013 at 1:54 AM, iMath wrote:
>
> > fp=tempfile.NamedTemporaryFile(delete=False)
>
> > fp.write(("file '"+fileName1+"'\n").encode('utf-8'))
>
> > fp.write(("file '"+fileName2+"'\n").encode('utf-8'))
>
> >
>
> >
>
rusi wrote:
On Friday, December 6, 2013 10:11:04 PM UTC+5:30, MRAB wrote:
You're exaggerating. It's more like 500 years ago. :-)
I was going to say the same until I noticed the "the way people think English
was spoken..."
That makes it unarguable -- surely there are some people who (wrongly)
On Friday, December 6, 2013 10:11:04 PM UTC+5:30, MRAB wrote:
> On 06/12/2013 15:34, Steven D'Aprano wrote:
> > On Fri, 06 Dec 2013 06:52:48 -0800, iMath wrote:
> >> yes ,I am a native Chinese speaker.I always post question by Google
> >> Group not through email ,is there something wrong with it ?
On Friday, December 6, 2013 9:55:54 PM UTC+5:30, Mark Lawrence wrote:
> On 06/12/2013 16:19, rusi wrote:
> > So someone please update that page!
> This is a community so why don't you?
Ok done (at least a first draft)
I was under the impression that anyone could not edit
--
https://mail.python.
On 06/12/2013 15:34, Steven D'Aprano wrote:
On Fri, 06 Dec 2013 06:52:48 -0800, iMath wrote:
yes ,I am a native Chinese speaker.I always post question by Google
Group not through email ,is there something wrong with it ? your
english is a little strange to me .
Mark is writing in fake old-En
On 06/12/2013 16:19, rusi wrote:
On Friday, December 6, 2013 9:23:47 PM UTC+5:30, Mark Lawrence wrote:
On 06/12/2013 15:34, Steven D'Aprano wrote:
(if I remember correctly) I think Mark also
sometimes posts a link to managing Google Groups.
You do, and here it is https://wiki.python.org
On Friday, December 6, 2013 9:23:47 PM UTC+5:30, Mark Lawrence wrote:
> On 06/12/2013 15:34, Steven D'Aprano wrote:
>
> (if I remember correctly) I think Mark also
>
> > sometimes posts a link to managing Google Groups.
>
> >
>
> You do, and here it is https://wiki.python.org/moin/GoogleGroupsP
On 06/12/2013 15:34, Steven D'Aprano wrote:
(if I remember correctly) I think Mark also
sometimes posts a link to managing Google Groups.
You do, and here it is https://wiki.python.org/moin/GoogleGroupsPython
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you ca
On Fri, 06 Dec 2013 06:52:48 -0800, iMath wrote:
> yes ,I am a native Chinese speaker.I always post question by Google
> Group not through email ,is there something wrong with it ? your
> english is a little strange to me .
Mark is writing in fake old-English style, the way people think English
On Friday, December 6, 2013 8:42:02 PM UTC+5:30, Mark Lawrence wrote:
> The English I used was archaic, please ignore it :)
"Archaic" is almost archaic
"Old" is ever-young
:D
--
https://mail.python.org/mailman/listinfo/python-list
On Friday, December 6, 2013 8:22:48 PM UTC+5:30, iMath wrote:
> 在 2013年12月6日星期五UTC+8下午5时23分59秒,Mark Lawrence写道:
> > On 06/12/2013 06:23, iMath wrote:
> > Dearest iMath, wouldst thou be kind enough to partake of obtaining some
> > type of email client that dost not sendeth double spaced data into t
On 06/12/2013 14:52, iMath wrote:
在 2013年12月6日星期五UTC+8下午5时23分59秒,Mark Lawrence写道:
On 06/12/2013 06:23, iMath wrote:
Dearest iMath, wouldst thou be kind enough to partake of obtaining some
type of email client that dost not sendeth double spaced data into this
most illustrious of mailing lis
On Sat, Dec 7, 2013 at 1:54 AM, iMath wrote:
> fp=tempfile.NamedTemporaryFile(delete=False)
> fp.write(("file '"+fileName1+"'\n").encode('utf-8'))
> fp.write(("file '"+fileName2+"'\n").encode('utf-8'))
>
>
> subprocess.call(['ffmpeg', '-f', 'concat','-i',fp.name, '-c', 'copy',
>
在 2013年12月4日星期三UTC+8下午6时51分49秒,Chris Angelico写道:
> On Wed, Dec 4, 2013 at 8:38 PM, Andreas Perstinger
> wrote:
>
> > "fp" is a file object, but subprocess expects a list of strings as
>
> > its first argument.
>
>
>
> More fundamentally: The subprocess's arguments must include the *name*
>
在 2013年12月6日星期五UTC+8下午5时23分59秒,Mark Lawrence写道:
> On 06/12/2013 06:23, iMath wrote:
>
>
>
> Dearest iMath, wouldst thou be kind enough to partake of obtaining some
>
> type of email client that dost not sendeth double spaced data into this
>
> most illustrious of mailing lists/newsgroups. T
On 12/6/13 4:23 AM, Mark Lawrence wrote:
On 06/12/2013 06:23, iMath wrote:
Dearest iMath, wouldst thou be kind enough to partake of obtaining some
type of email client that dost not sendeth double spaced data into this
most illustrious of mailing lists/newsgroups. Thanking thee for thine
partic
On 06/12/2013 06:23, iMath wrote:
Dearest iMath, wouldst thou be kind enough to partake of obtaining some
type of email client that dost not sendeth double spaced data into this
most illustrious of mailing lists/newsgroups. Thanking thee for thine
participation in my most humble of requests.
在 2013年12月4日星期三UTC+8下午5时38分27秒,Andreas Perstinger写道:
> iMath wrote:
>
> >I use the following code to do the test ,but error occurred ,it
>
> >prompts system cannot find specified files ,but the files are indeed
>
> >exists there ,any help ?
>
> >
>
> >with tempfile.TemporaryFile() as fp:
>
>
On Wed, Dec 4, 2013 at 8:38 PM, Andreas Perstinger wrote:
> "fp" is a file object, but subprocess expects a list of strings as
> its first argument.
More fundamentally: The subprocess's arguments must include the *name*
of the file. This means you can't use TemporaryFile at all, as it's
not guara
iMath wrote:
>I use the following code to do the test ,but error occurred ,it
>prompts system cannot find specified files ,but the files are indeed
>exists there ,any help ?
>
>with tempfile.TemporaryFile() as fp:
>fp.write(("file '"+'a1.mp3'+"'\n").encode('utf-8'))
>fp.write(("file '"+'a2
在 2013年12月3日星期二UTC+8上午9时42分11秒,rusi写道:
> On Tuesday, December 3, 2013 6:45:42 AM UTC+5:30, iMath wrote:
>
> > so is there any way to create a temporary file by Python here ?
>
>
>
> http://docs.python.org/2/library/tempfile.html
I use the following code to do the test ,but error occurred ,it pr
在 2013年12月3日星期二UTC+8上午9时42分11秒,rusi写道:
> On Tuesday, December 3, 2013 6:45:42 AM UTC+5:30, iMath wrote:
>
> > so is there any way to create a temporary file by Python here ?
>
>
>
> http://docs.python.org/2/library/tempfile.html
I use the following code to do the test ,but error occurred ,it pr
在 2013年12月3日星期二UTC+8下午5时33分09秒,Alain Ketterlin写道:
> Ben Finney writes:
>
>
>
> > Chris Angelico writes:
>
> >
>
> >> On Mon, Dec 2, 2013 at 10:34 PM, iMath wrote:
>
> >> > ffmpeg -f concat -i <(for f in ./*.wav; do echo "file '$f'"; done) -c
> >> > copy output.wav
>
> >> > ffmpeg -f conc
Ben Finney writes:
> Chris Angelico writes:
>
>> On Mon, Dec 2, 2013 at 10:34 PM, iMath wrote:
>> > ffmpeg -f concat -i <(for f in ./*.wav; do echo "file '$f'"; done) -c copy
>> > output.wav
>> > ffmpeg -f concat -i <(printf "file '%s'\n" ./*.wav) -c copy output.wav
>> > ffmpeg -f concat -i <(
On Tuesday, December 3, 2013 6:45:42 AM UTC+5:30, iMath wrote:
> so is there any way to create a temporary file by Python here ?
http://docs.python.org/2/library/tempfile.html
--
https://mail.python.org/mailman/listinfo/python-list
在 2013年12月3日星期二UTC+8上午5时19分21秒,Ben Finney写道:
> Chris Angelico writes:
>
>
>
> > On Mon, Dec 2, 2013 at 10:34 PM, iMath wrote:
>
> > > ffmpeg -f concat -i <(for f in ./*.wav; do echo "file '$f'"; done) -c
> > > copy output.wav
>
> > > ffmpeg -f concat -i <(printf "file '%s'\n" ./*.wav) -c co
On Tue, Dec 3, 2013 at 8:19 AM, Ben Finney wrote:
> Chris Angelico writes:
>
>> On Mon, Dec 2, 2013 at 10:34 PM, iMath wrote:
>> > ffmpeg -f concat -i <(for f in ./*.wav; do echo "file '$f'"; done) -c copy
>> > output.wav
>> > ffmpeg -f concat -i <(printf "file '%s'\n" ./*.wav) -c copy output.w
Chris Angelico writes:
> On Mon, Dec 2, 2013 at 10:34 PM, iMath wrote:
> > ffmpeg -f concat -i <(for f in ./*.wav; do echo "file '$f'"; done) -c copy
> > output.wav
> > ffmpeg -f concat -i <(printf "file '%s'\n" ./*.wav) -c copy output.wav
> > ffmpeg -f concat -i <(find . -name '*.wav' -printf
On Mon, Dec 2, 2013 at 10:34 PM, iMath wrote:
> I have few wav files that I can use either of the following command line
> mentioned here
> https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files
> to concatenate
>
>
> ffmpeg -f concat -i <(for f in ./*.wav; do
y
output.wav
ffmpeg -f concat -i <(printf "file '%s'\n" ./*.wav) -c copy output.wav
ffmpeg -f concat -i <(find . -name '*.wav' -printf "file '%p'\n") -c copy
output.wav
anyone know how to convert either of them to work with python's subproc
On 11/29/2012 10:39 AM, Nobody wrote:
Every time I see your posts "Shanghai Noodle Factory" sticks in my head
as my daily hummer. :)
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 29 Nov 2012 10:09:44 +0100, Thomas Rachel wrote:
> The variant with shell=True is more os.popen()-like, but has security
> flaws (e.g., what happens if there are spaces or, even worse, ";"s in the
> command string?
I think that you're conflating the shell= option with whether the command
Am 27.11.2012 19:00 schrieb Andrew:
I'm looking into os.popen and the subprocess module, implementing
os.popen is easy but i hear it is depreciating however I'm finding the
implemantation of subprocess daunting can anyone help
This is only the first impression.
subprocess is
Andrew wrote:
>
>I'm working on a script that will run an executable obtaine the output
> from the executable
>and do some analysis on the output. Essentially the script runs the
>executable analyses
>the data.
>I'm looking into os.popen and the subprocess modu
On 27/11/2012 18:00, Andrew wrote:
Hello world,
I'm working on a script that will run an executable obtaine the output
from the executable
and do some analysis on the output. Essentially the script runs the
executable analyses
the data.
I'm looking into os.popen and the subproc
Andrew wrote:
>
> Hello world,
>
> I'm working on a script that will run an executable obtaine the output
> from the executable
> and do some analysis on the output. Essentially the script runs the
> executable analyses
> the data.
> I'm looking in
Hello world,
I'm working on a script that will run an executable obtaine the output
from the executable
and do some analysis on the output. Essentially the script runs the
executable analyses
the data.
I'm looking into os.popen and the subprocess module, implementing os.popen
i
On Mon, 23 Jul 2012 06:01:23 -0700, Sarbjit singh wrote:
> proc = subprocess.Popen("cp -i a.txt b.txt", shell=True,
> stdin=subprocess.PIPE, stdout=subprocess.PIPE,
> stderr=subprocess.STDOUT,)
> stdout_val, stderr_val = proc.communicate()
> print stdout_val b.txt?
>
> proc.communicate("y")
>
Sarbjit singh wrote:
> I am writing a script in which in the external system command may
> sometimes require user input. I am not able to handle that properly. I
> have tried using os.popen4 and subprocess module but could not achieve the
> desired behavior.
>
> Below menti
I am writing a script in which in the external system command may sometimes
require user input. I am not able to handle that properly. I have tried using
os.popen4 and subprocess module but could not achieve the desired behavior.
Below mentioned example would show this problem using &qu
Check PY2EXE, PYREX and PSYChO. I must use these packages
to relase commercial products with my own dll in c.
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 17, 1:49 pm, Jean-Michel Pichavant
wrote:
> I can't use it though, I'm still using a vintage 2.5 version :-/
That's a shame. I chose 2.6 as a baseline for this package, because I
need it to work on Python 2.x and 3.x with the same code base and
minimal work, and that meant supporting Unic
Vinay Sajip wrote:
Sarge, a cross-platform library which wraps the subprocess module in
the standard library, has been released.
What does it do?
Sarge tries to make interfacing with external programs from your
Python applications easier than just using subprocess alone
On Feb 13, 7:08 am, Anh Hai Trinh wrote:
> > Objection! Does the defense REALLY expect this court to believe that
> > he can testify as to how MOST members of the Python community would or
> > would not favor bash over Python? And IF they do in fact prefer bash,
> > is this display of haughty arro
On Feb 13, 3:57 am, Anh Hai Trinh wrote:
>
> I don't disagree with it. But the solution is really easy, just call 'sh' and
> pass it a string!
>
> >>> from extproc import sh
> >>> n = int(sh(“ls /etc –1 | wc –l”))
>
> No parser needed written!
>
> Yes there is a danger of argument parsing and gl
> Objection! Does the defense REALLY expect this court to believe that
> he can testify as to how MOST members of the Python community would or
> would not favor bash over Python? And IF they do in fact prefer bash,
> is this display of haughty arrogance nothing more than a hastily
> stuffed straw-
On Feb 12, 2:13 pm, Vinay Sajip wrote:
> wc(ls("/etc", "-1"), "-l")
>
> is not as readable as
>
> call(“ls /etc –1 | wc –l”)
And i agree!
I remember a case where i was forced to use an idiotic API for
creating inputbox dialogs. Something like this:
prompts = ['Height', 'Width', 'Color']
values
On Feb 12, 9:35 am, Anh Hai Trinh wrote:
> > It's not hard for the user
>
> I think most users like to use Python, or they'd use Bash. I think people
> prefer not another language that is different from both, and having little
> benefits. My own opinion of course.
Objection! Does the defense RE
On Monday, February 13, 2012 3:13:17 AM UTC+7, Vinay Sajip wrote:
> On Feb 12, 3:35 pm, Anh Hai Trinh wrote:
>
> > I think most users like to use Python, or they'd use Bash. I think people
> > prefer not another language that is different from both, and having little
> > benefits. My own opinio
On Feb 12, 4:19 pm, Anh Hai Trinh wrote:
> If you use threads and call fork(), you'll almost guaranteed to face with
> deadlocks. Perhaps not in a particular piece of code, but some others.
> Perhaps not on your laptop, but on the production machine with different
> kernels. Like most race con
s case. Even though it goes on to
mention the dangers inherent in inherited file handles, it also
mentions that these problems have been overcome in recent Linux
kernels, and the subprocess module does contain code to handle at
least some of these conditions (e.g. preexec_fn, close_fds keyword
argum
> For a careful impl of fork-exec with threads, see
> http://golang.org/src/pkg/syscall/exec_unix.go
I forgot to mention that this impl is indeed "correct" only because you cannot
start thread or call fork() directly in the Go language, other than use
goroutines and the ForkExec() function impl
> It's not hard for the user
I think most users like to use Python, or they'd use Bash. I think people
prefer not another language that is different from both, and having little
benefits. My own opinion of course.
Re. threads & fork():
http://www.linuxprogrammingblog.com/threads-and-fork-think
On Feb 12, 9:41 am, Anh Hai Trinh wrote:
> Having written something with similar purpose
> (https://github.com/aht/extproc), here are my comments:
>
> * Having command parsed from a string is complicated. Why not just have an
> OOP API to construct commands?
It's not hard for the user, and less
Having written something with similar purpose (https://github.com/aht/extproc),
here are my comments:
* Having command parsed from a string is complicated. Why not just have an OOP
API to construct commands? extproc does this, but you opted to write a
recursive descent parser. I'm sure it's fun
On Fri, Feb 10, 2012 at 2:28 PM, Vinay Sajip wrote:
> Sarge, a cross-platform library which wraps the subprocess module in
> the standard library, has been released.
>
> What does it do?
>
>
> Sarge tries to make interfacing with external programs from your
Sarge, a cross-platform library which wraps the subprocess module in
the standard library, has been released.
What does it do?
Sarge tries to make interfacing with external programs from your
Python applications easier than just using subprocess alone.
Sarge offers the
On Fri, 20 Jan 2012 08:42:16 -0600, skip wrote:
> The library documentation doesn't talk a lot about long-lived subprocesses
> other than the possibility of deadlock when using Popen.wait(). Ideally, I
> would write to the subprocess's stdin, check for output on stdout and
> stderr, then lather,
(Apologies for the non-threaded reply. My subscription to the list is
currently set to no-mail and I can't get to gmane.org, so have no clean way
to reply...)
Mike Fletcher wrote:
> Definitely *will* block, you have to explicitly set them non-blocking to
> have non-blocking behaviour:
...
>
On 12-01-20 09:42 AM, s...@pobox.com wrote:
> I'm converting some os.popen calls to use subprocess.Popen. I had
> previously been ignoring stdout and stderr when using os.popen. The primary
> motivation to switch to subprocess.Popen now is that I now want to check
> stderr, so would have to make
I'm converting some os.popen calls to use subprocess.Popen. I had
previously been ignoring stdout and stderr when using os.popen. The primary
motivation to switch to subprocess.Popen now is that I now want to check
stderr, so would have to make code changes to use os.popen[34] anyway.
Might as w
[cc-ing back to the list; please keep the conversation over there...]
On 23/05/2011 13:11, vijay swaminathan wrote:
What I want to achieve is, I want to run a batch file on a command prompt.
The reason for using thread is not for running multiple scripts
simultaneously. It is just to monitor my
On 21/05/2011 16:56, vijay swaminathan wrote:
I'm having some problem in using the communicate() along with the
subprocess.I would like to invoke a command prompt and pass on a .bat
file to execute. I went through the subprocess module and understood
that using communicate, we can send the
On Sat, May 21, 2011 at 8:56 AM, vijay swaminathan wrote:
> Hi Gurus,
>
> I'm having some problem in using the communicate() along with the
> subprocess.I would like to invoke a command prompt and pass on a .bat file
> to execute. I went through the subprocess module and u
Hi Gurus,
I'm having some problem in using the communicate() along with the
subprocess.I would like to invoke a command prompt and pass on a .bat file
to execute. I went through the subprocess module and understood that using
communicate, we can send the send data to stdin.
According t
close_fds=False,
> universal_newlines=True,
> startupinfo=startupinfo
> )
>
> This worked okay in using the subprocess module under python 2.6, but under
> python 2.7 I get the error:
&
1 - 100 of 248 matches
Mail list logo