On Wed, Sep 4, 2013 at 7:11 AM, Oscar Benjamin
wrote:
> On 4 September 2013 11:42, eryksun wrote:
si = subprocess.STARTUPINFO()
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
si.wShowWindow = subprocess.SW_HIDE
>>>
>>> Do these statements modify module-level state? Or do
On 4 September 2013 11:42, eryksun wrote:
>>> si = subprocess.STARTUPINFO()
>>> si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
>>> si.wShowWindow = subprocess.SW_HIDE
>>
>> Do these statements modify module-level state? Or do you need to pass
>> startupinfo=si when calling Popen?
>
> It
On Wed, Sep 4, 2013 at 6:22 AM, Oscar Benjamin
wrote:
> On 4 September 2013 11:11, eryksun wrote:
>
>> Using shell=True also sets startupinfo to hide the window. If that's
>> the only reason you're using the shell, you may as well cut out the
>> middleman (and potential security hole). Set startu
On 4 September 2013 11:11, eryksun wrote:
> On Wed, Sep 4, 2013 at 5:14 AM, learner404 wrote:
>>
>> Yes, this worked :)
>>
>> subprocess.Popen(["ffmpeg","-f","dshow","-i","video="+videoinputName,"-f",
>> "dshow","-i","audio="+audioinputName,"-q","5","%s"%videoFileOutput],
>> shell=True)
You shou
On Wed, Sep 4, 2013 at 5:14 AM, learner404 wrote:
>
> Yes, this worked :)
>
> subprocess.Popen(["ffmpeg","-f","dshow","-i","video="+videoinputName,"-f",
> "dshow","-i","audio="+audioinputName,"-q","5","%s"%videoFileOutput],
> shell=True)
Using shell=True also sets startupinfo to hide the window.
Thanks a lot Oscar and Eryksun for all the explanations and answers, I
really appreciate.
"So the extra quotes used for the video and audio arguments do actually
get passed through to ffmpeg causing confusion."
Yes, this worked :)
subprocess.Popen(["ffmpeg","-f","dshow","-i","video="+videoinputNa
On 3 September 2013 14:48, eryksun wrote:
>> It occurs to me that another possibility is if ffmpeg isn't really an
>> .exe on PATH but rather a .bat file or something. In that case
>> os.system or subprocess shell=True would pick it up but subprocess
>> shell=False might not. I say "might" because
On Tue, Sep 3, 2013 at 5:54 AM, Oscar Benjamin
wrote:
> On 3 September 2013 05:49, eryksun wrote:
>
> I've previously tried to find documentation that explains how MSVCRT
> handles this. I didn't find anything as explicit as the explanation in
> the subprocess docs. For example:
> http://msdn.mic
On 3 September 2013 05:49, eryksun wrote:
> On Mon, Sep 2, 2013 at 10:19 AM, learner404 wrote:
>>
>> I can't understand why the command below works with os.system but not with
>> subprocess.Popen (on windows, recording video with FFMPEG.exe)
>>
>> cmd=('ffmpeg -f dshow -i video="%s" -f dshow -i a
On Mon, Sep 2, 2013 at 10:19 AM, learner404 wrote:
>
> I can't understand why the command below works with os.system but not with
> subprocess.Popen (on windows, recording video with FFMPEG.exe)
>
> cmd=('ffmpeg -f dshow -i video="%s" -f dshow -i audio="%s" -q 5 "%s"')%
> (videoinputName, audioinp
On 2 September 2013 15:19, learner404 wrote:
> Hello,
>
> I can't understand why the command below works with os.system but not with
> subprocess.Popen (on windows, recording video with FFMPEG.exe)
>
> cmd=('ffmpeg -f dshow -i video="%s" -f dshow -i audio="%s" -q 5
> "%s"')%(videoinputName, audioi
Hello,
I can't understand why the command below works with os.system but not with
subprocess.Popen (on windows, recording video with FFMPEG.exe)
cmd=('ffmpeg -f dshow -i video="%s" -f dshow -i audio="%s" -q 5
"%s"')%(videoinputName, audioinputName, videoFileOutput)
os.system(cmd)
*works*
subpro
On 2013-08-28 08:16, wolfrage8...@gmail.com wrote:
> PHP is not Python.
You misread.
> > I have a python program which i am calling from a php script.
pgpqqKjmHTR5l.pgp
Description: PGP signature
___
Tutor maillist - Tutor@python.org
To unsubscribe
On Tue, Aug 27, 2013 at 6:33 AM, Nitish Kunder wrote:
> Hii
> I have a python program which i am calling from a php script.
> The arguments to the program is a path to the file
> The program when directly run from console executes normally.
> But when I try to execute the program from browser ie c
Hi,
in any case and apart from what was already said, your setup sounds very
awkward, if not insane.
Are you sure your implementation is a good idea?
-nik
Nitish Kunder schrieb:
>Hii
>I have a python program which i am calling from a php script.
>The arguments to the program is a path to th
Hello,
On 2013-08-27 16:03, Nitish Kunder wrote:
> I have a python program which i am calling from a php script.
> The arguments to the program is a path to the file
> The program when directly run from console executes normally.
> But when I try to execute the program from browser ie call the pyt
On 27/08/13 11:33, Nitish Kunder wrote:
I have a python program which i am calling from a php script.
How are you executing the PHP script?
Which OS? Which web server? Which browser?
Have you tried others?
The arguments to the program is a path to the file
The program when directly run from c
Hii
I have a python program which i am calling from a php script.
The arguments to the program is a path to the file
The program when directly run from console executes normally.
But when I try to execute the program from browser ie call the python
script from php,
os.system command is not working
cevyn e writes:
> I get the example os.system('ls -al') no problem.
>
> i'm trying to create a variable with my command built but needs to include
> quotes.
> Portion of code is as follows:
> someip = '192.168.01.01'
>
> var1 = 'lynx -dump http://' + someip +
> '/cgi-bin/.log&.submit=+++G
I get the example os.system('ls -al') no problem.
i'm trying to create a variable with my command built but needs to include
quotes.
Portion of code is as follows:
someip = '192.168.01.01'
var1 = 'lynx -dump http://' + someip +
'/cgi-bin/.log&.submit=+++Go%21+++ > junk'
print var1
os.
jtl999 wrote:
I want to pass a variable to os.system which is dir
dir=raw_input ("Dir Please ")
Dir Please /
ok dir = /
os.system ("ls" + dir)
sh: ls/: No such file or directory
32512
any advice
Yes -- learn to read the error messages you get. The error you get is a
shell error, not a P
On Fri, Dec 17, 2010 at 4:17 PM, Emile van Sebille wrote:
> On 12/17/2010 4:07 PM jtl999 said...
>>
>> I want to pass a variable to os.system which is dir
> dir=raw_input ("Dir Please ")
> os.system ("ls" + dir)
>> sh: ls/: No such file or directory
>
> this has concatenated "ls" and dir
On 12/17/2010 4:07 PM jtl999 said...
I want to pass a variable to os.system which is dir
dir=raw_input ("Dir Please ")
Dir Please /
ok dir = /
os.system ("ls" + dir)
sh: ls/: No such file or directory
this has concatenated "ls" and dir
try with "ls "
Emile
32512
any advice
__
I want to pass a variable to os.system which is dir
>>> dir=raw_input ("Dir Please ")
Dir Please /
ok dir = /
>>> os.system ("ls" + dir)
sh: ls/: No such file or directory
32512
any advice
signature.asc
Description: This is a digitally signed message part
_
: > self.fh.close
: >
: > Which doesn't show where the vars come from, but I am closing the
: file
: > first.
:
: Actually, no, it doesn't. You forgot the () which are needed to
: actually _call_ the close method on the last line.
:
:self.fh.close
:
: is an expression which evaluate
On 7/10/2009 10:24 AM daychi...@gmail.com said...
: Actually it sounds like you're calling it iteratively, not recursively.
:blush: Indeed.
: From what you write in here, my first thought is that the ini file
: isn't being flushed out to disk before the subprocess starts up and
: tries to rea
On Fri, Jul 10, 2009 at 12:22:24PM -0500, daychi...@gmail.com wrote:
> self.filename = 'bsf.ini'
> self.fullpath = self.thispath + self.filename
> self.fh = open(self.fullpath, 'w')
> self.fh.write(self.bsf_ini)
> self.fh.close
>
> Which doesn't show where t
: Actually it sounds like you're calling it iteratively, not recursively.
:blush: Indeed.
: From what you write in here, my first thought is that the ini file
: isn't being flushed out to disk before the subprocess starts up and
: tries to read it.
:
: Are you either calling .flush() or .close(
On Fri, Jul 10, 2009, daychi...@gmail.com wrote:
>I'm working on a program that calls another program recursively - this other
>program reads in ini file and processes it; my program creates a number of
>slightly different ini files and calls the other program for each one.
>
>I can successfully ge
On Fri, Jul 10, 2009 at 12:00:11PM -0500, daychi...@gmail.com wrote:
> I'm working on a program that calls another program recursively - this other
Actually it sounds like you're calling it iteratively, not recursively.
> I can successfully generate the ini file. The problem is that the other
> p
I'm working on a program that calls another program recursively - this other
program reads in ini file and processes it; my program creates a number of
slightly different ini files and calls the other program for each one.
I can successfully generate the ini file. The problem is that the other
pro
Aditya Lal wrote:
> On 04/02/08 10:42 PM, "Eric Brunson" <[EMAIL PROTECTED]> wrote:
>
>
>> dave selby wrote:
>>
>>> Hi all,
>>>
>>> I am not sure if this is a Python or bash issue :).
>>>
>>> In bash if I execute 'motion' with the following ...
>>>
>>> [EMAIL PROTECTED]:~/.kde/share/apps/km
On 04/02/08 10:42 PM, "Eric Brunson" <[EMAIL PROTECTED]> wrote:
> dave selby wrote:
>> Hi all,
>>
>> I am not sure if this is a Python or bash issue :).
>>
>> In bash if I execute 'motion' with the following ...
>>
>> [EMAIL PROTECTED]:~/.kde/share/apps/kmotion$ motion &> /dev/null &
>> [1] 10
dave selby wrote:
> Hi all,
>
> I am not sure if this is a Python or bash issue :).
>
> In bash if I execute 'motion' with the following ...
>
> [EMAIL PROTECTED]:~/.kde/share/apps/kmotion$ motion &> /dev/null &
> [1] 10734
> [EMAIL PROTECTED]:~/.kde/share/apps/kmotion$
>
> I get what I expect, a b
Popen may be a better call for what you're trying to do. Some of the
higher numbered popens will give you the stderr stream. The lowered
numbered ones are probably all you need.
http://docs.python.org/lib/node529.html
--Michael
On Feb 3, 2008 12:54 PM, dave selby <[EMAIL PROTECTED]> wrote
Hi all,
I am not sure if this is a Python or bash issue :).
In bash if I execute 'motion' with the following ...
[EMAIL PROTECTED]:~/.kde/share/apps/kmotion$ motion &> /dev/null &
[1] 10734
[EMAIL PROTECTED]:~/.kde/share/apps/kmotion$
I get what I expect, a background job, however if I execute
quot;wesley chun" <[EMAIL PROTECTED]>
2006.08.07 22:28
To
"János Juhász"
<[EMAIL PROTECTED]>
cc
tutor@python.org
Subject
Re: [Tutor] os.system()
with NO_WAIT
> os.system('vedicom.exe')
>
> Have you got any idea how I can strart this windows GU
> os.system('vedicom.exe')
>
> Have you got any idea how I can strart this windows GUI program with not
> waiting its return.
instead of os.system(), you want to use the subprocess module if you
are using Python 2.4+:
http://docs.python.org/lib/module-subprocess.html
calling subprocess.Po
Dear Guys,
I have a small script that is running on a terminal
server's client session.
###
import os
import time
import glob
def send():
print 'I am checking %s' % time.ctime()
if len(glob.glob(r'U:\ediout\DESADV\*.doc'))
> 0:
os.system('vedicom.exe')
if __name__ == '__mai
>> to do that you need to find the process ID. I'm not sure if
>> popen() provides access to the PID but if not you could
>> either search for it (this might be too slow) or just drop
>> down to use fork rather than popen, as fork will return
>> the PID.
>
>Would calling PS via another popen() and
On 10/28/05, Alan Gauld <[EMAIL PROTECTED]> wrote:
> > >>> f = os.popen2('ping 192.168.8.85 -c 100 > cap1.txt')
> > >>> f[0].write('\x03')
> >
> > Thank command works, but 'f[1]' is in read-only mode and I can't write
> > to it.
> > My command in the background is still not terminated.
>
> Thats al
Alan Gauld wrote:
>
> You can read the output of popen into your program with
> f.read(), but that will read all of the output after the program
> has run. However I think you can readline() too to catch it
> line by line. You can also write() data to f thus allowing you
> to send your Ctrl-C.(You
Johan Geldenhuys wrote:
> So far:
> I tried
> >>> f = os.popen('ping 192.168.8.85 -c 100 > cap2.txt')
>
> You will see that I send the output from the command to a file, because
> I want to test how stop the command before it reaches 100 pings.
> If I don't write the output to the file 'cap2.txt
With what can I try and see what the PID is when using popen() or popen2() ?
One thing that I noticed now is that when using popen() and the
sys.exit(). The command is completed before my Python shell is
terminated and if I use popen2(), sys.exit() works immediately but the
ping command runs st
> >>> f = os.popen2('ping 192.168.8.85 -c 100 > cap1.txt')
> >>> f[0].write('\x03')
>
> Thank command works, but 'f[1]' is in read-only mode and I can't write
> to it.
> My command in the background is still not terminated.
Thats almost certainly because ping never reads its input.
In that case
If I use popen2, I need to write to one of the tuple parts.
>>> f = os.popen2('ping 192.168.8.85 -c 100 > cap1.txt')
>>> f[0].write('\x03')
Thank command works, but 'f[1]' is in read-only mode and I can't write
to it.
My command in the background is still not terminated.
BTW I use Linux as OS.
> >>> f = os.popen('ping 192.168.8.85 -c 100 > cap2.txt')
>
> You will see that I send the output from the command to a file, because
> I want to test how stop the command before it reaches 100 pings.
> If I don't write the output to the file 'cap2.txt' and succeeds in
> closing 'f', all the dat
> Python has a "signal" module in the standard library. Will that work?
Yes potentially, but you still need to mess about with process ids etc
to find which process to send the signal... And you would have to do
the two things in separate threads since system() blocks your main program.
Alan g
So far:
I tried
>>> f = os.popen('ping 192.168.8.85 -c 100 > cap2.txt')
You will see that I send the output from the command to a file, because
I want to test how stop the command before it reaches 100 pings.
If I don't write the output to the file 'cap2.txt' and succeeds in
closing 'f', all th
>> I send a command to os.system(cmd) and want to send a break signal in
>> the same way. Is this possible? The break signal is ctrl c (^c).
>> I tried this, but it didn't work: os.system('\x03') I think Hex 03 is
>> the signal for ctrl c.
> Its not possible with os.system because os.system runs
> I send a command to os.system(cmd) and want to send a break signal in
> the same way. Is this possible? The break signal is ctrl c (^c).
> I tried this, but it didn't work: os.system('\x03') I think Hex 03 is
> the signal for ctrl c.
Its not possible with os.system because os.system runs the c
Even if you could send a break signal, it would go to a new shell that
os.system() invokes...
Perhaps you know or can get the ID of the process you want to signal, a
ctrl-c in a shell is equivalent to a SIGINT sent using os.kill()
Please anyone in the list correct me if there is something I mis
Hi all,
I send a command to os.system(cmd) and want to send a break signal in
the same way. Is this possible? The break signal is ctrl c (^c).
I tried this, but it didn't work: os.system('\x03') I think Hex 03 is
the signal for ctrl c.
Thanks,
___
Tu
53 matches
Mail list logo