On 13/07/17 16:42, sanky8...@gmail.com wrote:
I have created one thread in python, and that thread is running in infinite loop, but
when I was trying to kill a process by making use of subprocess.call("my ps
command") Its not actually working
Here is the code,
import thread
I have created one thread in python, and that thread is running in infinite
loop, but when I was trying to kill a process by making use of
subprocess.call("my ps command") Its not actually working
Here is the code,
import threading
import subprocess
def B():
while True:
Dennis Lee Bieber wrote:
> >I want to create a zip file within a Python 2.7 program on windows.
> >
> >My code:
> >
> > cmd = ['7za.exe','a','-tzip',archive] + files
> > status = subprocess.call(cmd)
> >
> My
Dennis Lee Bieber wrote:
> Python has a zipfile library that is portable between OS. Along with
> libraries for gzip, bzip2, and tarfiles...
Ohh.. this is new to me!
https://docs.python.org/2/library/tarfile.html
https://docs.python.org/2/library/zipfile.html
What is missing in the doc
In a message of Tue, 15 Dec 2015 14:25:50 +, Ulli Horlacher writes:
>(My first posting seems to got lost)
>
>I want to create a zip file within a Python 2.7 program on windows.
>
>My code:
>
> cmd = ['7za.exe','a','-tzip',archive] +
fileslist = archive + '.list'
> flo = open(fileslist,'w')
> for file in files: print(file,file=flo)
> flo.close()
> cmd = ['7za.exe','a','-tzip',archive,'@'+fileslist]
> status = subprocess.call(cmd)
>
>
>
(My first posting seems to got lost)
I want to create a zip file within a Python 2.7 program on windows.
My code:
cmd = ['7za.exe','a','-tzip',archive] + files
status = subprocess.call(cmd)
leads to:
File "fexit.py", line 971, in sendfile_retry
I want to create a zip file within a Python 2.7 program on windows.
My code:
cmd = ['7za.exe','a','-tzip',archive] + files
status = subprocess.call(cmd)
leads to:
File "fexit.py", line 971, in sendfile_retry
status = subprocess.call(cmd)
Fi
Ombongi Moraa Fe wrote:
> [-- text/plain, encoding 7bit, charset: ISO-8859-1, 19 lines --]
> In my python script, I have this:
> command="lynx -dump
> 'phpscript?param1=%s¶m2=%s¶m3=%s¶m4=%s¶m5=%s'"%(value1,value2,value3,value4)
> result=subprocess.call(comma
Il 19/04/2013 11:56, Ombongi Moraa Fe ha scritto:
> Hi Team,
>
> In my python script, I have this:
>
> command="lynx -dump
> 'phpscript?param1=%s¶m2=%s¶m3=%s¶m4=%s¶m5=%s'"%(value1,value2,value3,value4)
http://docs.python.org/2/library/subprocess.html#module-subprocess
You should set the properl
Hi Team,
In my python script, I have this:
command="lynx -dump
'phpscript?param1=%s¶m2=%s¶m3=%s¶m4=%s¶m5=%s'"%(value1,value2,value3,value4)
result=subprocess.call(command,shell=True)
print 'xml message'
However, the response from running the php script is also pri
On Tue, Jan 22, 2013 at 12:04 AM, Dave Angel wrote:
> Why not just pass all the filenames as parameters in one invocation of
> notepad? Assuming Notepad is written reasonably, that'll give it all to you
> in one window, instead of opening many separate ones.
The OP is talking about Windows Notep
t;> wrote:
On 01/21/2013 06:25 AM, Tom Borkin wrote:
Hi;
I have this code:
for song in my_songs:
subprocess.call(['notepad.exe'__, '%s.txt' % song])
print song
It opens the first song and hangs on subsequen
t;>
>> for song in my_songs:
>>subprocess.call(['notepad.exe'**, '%s.txt' % song])
>>print song
>>
>> It opens the first song and hangs on subsequent songs. It doesn't open the
>> next song or execute the print until I have closed the
On 01/21/2013 06:25 AM, Tom Borkin wrote:
Hi;
I have this code:
for song in my_songs:
subprocess.call(['notepad.exe', '%s.txt' % song])
print song
It opens the first song and hangs on subsequent songs. It doesn't open the
next song or execute the print until I
gs
> available. Please advise.
If you want to be able to keep track of the child process (e.g. to
determine when it has finished), use subprocess.Popen(). If you just want
to "fire and forget", use the "start" shell command, e.g.:
subprocess.call(['start', 'n
On 21/01/2013 11:25, Tom Borkin wrote:
> Hi;
> I have this code:
>
> #!/Python27/python
> import os, subprocess, sys
> lyrics_path = "/Users/Tom/Documents/lyrics"
> os.chdir(lyrics_path)
>
> songs = ['livin-la-vida-loca', 'whos-that-lady'
Hi;
I have this code:
#!/Python27/python
import os, subprocess, sys
lyrics_path = "/Users/Tom/Documents/lyrics"
os.chdir(lyrics_path)
songs = ['livin-la-vida-loca', 'whos-that-lady']
for song in songs:
subprocess.call(['notepad.exe', '%s.txt
t;Program Files", "Apache Group", "Apache2",
> > "htdocs", "ccc", "run_alert.py")
> > #subprocess.call(['SchTasks', '/Create', '/SC', 'ONCE', '/TN', '"test"',
> &
On Wed, Nov 21, 2012 at 6:01 AM, Tim Golden wrote:
> subprocess.call([
> 'SchTasks', '/Create',
> '/SC', 'ONCE',
> '/TN', 'test',
> '/TR', path,
> '/ST', '23:50'
> ])
>
Th
On 20/11/2012 23:41, Tom Borkin wrote:
> Using shlex, I now have this:
> #!\Python27\python
> import os, subprocess
> path = os.path.join("C:\\", "Program Files", "Apache Group", "Apache2",
> "htdocs", "ccc", "run_al
t;, "Apache2",
> "htdocs", "ccc", "run_alert.py")
> #subprocess.call(['SchTasks', '/Create', '/SC', 'ONCE', '/TN', '"test"',
> '/TR', path, '/ST', '23:50'])
> subpro
Using shlex, I now have this:
#!\Python27\python
import os, subprocess
path = os.path.join("C:\\", "Program Files", "Apache Group", "Apache2",
"htdocs", "ccc", "run_alert.py")
#subprocess.call(['SchTasks', '/C
On Sun, Nov 18, 2012 at 5:48 AM, Tom Borkin wrote:
> Hi,
> I have this code:
>
> #!\Python27\python
>
> import subprocess
> #subprocess.call(['SchTasks /Create /SC ONCE /TN "My Tasks" /TR "C:/Program
> Files/Apache Group/Apache2/htdocs/ccc/run_alert.py
On 18/11/2012 13:48, Tom Borkin wrote:
import subprocess
#subprocess.call(['SchTasks /Create /SC ONCE /TN "My Tasks" /TR "C:/Program
Files/Apache Group/Apache2/htdocs/ccc/run_alert.py" /ST 07:50'], shell=True)
subprocess.call(['SchTasks /Create /SC ONCE /TN
Hi,
I have this code:
#!\Python27\python
import subprocess
#subprocess.call(['SchTasks /Create /SC ONCE /TN "My Tasks" /TR "C:/Program
Files/Apache Group/Apache2/htdocs/ccc/run_alert.py" /ST 07:50'], shell=True)
subprocess.call(['SchTasks /Create /SC ONCE /TN
On May 19, 10:28 pm, Ben Finney wrote:
> Better is to use ‘shlex.split’ to split the string as a shell parser
> would do http://docs.python.org/library/shlex#shlex.split>.
Good point. I always forget about shlex.split because I'm usually
passing (relatively) constant strings with no funny quoti
tpasswordbox function, which made popping a dialog box and storing
> the usernames very painless.
>
> However, subprocess.call as implemented below doesn't work. For some
> reason the "-s ts.mycompany.org:80" parameter is being interpreted
> differently by the applicatio
Patrick Maupin writes:
> On May 19, 9:27 pm, Carbon wrote:
> > subprocess.call(["/opt/2X/Client/bin/appserverclient", "-u
> > fieldValues [0]", "-p fieldValues[1]", "-s ts.mycompany.org:80", "-d
> > corp", "-S local&qu
ction, which made popping a dialog box and storing
> the usernames very painless.
>
> However, subprocess.call as implemented below doesn't work. For some
> reason the "-s ts.mycompany.org:80" parameter is being interpreted
> differently by the application when sent
the usernames very painless.
However, subprocess.call as implemented below doesn't work. For some
reason the "-s ts.mycompany.org:80" parameter is being interpreted
differently by the application when sent from the python script than it
does when sent from the BASH script below.
parameter I need to use with call so that the python calling
>> program doesn't wait for the termination of the subprocess?
>>
>
> Use subprocess.Popen instead of directly using subprocess.call.
Or (maybe) better, use the webbrowser module.
http://docs.python.org/rel
t; program doesn't wait for the termination of the subprocess?
>
Use subprocess.Popen instead of directly using subprocess.call.
--
regards,
kushal
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'd like to call an external application (firefox) from a python program (a
PyQT GUI), but I want the external application to run in the background, I
mean I do not want my python calling program to wait till the external
subprocess terminates.
I've tried this:
call(["firefox", "http://www.py
> I am very confused about unicode. Can someone point me in the right
> direction?
Try Python 3.1. This should accept Unicode strings directly for sp.call,
so you wouldn't need to encode first.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Thanks. I looked around for alternatives but didn't find this one.
Rick
Chris Rebert wrote:
On Sat, Jul 18, 2009 at 3:30 PM, Rick King wrote:
Hello,
I want to copy files using subprocess.call or os.system where the file names
are non-ascii, e.g. Serbian(latin), c's and s's w
Rick King wrote:
Hello,
I want to copy files using subprocess.call or os.system where the file
names are non-ascii, e.g. Serbian(latin), c's and s's with hacheks,etc.
Windows stores all the file names in unicode so they are displayed ok in
explorer, and I can read them into my pr
On Sat, Jul 18, 2009 at 3:30 PM, Rick King wrote:
> Hello,
> I want to copy files using subprocess.call or os.system where the file names
> are non-ascii, e.g. Serbian(latin), c's and s's with hacheks,etc. Windows
> stores all the file names in unicode so they are displayed o
Hello,
I want to copy files using subprocess.call or os.system where the file
names are non-ascii, e.g. Serbian(latin), c's and s's with hacheks,etc.
Windows stores all the file names in unicode so they are displayed ok in
explorer, and I can read them into my program with listdir(
On Tue, Apr 15, 2008 at 11:16:01PM +0200, David wrote:
> >
> > Still, about StringIO...
> >
>
> The module description says you can use it to read and write strings
> as files, not that you can use strings *everywhere* you can use files.
>
> In your specific case, StringIO doesn't work, because
>
> Still, about StringIO...
>
The module description says you can use it to read and write strings
as files, not that you can use strings *everywhere* you can use files.
In your specific case, StringIO doesn't work, because the stdout
redirection takes place at the operating system level (which
put.
Still, about StringIO...
> trying this:
>
> import StringIO
> import subprocess
>
> file = StringIO.StringIO()
>
> subprocess.call("ls", stdout = file)
>
> Traceback (most recent call last):
> File "", line 6, in ?
> File "
On Tue, Apr 15, 2008 at 10:36 PM, Tobiah <[EMAIL PROTECTED]> wrote:
> I am not sure how to capture the output of a command
> using subprocess without creating a temp file. I was
> trying this:
>
> import StringIO
> import subprocess
>
> file = StringIO.Strin
I am not sure how to capture the output of a command
using subprocess without creating a temp file. I was
trying this:
import StringIO
import subprocess
file = StringIO.StringIO()
subprocess.call("ls", stdout = file)
Traceback (most recent call last):
File "", line
On Nov 11, 3:25 pm, Rob Wolfe <[EMAIL PROTECTED]> wrote:
Hi Rob,
> Michael GeorgeLerner<[EMAIL PROTECTED]> writes:
>
> > Hi,
>
> > (Python 2.5, OS X 10.4.10)
> > I have a program called pdb2pqr on my system. It is installed so that
> > "pdb2pqr" is in my path and looks like:
>
> > #\!/bin/zsh -f
Michael George Lerner <[EMAIL PROTECTED]> writes:
> Hi,
>
> (Python 2.5, OS X 10.4.10)
> I have a program called pdb2pqr on my system. It is installed so that
> "pdb2pqr" is in my path and looks like:
>
> #\!/bin/zsh -f
Are you sure that this shebang is correct?
I've tested that on bash and hav
ile
args = ('/sw/bin/pdb2pqr','--help')
output_file = tempfile.TemporaryFile(mode="w+")
print "Running",args
retcode =
subprocess.call(args,stdout=output_file.fileno(),stderr=subprocess.STDOUT)
output_file.close()
I get this error:
localhost~/tmp$ ./x.py
On Oct 7, 1:01 pm, Michael Torrie <[EMAIL PROTECTED]> wrote:
> timw.google wrote:
> > Hi
>
> > I want to write a python script that runs rsync on a given directory
> > and host. I build the command line string, but when I try to run
> > subprocess.call(cmd), o
On 05 Oct 2007 16:23:50 GMT, Stargaming <[EMAIL PROTECTED]> wrote:
> On Fri, 05 Oct 2007 08:37:05 -0700, timw.google wrote:
> >> I can't ssh w/o supplying a password. That's the way the security is
> >> set up here.
> >>
> >> How do I use python to do this, or do I just have to write a zsh
> >> scr
timw.google wrote:
> Hi
>
> I want to write a python script that runs rsync on a given directory
> and host. I build the command line string, but when I try to run
> subprocess.call(cmd), or p=subprocess.Popen(cmd, shell=True),or
> os.system(cmd), I get prompted for my login pa
Typo.
> Another method is to setup an ssh service on the server (perhaps in
Should be:
> Another method is to setup an rsync service on the server (perhaps in
--
http://mail.python.org/mailman/listinfo/python-list
On 10/5/07, timw.google <[EMAIL PROTECTED]> wrote:
> Hi
>
> I want to write a python script that runs rsync on a given directory
> and host. I build the command line string, but when I try to run
> subprocess.call(cmd), or p=subprocess.Popen(cmd, shell=True),or
> os.system(
In message <[EMAIL PROTECTED]>,
timw.google wrote:
> I want to write a python script that runs rsync on a given directory
> and host. I build the command line string, but when I try to run
> subprocess.call(cmd), or p=subprocess.Popen(cmd, shell=True),or
> os.system(cmd), I g
On Fri, 05 Oct 2007 08:37:05 -0700, timw.google wrote:
> On Oct 5, 10:33 am, "timw.google" <[EMAIL PROTECTED]> wrote:
>> Hi
>>
>> I want to write a python script that runs rsync on a given directory
>> and host. I build the command line string, but when
On Oct 5, 10:33 am, "timw.google" <[EMAIL PROTECTED]> wrote:
> Hi
>
> I want to write a python script that runs rsync on a given directory
> and host. I build the command line string, but when I try to run
> subprocess.call(cmd), or p=subprocess.Popen(cmd, shell=T
Hi
I want to write a python script that runs rsync on a given directory
and host. I build the command line string, but when I try to run
subprocess.call(cmd), or p=subprocess.Popen(cmd, shell=True),or
os.system(cmd), I get prompted for my login password. I expected this,
but when I try to give my
Alex Kachanov wrote:
>>subprocess.call(["find", dir, "-name", "*.zip", "-execdir", "unzip",
>> "{}", ";"])
>
> Ok, thanks, it works.
> But what's the difference? Why I can't pass all para
>>
>> dir=os.path.join(os.path.expanduser("~/domains/domain.com/html"),'test')
>>subprocess.call(['find',dir+" -name '*.zip' -execdir unzip {} \;"])
>
>subprocess.call(["find", dir, "-name", &quo
Alex Kachanov wrote:
> running py module with the following code from shell:
> __
>dir=os.path.join(os.path.expanduser("~/domains/domain.com/html"),'test')
>subprocess.call(['find',dir+" -name '*.zip' -execdir unzip {} \;"])
Hi!
running py module with the following code from shell:
__
dir=os.path.join(os.path.expanduser("~/domains/domain.com/html"),'test')
subprocess.call(['find',dir+" -name '*.zip' -execdir unzip {} \;"])
__
returns:
__
find: /home/clien
Torsten Bronger wrote:
> The following code
>
> from subprocess import call
> call(['cp', 'subdir/*.jpg', 'othersubdir/'])
>
> yields
>
> cp: call of stat for "subdir/*.jpg" not possible: File or directory not found
>
> (This may not be the real error message since it's back-translated
> from Germ
Hallöchen!
The following code
from subprocess import call
call(['cp', 'subdir/*.jpg', 'othersubdir/'])
yields
cp: call of stat for "subdir/*.jpg" not possible: File or directory not found
(This may not be the real error message since it's back-translated
from German.) I could use shell=True,
Thanks a lot :)
Petr
--
http://mail.python.org/mailman/listinfo/python-list
McBooCzech wrote:
> This is easy. Subprocess function "call" looks:
> returncode = subprocess.call(["/root/dex/dex","/dev/ttyS0",
> "blabla.txt"])
> and it runs smoothly.
>
> The problem starts when I am trying to add 1>/dev/nu
ction "call" looks:
returncode = subprocess.call(["/root/dex/dex","/dev/ttyS0",
"blabla.txt"])
and it runs smoothly.
The problem starts when I am trying to add 1>/dev/null 2>/dev/null
parameters to suppres output sendings.
In the Shell it looks like
65 matches
Mail list logo