Re: subprocess.Popen does not launch audacity

2025-01-10 Thread Tim Johnson via Python-list
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)

Re: subprocess.Popen does not launch audacity

2025-01-10 Thread Thomas Passin via Python-list
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

Re: subprocess.Popen does not launch audacity

2025-01-10 Thread Left Right via Python-list
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

Re: subprocess.Popen does not launch audacity

2025-01-10 Thread Tim Johnson via Python-list
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

Re: subprocess.Popen does not launch audacity

2025-01-10 Thread MRAB via Python-list
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

subprocess.Popen does not launch audacity

2025-01-10 Thread Tim Johnson via Python-list
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

Re: Debugging automatic quotation in subprocess.Popen()

2022-10-07 Thread Eryk Sun
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.

Re: Debugging automatic quotation in subprocess.Popen()

2022-10-07 Thread Chris Angelico
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

Debugging automatic quotation in subprocess.Popen()

2022-10-07 Thread c.buhtz
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',

Re: subprocess.popen how wait complete open process

2022-08-22 Thread Eryk Sun
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

Re: subprocess.popen how wait complete open process

2022-08-21 Thread Chris Angelico
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

Re: subprocess.popen how wait complete open process

2022-08-21 Thread Dan Stromberg
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

Re: subprocess.popen how wait complete open process

2022-08-21 Thread Chris Angelico
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

Re: subprocess.popen how wait complete open process

2022-08-21 Thread Paul Bryan
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

subprocess.popen how wait complete open process

2022-08-21 Thread simone zambonardi
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

Re: How to test input via subprocess.Popen with data from file

2022-03-11 Thread Tobiah
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

Re: How to test input via subprocess.Popen with data from file

2022-03-11 Thread Roel Schroeven
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

Re: How to test input via subprocess.Popen with data from file

2022-03-11 Thread Roel Schroeven
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

Re: How to test input via subprocess.Popen with data from file

2022-03-10 Thread Dieter Maurer
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

Re: How to test input via subprocess.Popen with data from file

2022-03-10 Thread Loris Bennett
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

Re: How to test input via subprocess.Popen with data from file

2022-03-10 Thread Dieter Maurer
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

How to test input via subprocess.Popen with data from file

2022-03-10 Thread Loris Bennett
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

Re: [Tutor] Issue in using "subprocess.Popen" for parsing the command output

2018-11-26 Thread Mats Wichmann
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

Re: Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread Chris Angelico
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

Re: Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread srinivasan
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

Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread srinivasan
t; > > > interface = "wlan0" > > > > > > def main(ssid, pw): > > > > try: > > cmd = "nmcli device wifi connect '%s' password '%s'" % (ssid, pw) > > > > proc = subprocess.Popen(cmd, stdout=su

Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread srinivasan
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)

Aw: Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread Karsten Hilbert
> 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/

Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread MRAB
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!!!

Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread srinivasan
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

Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread srinivasan
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,

Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread MRAB
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

Aw: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread Karsten Hilbert
> 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

Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread Wildman via 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

Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread srinivasan
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

Re: subprocess.Popen(['/sbin/ldconfig', '-p'], stdin=PIPE) itself hangs/deadlocks (Linux)

2018-11-23 Thread Henrik Bengtsson
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

Re: subprocess.Popen(['/sbin/ldconfig', '-p'], stdin=PIPE) itself hangs/deadlocks (Linux)

2018-11-23 Thread INADA Naoki
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

subprocess.Popen(['/sbin/ldconfig', '-p'], stdin=PIPE) itself hangs/deadlocks (Linux)

2018-11-23 Thread Henrik Bengtsson
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

Re: Problem with subprocess.Popen and EINTR

2017-10-29 Thread Piet van Oostrum
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

Re: Problem with subprocess.Popen and EINTR

2017-10-28 Thread Cameron Simpson
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

Re: Problem with subprocess.Popen and EINTR

2017-10-28 Thread Cameron Simpson
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.

Re: Problem with subprocess.Popen and EINTR

2017-10-28 Thread Chris Angelico
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

Problem with subprocess.Popen and EINTR

2017-10-28 Thread Piet van Oostrum
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

Re: Question about propagating universal_newlines through subprocess.Popen to io.TextIOWrapper

2017-06-26 Thread Bill Deegan
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

Re: Question about propagating universal_newlines through subprocess.Popen to io.TextIOWrapper

2017-06-26 Thread eryk sun
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

Re: Question about propagating universal_newlines through subprocess.Popen to io.TextIOWrapper

2017-06-26 Thread Bill Deegan
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

Re: Question about propagating universal_newlines through subprocess.Popen to io.TextIOWrapper

2017-06-26 Thread eryk sun
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

Question about propagating universal_newlines through subprocess.Popen to io.TextIOWrapper

2017-06-26 Thread Bill Deegan
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

Re: what does type(subprocess.Popen)== mean?

2016-10-29 Thread Steve D'Aprano
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) >>

what does type(subprocess.Popen)== mean?

2016-10-29 Thread oyster
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

Re: Failed to update the os.environ with subprocess.Popen.

2016-04-03 Thread Cameron Simpson
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

Re: Failed to update the os.environ with subprocess.Popen.

2016-04-03 Thread Hongyi Zhao
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

Re: Failed to update the os.environ with subprocess.Popen.

2016-04-03 Thread Cameron Simpson
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

Re: Failed to update the os.environ with subprocess.Popen.

2016-04-02 Thread Steven D'Aprano
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.

Re: Get the output from a Popen instance (was: Failed to update the os.environ with subprocess.Popen.)

2016-04-02 Thread Hongyi Zhao
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

Get the output from a Popen instance (was: Failed to update the os.environ with subprocess.Popen.)

2016-04-02 Thread Ben Finney
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

Failed to update the os.environ with subprocess.Popen.

2016-04-02 Thread Hongyi Zhao
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:

Failed to update the os.environ with subprocess.Popen.

2016-04-02 Thread Hongyi Zhao
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:

Failed to update the os.environ with subprocess.Popen.

2016-04-02 Thread Hongyi Zhao
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:

Re: Calling the source command from subprocess.popen to update the os.environ.

2016-03-27 Thread Hongyi Zhao
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

Re: Calling the source command from subprocess.popen to update the os.environ.

2016-03-27 Thread Chris Angelico
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

Re: Calling the source command from subprocess.popen to update the os.environ.

2016-03-27 Thread Oscar Benjamin
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

Re: Calling the source command from subprocess.popen to update the os.environ.

2016-03-27 Thread Ben Finney
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

Calling the source command from subprocess.popen to update the os.environ.

2016-03-27 Thread Hongyi Zhao
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 '=

Re: Using SSL socket as stdin for subprocess.Popen

2016-03-22 Thread dieter
> 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

Re: Using SSL socket as stdin for subprocess.Popen

2016-03-21 Thread Chris Angelico
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

Using SSL socket as stdin for subprocess.Popen

2016-03-21 Thread Matt Ruffalo
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

Re: Opening PDF Using subprocess.Popen Failing

2015-06-22 Thread Naftali
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

Re: Opening PDF Using subprocess.Popen Failing

2015-06-22 Thread Naftali
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

Re: Opening PDF Using subprocess.Popen Failing

2015-06-22 Thread Laura Creighton
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

Re: Opening PDF Using subprocess.Popen Failing

2015-06-22 Thread Naftali
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

Re: Opening PDF Using subprocess.Popen Failing

2015-06-22 Thread Robin Becker
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

Re: Opening PDF Using subprocess.Popen Failing

2015-06-22 Thread Robin Becker
. 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

Re: Opening PDF Using subprocess.Popen Failing

2015-06-20 Thread Naftali
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

Re: Opening PDF Using subprocess.Popen Failing

2015-06-19 Thread Naftali
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

Re: Opening PDF Using subprocess.Popen Failing

2015-06-19 Thread Laura Creighton
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

Opening PDF Using subprocess.Popen Failing

2015-06-19 Thread Naftali
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

Re: subprocess.Popen zombie

2015-05-21 Thread Ian Kelly
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

Re: subprocess.Popen zombie

2015-05-20 Thread Thomas Rachel
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

Re: subprocess.Popen zombie

2015-05-20 Thread Robin Becker
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

Re: subprocess.Popen zombie

2015-05-20 Thread Alain Ketterlin
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

Re: subprocess.Popen zombie

2015-05-20 Thread Cecil Westerhof
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

subprocess.Popen zombie

2015-05-20 Thread 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', '-l100', '-d75']).pid the mybeep script handles module loading if req

Re: bufsize must be an integer in subprocess.Popen

2015-02-23 Thread Chris Angelico
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

Re: bufsize must be an integer in subprocess.Popen

2015-02-23 Thread INADA Naoki
> 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) &

Re: bufsize must be an integer in subprocess.Popen

2015-02-23 Thread Shgck
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("

Re: bufsize must be an integer in subprocess.Popen

2015-02-23 Thread INADA Naoki
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

bufsize must be an integer in subprocess.Popen

2015-02-23 Thread Robert Clove
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

Re: subprocess.Popen instance hangs

2013-08-30 Thread Tim Johnson
* 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

Re: subprocess.Popen instance hangs

2013-08-30 Thread Tim Johnson
* 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

Re: subprocess.Popen instance hangs

2013-08-30 Thread Jerry Hill
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)

Re: subprocess.Popen instance hangs

2013-08-30 Thread Nobody
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

Re: subprocess.Popen instance hangs

2013-08-29 Thread Tim Johnson
* 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

Re: subprocess.Popen instance hangs

2013-08-29 Thread Tim Johnson
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

Re: subprocess.Popen instance hangs

2013-08-29 Thread xDog Walker
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

RE: subprocess.Popen instance hangs

2013-08-29 Thread Prasad, Ramit
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

Re: subprocess.Popen instance hangs

2013-08-29 Thread MRAB
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

subprocess.Popen instance hangs

2013-08-29 Thread 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 hang. It should be no surprise as drush outpu

Re: newbie question about subprocess.Popen() arguments

2013-05-23 Thread Alex Naumov
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

Re: newbie question about subprocess.Popen() arguments

2013-05-23 Thread Peter Otten
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   2   3   4   5   6   >