On 1/10/25 12:53, Thomas Passin via Python-list wrote:
On 1/10/2025 4:00 PM, Tim Johnson via Python-list wrote:
On 1/10/25 11:32, MRAB via Python-list wrote:
,,, snipped
Below is the pertinent code:
Popen(choice, stdout=PIPE, stderr=PIPE,
stdin=PIPE, close_fds=True)
On 1/10/2025 4:00 PM, Tim Johnson via Python-list wrote:
On 1/10/25 11:32, MRAB via Python-list wrote:
,,, snipped
Below is the pertinent code:
Popen(choice, stdout=PIPE, stderr=PIPE,
stdin=PIPE, close_fds=True)
My guess is my argument list is either insufficient or
I just tried this:
>>> import subprocess
>>> subprocess.run('which audacity', shell=True)
/usr/bin/audacity
CompletedProcess(args='which audacity', returncode=0)
>>> proc = subprocess.Popen('/usr/bin/audacity
On 1/10/25 11:32, MRAB via Python-list wrote:
,,, snipped
Below is the pertinent code:
Popen(choice, stdout=PIPE, stderr=PIPE,
stdin=PIPE, close_fds=True)
My guess is my argument list is either insufficient or an argument is
causing the problem, but am unsure of which
from python
using subprocess.Popen(). I have never been able to successfully launch
audacity using this approach,
which does work for other apps.
I can launch audacity successfully using dmenu_run (on its own, outside
of the script)
Below is the pertinent code:
Popen(choice, stdout=PIPE, s
Using Python 3.12.3 on Ubuntu 24.04
I've converted a legacy python2 script to python3. All went well.
However, a glitch from python2 remains.
The script uses dmenu to create menus to pick applications. Applications
are then invoked from python
using subprocess.Popen(). I have never
On 10/7/22, c.bu...@posteo.jp wrote:
>
> I need to improve my understanding about how subprocess.Popen() does
> quote arguments. I have special case here.
>
> Simple example:
> Popen(['ls', '-l']) results on a shell in "ls -l" without quotation.
On Sat, 8 Oct 2022 at 08:24, wrote:
>
> Hello,
>
> I need to improve my understanding about how subprocess.Popen() does
> quote arguments. I have special case here.
>
> Simple example:
> Popen(['ls', '-l']) results on a shell in "ls -l" with
Hello,
I need to improve my understanding about how subprocess.Popen() does
quote arguments. I have special case here.
Simple example:
Popen(['ls', '-l']) results on a shell in "ls -l" without quotation.
Quotes are added if they are needed:
Popen(['ls',
ctypes.c_ulong
user32.WaitForInputIdle.argtypes = (ctypes.c_void_p, ctypes.c_ulong)
def wait_for_input_idle(proc, timeout=None):
if isinstance(proc, subprocess.Popen):
handle = int(proc._handle)
args = p.args
else:
handle = int(proc)
args = ''
if timeout is Non
On Mon, 22 Aug 2022 at 13:41, Dan Stromberg wrote:
>
>
>
> On Sun, Aug 21, 2022 at 2:05 PM Chris Angelico wrote:
>>
>> On Mon, 22 Aug 2022 at 05:39, simone zambonardi
>> wrote:
>> >
>> > Hi, I am running a program with the punishment subrocess.Popen(...) what I
>> > should do is to stop the scr
On Sun, Aug 21, 2022 at 2:05 PM Chris Angelico wrote:
> On Mon, 22 Aug 2022 at 05:39, simone zambonardi
> wrote:
> >
> > Hi, I am running a program with the punishment subrocess.Popen(...) what
> I should do is to stop the script until the launched program is fully open.
> How can I do this? I u
On Mon, 22 Aug 2022 at 05:39, simone zambonardi
wrote:
>
> Hi, I am running a program with the punishment subrocess.Popen(...) what I
> should do is to stop the script until the launched program is fully open. How
> can I do this? I used a time.sleep() function but I think there are other
> way
Sometimes, launching subprocesses can seem like punishment. I don't
think there is a standard cross-platform way to know when a launched
asynchronous process is "fully open" (i.e. fully initialized, accepting
user input).
On Sun, 2022-08-21 at 02:11 -0700, simone zambonardi wrote:
> Hi, I am runni
Hi, I am running a program with the punishment subrocess.Popen(...) what I
should do is to stop the script until the launched program is fully open. How
can I do this? I used a time.sleep() function but I think there are other ways.
Thanks
--
https://mail.python.org/mailman/listinfo/python-list
de: 8
CPU Utilized: 01:30:53
CPU Efficiency: 83.63% of 01:48:40 core-walltime
Job Wall-clock time: 00:13:35
Memory Utilized: 6.45 GB
Memory Efficiency: 80.68% of 8.00 GB
I want to parse this and am using subprocess.Popen and accessing the
contents via Popen.stdout. However, for te
Utilized: 01:30:53
CPU Efficiency: 83.63% of 01:48:40 core-walltime
Job Wall-clock time: 00:13:35
Memory Utilized: 6.45 GB
Memory Efficiency: 80.68% of 8.00 GB
I want to parse this and am using subprocess.Popen and accessing the
contents via Popen.stdout. However, for testing purposes
01:48:40 core-walltime
Job Wall-clock time: 00:13:35
Memory Utilized: 6.45 GB
Memory Efficiency: 80.68% of 8.00 GB
I want to parse this and am using subprocess.Popen and accessing the
contents via Popen.stdout. However, for testing purposes I want to save
various possible outputs of the
Loris Bennett wrote at 2022-3-11 07:40 +0100:
> ... I want to test the parsing ...
>Sorry if I was unclear but my question is:
>
>Given that the return value from Popen is a Popen object and given that
>the return value from reading a file is a single string or maybe a list
>of strings, what should
es: 1
>> Cores per node: 8
>> CPU Utilized: 01:30:53
>> CPU Efficiency: 83.63% of 01:48:40 core-walltime
>> Job Wall-clock time: 00:13:35
>> Memory Utilized: 6.45 GB
>> Memory Efficiency: 80.68% of 8.00 GB
>>
>>I want to parse this and am usi
gt; CPU Efficiency: 83.63% of 01:48:40 core-walltime
> Job Wall-clock time: 00:13:35
> Memory Utilized: 6.45 GB
> Memory Efficiency: 80.68% of 8.00 GB
>
>I want to parse this and am using subprocess.Popen and accessing the
>contents via Popen.stdout. However, for testing purpo
Memory Utilized: 6.45 GB
Memory Efficiency: 80.68% of 8.00 GB
I want to parse this and am using subprocess.Popen and accessing the
contents via Popen.stdout. However, for testing purposes I want to save
various possible outputs of the command as text files and use those as
inputs.
What
On 11/25/18 10:58 AM, srinivasan wrote:
> Even only with "*proc.decode("utf-8")"* in the above code still it seems to
> throw the error
>
> #return proc.strip().decode("utf-8")
> #return proc.decode("utf-8").strip()
> *return proc.decode("utf-8")*
>
> Error:
> /home/srinivasan/Downloa
On Mon, Nov 26, 2018 at 5:40 AM srinivasan wrote:
>
> Dear Karsten,
>
> With the help of Mrab Inputs, I tried Even with "return
> stdout.strip().decode("utf-8")", it still seems to be an issue, I am using
> python 3.6, is this causing a issue?
No, it isn't. Two things are causing most of your is
Dear Karsten,
With the help of Mrab Inputs, I tried Even with "return
stdout.strip().decode("utf-8")", it still seems to be an issue, I am using
python 3.6, is this causing a issue?
/home/srinivasan/Downloads/wifidisconnectissuenov23_homework/venv/bin/python
/home/srinivasan/Downloads/wifidiscon
t; >
> > interface = "wlan0"
> >
> >
> > def main(ssid, pw):
> >
> > try:
> > cmd = "nmcli device wifi connect '%s' password '%s'" % (ssid, pw)
> >
> > proc = subprocess.Popen(cmd, stdout=su
Thanks a lot for your quick responses Mrab and appreciate the same.
I changed the snippet as below, still it seems to be an issue,
I am using python3 version:
def main(ssid, pw):
try:
cmd = "nmcli device wifi connect '%s' password '%s'" % (ssid, pw)
> Even only with "*proc.decode("utf-8")"* in the above code still it seems to
> throw the error
No it does not. It throws the same TYPE of error due to the same
SORT of mistake you made.
You need to read carefully and try to think about what you read.
Karsten
--
https://mail.python.org/mailman/
7; password '%s'" % (ssid, pw)
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, shell=True, universal_newlines=True)
stdout, stderr = proc.communicate()
retcode = proc.returncode
print("printing stdout!!!
subprocess
>
> interface = "wlan0"
>
>
> def main(ssid, pw):
>
> try:
> cmd = "nmcli device wifi connect '%s' password '%s'" % (ssid, pw)
>
> proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
> stderr=subproce
Hope now I have changed on the string output as below, could you please
correct me if am still wrong?
import sys
import subprocess
interface = "wlan0"
def main(ssid, pw):
try:
cmd = "nmcli device wifi connect '%s' password '%s'" % (ssid,
On 2018-11-25 17:13, srinivasan wrote:
Dear Python Experts Team,
As am newbie still learning the python syntax from past 2 weeks, Excuse me,
If this might be silly question, As I am trying to execute shell command
(ie, nmcli) using "subprocess.Popen".
1. Am trying to improve the
> Kindly do the needful as am stuck with this issue from 2 days
How about YOU do the needful and post code that can actually be tested.
Karsten
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 25 Nov 2018 22:43:10 +0530, srinivasan wrote:
> Dear Python Experts Team,
>
> As am newbie still learning the python syntax from past 2 weeks, Excuse me,
> If this might be silly question, As I am trying to execute shell command
> (ie, nmcli) using "subprocess.Pope
Dear Python Experts Team,
As am newbie still learning the python syntax from past 2 weeks, Excuse me,
If this might be silly question, As I am trying to execute shell command
(ie, nmcli) using "subprocess.Popen".
1. Am trying to improve the below code with "try" and "exc
Ok, thanks. I've just created https://bugs.python.org/issue35305. /Henrik
On Fri, Nov 23, 2018 at 6:47 PM INADA Naoki wrote:
>
> Thank you for a very informative report.
>
> > PS. This is my first post to this list - please let me know if I
> > should send to another forum instead.
>
> Would you s
Thank you for a very informative report.
> PS. This is my first post to this list - please let me know if I
> should send to another forum instead.
Would you send this report to the issue tracker?
https://bugs.python.org/
--
INADA Naoki
--
https://mail.python.org/mailman/listinfo/python-list
I ran into an interesting problem where calling
`subprocess.Popen(['/sbin/ldconfig', '-p'], stdin=PIPE)` hangs and
never returns.
$ python
Python 2.7.9 (default, Apr 23 2015, 22:07:47)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
Type "help", "copyrigh
Cameron Simpson writes:
[...]
> What if you did this:
>
> os.signal(SIGINT, SIG_IGN)
> ... code code code, including the Popen/wait ...
> old_handler = os.signal(SIGINT, do_nothing_handler)
> sleep(...)
> os.signal(SIGINT, old_handler)
>
> SIG_IGN is different from a do-nothing handler; it
On 28Oct2017 23:56, Piet van Oostrum wrote:
I am using Python 2.7.14 on MacOS Sierra.
I have a small Python program that calls a shell script in a loop with a
time.sleep() in it.
The shell script is called with subprocess.Popen(), followed by a
subprocess.wait().
No information is exchanged
On 29Oct2017 10:11, Cameron Simpson wrote:
It may be a bug. Or it may be a system call which cannot be meaningfulling
retried. But had you considered only activating the handler around the sleep?
You still need to copy with SIGINT single I infer that you send this from
outside the program.
On Sun, Oct 29, 2017 at 8:56 AM, Piet van Oostrum wrote:
> I am using Python 2.7.14 on MacOS Sierra.
>
> I have a small Python program that calls a shell script in a loop with a
> time.sleep() in it.
> The shell script is called with subprocess.Popen(), followed by a
> subpr
I am using Python 2.7.14 on MacOS Sierra.
I have a small Python program that calls a shell script in a loop with a
time.sleep() in it.
The shell script is called with subprocess.Popen(), followed by a
subprocess.wait().
No information is exchanged with the shell script.
Once in a while I send
On Mon, Jun 26, 2017 at 2:22 PM, eryk sun wrote:
> On Mon, Jun 26, 2017 at 8:59 PM, Bill Deegan
> wrote:
> >
> > Ideally (for my use case) it would be something which propagated
> > universal_newlines to io.TextIOWrapper().. rather than discards it.
> > In my case I want the stdout to be encoded
On Mon, Jun 26, 2017 at 8:59 PM, Bill Deegan wrote:
>
> Ideally (for my use case) it would be something which propagated
> universal_newlines to io.TextIOWrapper().. rather than discards it.
> In my case I want the stdout to be encoded utf-8, but I do not want \r's
> changed to \n's as my test sys
On Mon, Jun 26, 2017 at 12:44 PM, eryk sun wrote:
> On Mon, Jun 26, 2017 at 5:23 PM, Bill Deegan
> wrote:
> >
> > That universal_newlines value is discarded due to:
> >
> > text_mode = encoding or errors or universal_newlines
> >
> > ...
> >
> > if text_mode:
> > self.stdout = io.TextIOWrapp
On Mon, Jun 26, 2017 at 5:23 PM, Bill Deegan wrote:
>
> That universal_newlines value is discarded due to:
>
> text_mode = encoding or errors or universal_newlines
>
> ...
>
> if text_mode:
> self.stdout = io.TextIOWrapper(self.stdout,
> encoding=encoding, errors=errors)
>
> There
Greetings,
I was surprised to see that if I set encoding in my call to
subprocess.Popen() as follows:
p = Popen(cmd,
stdin=stdin,
stdout=subprocess.PIPE,
stderr=stderr_value,
env=os.environ,
universal_newlines=False, #universal_newlines
On Sun, 30 Oct 2016 01:55 am, oyster wrote:
> why does not type(subprocess.Popen)==? Thanks
Because Popen is not a module.
Why do you expect it to be a module?
py> type(int)
py> type(float)
py> type(str)
py> class X(object):
... pass
...
py> type(X)
>>
why does not type(subprocess.Popen)==? Thanks
[quote]
Python 3.4.4 |Anaconda 2.3.0 (64-bit)| (default, Feb 16 2016, 09:54:04) [MSC v.1
600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import
On 03Apr2016 11:24, Hongyi Zhao wrote:
On Sun, 03 Apr 2016 18:20:31 +1000, Cameron Simpson wrote:
In particular, you want the subprocess' output. As written, your code
sets "output" to the Popen object. You actually want to set it to the
.stdout attribute of that object, which is the output fr
On Sun, 03 Apr 2016 18:20:31 +1000, Cameron Simpson wrote:
> In particular, you want the subprocess' output. As written, your code
> sets "output" to the Popen object. You actually want to set it to the
> .stdout attribute of that object, which is the output from the
> subcommand.
Based on your a
On 03Apr2016 14:24, Steven D'Aprano wrote:
On Sun, 3 Apr 2016 01:29 pm, Hongyi Zhao wrote:
I use the following code to update the os.environ with subprocess.Popen:
I don't understand what you are trying to do here. But regardless of your
intention, the problem you have is nothing
On Sun, 3 Apr 2016 01:29 pm, Hongyi Zhao wrote:
> Hi all,
>
> I use the following code to update the os.environ with subprocess.Popen:
I don't understand what you are trying to do here. But regardless of your
intention, the problem you have is nothing to do with updating os.
s.environ’”. I have
> updated the Subject field accordingly.
>
> The problem you're encountering is only to do with ‘subprocess.Popen’.
> That should make it much easier to search for the documentation to
> understand the problem.
>
> https://docs.python.org/3/library/
sub
Hongyi Zhao writes:
> I use the following code to update the os.environ with
> subprocess.Popen
Again, it is quite misleading to describe what you are doing as “update
the os.environ with subprocess.Popen”.
The ‘subprocess.Popen’ call *cannot* upsdate the Python process's
‘os.envi
Hi all,
I use the following code to update the os.environ with subprocess.Popen:
-
from subprocess import Popen
output = Popen("""
/bin/bash <
os.environ.update(line.partition('=')[::2] for line in output.split
('\0'))
AttributeError:
Hi all,
I use the following code to update the os.environ with subprocess.Popen:
-
from subprocess import Popen
output = Popen("""
/bin/bash <
os.environ.update(line.partition('=')[::2] for line in output.split
('\0'))
AttributeError:
Hi all,
I use the following code to update the os.environ with subprocess.Popen:
-
from subprocess import Popen
output = Popen("""
/bin/bash <
os.environ.update(line.partition('=')[::2] for line in output.split
('\0'))
AttributeError:
On Sun, 27 Mar 2016 13:24:05 +, Hongyi Zhao wrote:
> # replace env
> os.environ.clear()
I find another method which can solve this issue, ie., changing the above
code into the follows:
# ref : http://unix.stackexchange.com/questions/178522/unsetting-
environment-variable-with-an-empty-name
On Mon, Mar 28, 2016 at 12:24 AM, Hongyi Zhao wrote:
> # replace env
> os.environ.clear()
> os.environ.update(line.partition('=')[::2] for line in output.split('\0'))
>
> Traceback (most recent call last):
> File "/home/werner/anaconda2/lib/python2.7/site-packages/IPython/core/
> interactiveshel
On 27 Mar 2016 17:01, "Ben Finney" wrote:
>
> Hongyi Zhao writes:
>
> > I use the following code the update the os.environ:
> >
> > import os
> > from subprocess import check_output
> >
> > # POSIX: name shall not contain '=', value doesn't contain '\0'
> > output = check_output("source /home/wer
Hongyi Zhao writes:
> I use the following code the update the os.environ:
>
> import os
> from subprocess import check_output
>
> # POSIX: name shall not contain '=', value doesn't contain '\0'
> output = check_output("source /home/werner/env-intel-toolchains.sh;
> env -0", shell=True, e
Hi all,
Based on the methods here:
http://stackoverflow.com/questions/7040592/calling-the-source-command-
from-subprocess-popen/18897007#comment30954741_12708396
I use the following code the update the os.environ:
import os
from subprocess import check_output
# POSIX: name shall not contain '=
> method) directly as the `stdin` argument to subprocess.Popen, but it
> seems that the *encrypted* data is used by the subprocess.
In order to access an SSL socket, something special must be done
during the connection(/opening) phase: then certificates are
exchanged/verified and a common se
for each individual call to btrfs send | btrfs receive. In addition to
> verifying the client certificates against a trusted CA, this also allows
> things like selecting the backup destination based on the common name in
> the client cert.
> [snip details of subprocess.Popen issues]
Hmm
n to
verifying the client certificates against a trusted CA, this also allows
things like selecting the backup destination based on the common name in
the client cert.
I've hit an issue that I'm not sure how to work through, though. I'm
attempting to use a SSL socket (and/or the result o
ion/)
>
> I am using subprocess.Popen("AcroRe32.exe /n ") which is the
> actuall adobe reader command I'd issue on the command line to open the pdf
> (the /n option opens it the file in a new instance of reader).
>
> Now, when I issue the command straight from powershe
ion/)
>
> I am using subprocess.Popen("AcroRe32.exe /n ") which is the
> actuall adobe reader command I'd issue on the command line to open the pdf
> (the /n option opens it the file in a new instance of reader).
>
> Now, when I issue the command straight from powershe
I think that your problem is that you have Protected Mode enabled.
If you do, you either have to disable that, or write a policy config
file.
https://www.adobe.com/devnet-docs/acrobatetk/tools/AppSec/protectedmode.html
says.
From: Policy configuration
Protected mode prevents a number of actions
ion/)
>
> I am using subprocess.Popen("AcroRe32.exe /n ") which is the
> actuall adobe reader command I'd issue on the command line to open the pdf
> (the /n option opens it the file in a new instance of reader).
>
> Now, when I issue the command straight from powershe
s\rptlab\tmp> python
Python 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
import subprocess
subprocess.Popen(['C:\Program Files (x86)\Adobe\Reader
.
Naftali,
I ran the following from python prompt
import os
os.system('"C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" /n
thello.pdf')
and this worked as did
import subprocess
subprocess.Popen(['C:\Program Files (x86)\Adobe\Reader
11.0
ion/)
>
> I am using subprocess.Popen("AcroRe32.exe /n ") which is the
> actuall adobe reader command I'd issue on the command line to open the pdf
> (the /n option opens it the file in a new instance of reader).
>
> Now, when I issue the command straight from powershe
ion/)
>
> I am using subprocess.Popen("AcroRe32.exe /n ") which is the
> actuall adobe reader command I'd issue on the command line to open the pdf
> (the /n option opens it the file in a new instance of reader).
>
> Now, when I issue the command straight from powershe
ation/)
>
>I am using subprocess.Popen("AcroRe32.exe /n ") which is the actuall
>adobe reader command I'd issue on the command line to open the pdf (the /n
>option opens it the file in a new instance of reader).
>
>Now, when I issue the command straight from powershell, th
It actually doesn't fail but it 'cannot open in protected mode' (see here
http://blogs.adobe.com/dmcmahon/2012/07/27/adobe-reader-cannot-open-protected-mode-due-to-a-problem-with-your-system-configuration/)
I am using subprocess.Popen("AcroRe32.exe /n ") which is
On May 21, 2015 12:41 AM, "Thomas Rachel" <
nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de> wrote:
>
> Am 20.05.2015 um 18:44 schrieb Robin Becker:
>
>> not really, it's just normal to keep event routines short; the routine
>> which beeps is after detection of the cat's entrance
Am 20.05.2015 um 18:44 schrieb Robin Becker:
not really, it's just normal to keep event routines short; the routine
which beeps is after detection of the cat's entrance into the house and
various recognition schemes have pronounced intruder :)
You could add a timed "cleanup" routine which .wai
On 20/05/2015 16:42, Alain Ketterlin wrote:
Robin Becker writes:
.
The code I used to use with os.spawnl was even worse in leaving
zombies around.
For the same reason (os.wait() and os.waitpid() let you ... wait for
child-processes).
I suppose I needed to keep a record of all t
Robin Becker writes:
> As part of a long running PyQT process running as a window app in Arch
> linux I needed an alert sound, I decided to use the beep command and
> the app code then looked like
>
> pid = Popen(['/home/robin/bin/mybeep', '-r3', '-f750', '-l100', '-d75']).pid
>
> the mybeep scri
Op Wednesday 20 May 2015 15:16 CEST schreef Robin Becker:
> As part of a long running PyQT process running as a window app in
> Arch linux I needed an alert sound, I decided to use the beep
> command and the app code then looked like
>
> pid = Popen(['/home/robin/bin/mybeep', '-r3', '-f750', '-l10
As part of a long running PyQT process running as a window app in Arch linux I
needed an alert sound, I decided to use the beep command and the app code then
looked like
pid = Popen(['/home/robin/bin/mybeep', '-r3', '-f750', '-l100', '-d75']).pid
the mybeep script handles module loading if req
On Mon, Feb 23, 2015 at 11:13 PM, Robert Clove wrote:
> proc1=subprocess.Popen("/root/Desktop/abc.py","64","abc",shell=True,stdout=subprocess.PIPE,
> stderr=subprocess.PIPE)
As others have said, you need to use either a single command or a list
of strings. B
> Hi, the parameter list should be a list of strings, not several unpacked
> strings :
>
> command = ["/root/Desktop/abc.py","64","abc"]
> proc1 = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
> stderr=subprocess.PIPE)
&
On 23/02/2015 13:13, Robert Clove wrote:
Hi All,
I am using the Linux system with python, i am running the following script
#!/usr/bin/python
import threading
import time
import sys
import subprocess
import datetime
import os
import time
import logging
proc1=subprocess.Popen("
When `shell=True`, the first argument should be string passed to shell.
So you should:
proc1=subprocess.Popen("/root/Desktop/abc.py 64 abc",
shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
On Mon, Feb 23, 2015 at 9:13 PM, Robert Clove wrote:
> Hi All,
>
> I
Hi All,
I am using the Linux system with python, i am running the following script
#!/usr/bin/python
import threading
import time
import sys
import subprocess
import datetime
import os
import time
import logging
proc1=subprocess.Popen("/root/Desktop/abc.py","64",&qu
* Jerry Hill [130830 07:48]:
> On Fri, Aug 30, 2013 at 11:32 AM, Tim Johnson wrote:
> > The objective is to display all output, but to also separate error
> > messages from normal output.
>
> I still think you want to use communicate(). Like this:
>
> p = s
* Nobody [130830 06:55]:
> On Thu, 29 Aug 2013 17:00:21 -0800, Tim Johnson wrote:
>
> > ## This appears to be what works.
> > def __exec(self,args) :
> > """Run the process with arguments"""
> >p =
> >s
On Fri, Aug 30, 2013 at 11:32 AM, Tim Johnson wrote:
> The objective is to display all output, but to also separate error
> messages from normal output.
I still think you want to use communicate(). Like this:
p = subprocess.Popen(args,stderr=subprocess.PIPE,stdout=subprocess.PIPE)
On Thu, 29 Aug 2013 17:00:21 -0800, Tim Johnson wrote:
> ## This appears to be what works.
> def __exec(self,args) :
> """Run the process with arguments"""
>p =
>subprocess.Popen(args,stderr=subprocess.PIPE,stdout=subprocess
* Tim Johnson [130829 10:51]:
> using Python 2.7.1 on OS X 10.7.5
>
> I'm managing a process of drush using an instance of subprocess.Popen
<...>
## This appears to be what works.
def __exec(self,args) :
"""Run the process with arguments"&q
the buffer fills up and blocks the subprocess.
>
> Try reading the output or using the .communicate method.
>
> Alternatively, pass an open file as the stdout argument.
>
Kudos to all for the replies. Here is some code to review:
## execute process and read output
p = subp
On Thursday 2013 August 29 11:34, Tim Johnson wrote:
> using Python 2.7.1 on OS X 10.7.5
>
> I'm managing a process of drush using an instance of subprocess.Popen
>
> The process has a '--verbose' option. When that option is passed as
> part of the initializer
Tim Johnson
> using Python 2.7.1 on OS X 10.7.5
>
> I'm managing a process of drush using an instance of subprocess.Popen
>
> The process has a '--verbose' option. When that option is passed as
> part of the initializer `args' argument, the process will
On 29/08/2013 19:34, Tim Johnson wrote:
using Python 2.7.1 on OS X 10.7.5
I'm managing a process of drush using an instance of subprocess.Popen
The process has a '--verbose' option. When that option is passed as
part of the initializer `args' argument, the process will ha
using Python 2.7.1 on OS X 10.7.5
I'm managing a process of drush using an instance of subprocess.Popen
The process has a '--verbose' option. When that option is passed as
part of the initializer `args' argument, the process will hang.
It should be no surprise as drush outpu
Thank you very much, Peter!
It works!
On Thu, May 23, 2013 at 9:32 AM, Peter Otten <__pete...@web.de> wrote:
> Alex Naumov wrote:
>
> > I'm trying to call new process with some parameters. The problem is that
> > the last parameter is a "string" that has a lot of spaces and different
> > symbols
Alex Naumov wrote:
> I'm trying to call new process with some parameters. The problem is that
> the last parameter is a "string" that has a lot of spaces and different
> symbols like slash and so on. I can save it in file and use name of this
> file as parameter, but my question is: how to make it
1 - 100 of 558 matches
Mail list logo