On 10/21/23 07:01, Larry Martell via Python-list wrote:
I have a python script, and from that I want to run another script in
a subprocess in a venv. What is the best way to do that? I could write
a file that activates the venv then runs the script, then run that
file, but that seems messy. Is
On 10/21/2023 11:32 AM, Larry Martell via Python-list wrote:
On Sat, Oct 21, 2023 at 9:49 AM Johannes Findeisen wrote:
On Sat, 21 Oct 2023 09:01:18 -0400
Larry Martell via Python-list wrote:
I have a python script, and from that I want to run another script in
a subprocess in a venv. What
rry Martell via Python-list wrote:
> > >
> > > > I have a python script, and from that I want to run another
> > > > script in a subprocess in a venv. What is the best way to do
> > > > that? I could write a file that activates the venv then
I want to run another
> > > script in a subprocess in a venv. What is the best way to do
> > > that? I could write a file that activates the venv then runs the
> > > script, then run that file, but that seems messy. Is there a
> > > better way?
> >
> > H
On Sat, Oct 21, 2023 at 9:49 AM Johannes Findeisen wrote:
>
> On Sat, 21 Oct 2023 09:01:18 -0400
> Larry Martell via Python-list wrote:
>
> > I have a python script, and from that I want to run another script in
> > a subprocess in a venv. What is the best way to do t
Larry Martell via Python-list schreef op 21/10/2023 om 15:01:
I have a python script, and from that I want to run another script in
a subprocess in a venv. What is the best way to do that? I could write
a file that activates the venv then runs the script, then run that
file, but that seems messy
On Sat, 21 Oct 2023 09:01:18 -0400
Larry Martell via Python-list wrote:
> I have a python script, and from that I want to run another script in
> a subprocess in a venv. What is the best way to do that? I could write
> a file that activates the venv then runs the script, then run th
I have a python script, and from that I want to run another script in
a subprocess in a venv. What is the best way to do that? I could write
a file that activates the venv then runs the script, then run that
file, but that seems messy. Is there a better way?
--
https://mail.python.org/mailman
Hello!
I'm trying to run a subprocess (actually several), and control
their terminals (not just stdin and stdout). I have a use case,
but I won't bore everyone with those details.
I'd rather not use pexpect or ptyprocess, because those expose a
very different interface than Pope
On Tuesday, May 30th, 2023 at 10:18 PM, Chris Angelico wrote:
> Yep, what you're seeing there is the namespace and nothing else. But
> if you mess with an actual builtin object, it'll be changed for the
> other interpreter too.
>
> > > > import ctypes
> > > > ctypes.cast(id(42), ctypes.POINTER(cty
On Wed, 31 May 2023 at 12:03, James Schaffler via Python-list
wrote:
>
> On Tuesday, May 30th, 2023 at 9:14 PM, Greg Ewing wrote:
> > Globals you create by executing code in the REPL have their own
> > namespace. But everything else is shared -- builtins, imported
> > Python modules, imported C ex
On Tuesday, May 30th, 2023 at 9:14 PM, Greg Ewing wrote:
> Globals you create by executing code in the REPL have their own
> namespace. But everything else is shared -- builtins, imported
> Python modules, imported C extension modules, etc. etc.
Thanks for the explanation. Could you elaborate on p
CPython is structured makes that very difficult to achieve,
and as far as I know it's not there yet.
In the case of IDLE, there's really no reason not to use a
subprocess[1]. It's easy and guarantees 100% isolation.
[1] Well, mostly. There used to be a small hitch on Windows with
the defa
On Wed, 31 May 2023 at 08:16, Barry wrote:
> I don’t think it security but robustness that needs the subprocess.
>
> Also if your code use tk then it would conflict with idle’s use of tk.
>
From my memory, it's precisely this - it's much MUCH easier to allow
you to use
uses
> executes user code in a "subprocess" that's separate from the Python
> interpreter that is running IDLE itself (which does tasks such as making the
> window and coloring the text).
>
> As far as I understand, IDLE runs a modified version of
> code.InteractiveIn
Originally posted to idle-dev, but thought this might be a better place. Let me
know if it isn't.
Hi,
I was curious about the internals of IDLE, and noticed that IDLE uses executes
user code in a "subprocess" that's separate from the Python interpreter that is
running IDL
On 1/9/23, c.bu...@posteo.jp wrote:
>
> On Python for Windows what is the appropriate way how a process can call
> itself again?
>
> Let me give you an example [1]:
> There is a project "bitcli" having two entry points
>
> [project.scripts]
> bitcli = "bitcli.__main__:main"
> bitcli-root = "bitcli
Dear Eryk,
Am 08.01.2023 17:22 schrieb Eryk Sun:
Avoid using any of the `os.exec*` functions on Windows. There's no
support for replacing a Windows process image, so the `exec*()`
functions simply spawn a child process and terminate the current one.
Thanks for bringing this up.
On Python for
On 1/8/23, c.bu...@posteo.jp wrote:
>
> is there an equivalent in the subprocess module for "os.execvp()" to
> replace the current process with the new called one?
A note for Windows users
Avoid using any of the `os.exec*` functions on Windows. There's no
support for rep
On Sun, 8 Jan 2023 at 21:51, wrote:
>
> Hello,
>
> is there an equivalent in the subprocess module for "os.execvp()" to
> replace the current process with the new called one?
It won't make a subprocess, so no. It's in the os module - under the
name exec
Hello,
is there an equivalent in the subprocess module for "os.execvp()" to
replace the current process with the new called one?
Kind
Christian
--
https://mail.python.org/mailman/listinfo/python-list
On 9/20/22 09:36, asika wrote:
Sent from [1]Mail for Windows
References
Visible links
1. https://go.microsoft.com/fwlink/?LinkId=550986
dunno if you were trying to send screenshots or something, that doesn't
work here.
Try:
https://docs.python.org/3/libra
Sent from [1]Mail for Windows
References
Visible links
1. https://go.microsoft.com/fwlink/?LinkId=550986
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Dec 15, 2021 at 08:19:16PM -0800, Kushal Kumaran wrote:
> On Wed, Dec 15 2021 at 09:38:48 PM, Jason wrote:
> > Hello,
> >
> > How can I find out the exit code of a process when using the
> > subprocess module? I am passing an email message to a shell script and
On Wed, Dec 15 2021 at 09:38:48 PM, Jason wrote:
> Hello,
>
> How can I find out the exit code of a process when using the
> subprocess module? I am passing an email message to a shell script and
> I need to know whether the shell script threw an error.
>
> Here is my
Hello,
How can I find out the exit code of a process when using the subprocess module?
I am passing an email message to a shell script and I need to know whether the
shell script threw an error.
Here is my code:
p = Popen(cmd, stdout=None, stdin=PIPE, stderr=None)
p.communicate(input=msg)
I
ext of any error messages you get.
BTW, it's important to cut and paste TEXT - don't just send screenshots.
Good luck.
On Tue, Nov 23, 2021 at 8:03 AM wrote:
>Hello,
>
>
>
>I have been 3.8.10 version of python until I ran the code for tkinter
> and
>
Hello,
I have been 3.8.10 version of python until I ran the code for tkinter and
I started getting subprocess connection error. After this I haven’t been
able to open python for use as I get this error upon startup.
Please help resolve the matter soon.
Best
On 17/10/20 4:04 pm, Dave Dungan wrote:
One more thing, the book says to save it as "types.py".
Which is probably a bad thing to do, because there is a built-in
module called "types" that this will shadow. If IDLE happens to
use that module, bad things could happen.
Have you tried using a diff
On 10/17/2020 5:00 PM, Dan Stromberg wrote:
Does this help?
https://stackoverflow.com/questions/29567051/python-error-idles-subprocess-didnt-make-connection-either-idle-cant-start
I believe I included every legitimate answer on stackoverflow, including
that post, in the doc section linked
Does this help?
https://stackoverflow.com/questions/29567051/python-error-idles-subprocess-didnt-make-connection-either-idle-cant-start
On Sat, Oct 17, 2020 at 12:44 PM Dave Dungan via Python-list <
python-list@python.org> wrote:
> Hello,
>
> I bought a book called Coding f
Hello,
I bought a book called Coding for Beginners to learn how to code using Python.
The first few exercises went fine. When I got to the page called Recognizing
types and did the exercise and saved it and tried to run the module it comes up
with a Subprocess Connection Error. It says
Version 0.1.6 of Sarge, a cross-platform library which wraps the subprocess
module in the standard library, has been released.
What changed?
-
- Fixed #44: Added an optional timeout to Command.wait() and Pipeline.wait(),
which
only takes effect on Python >= 3.3.
- Fixed
> On 18 May 2020, at 21:50, Dick Holmes wrote:
snip
> Per Peter's suggestion I tried readline and it works "as expected". I
> also discovered that the reason the read operations were stalling was
> that they followed a write and the write doesn't actually occur until
> "flush" is called ev
pexpect
>
> https://pexpect.readthedocs.io/en/stable/index.html
>
> does this naturally, but I don't know if Windows support is sufficient for
> your needs.
>
> > I've looked at various mechanisms and the
> > class that seems to fit my needs is Popen in t
pexpect
>
> https://pexpect.readthedocs.io/en/stable/index.html
>
> does this naturally, but I don't know if Windows support is sufficient for
> your needs.
>
> > I've looked at various mechanisms and the
> > class that seems to fit my needs is Popen in t
On 5/13/2020 11:13 PM, Dick Holmes wrote:
https://occovid19.ochealthinfo.com/coronavirus-in-oc I'm trying to
communicate using a continuing dialog between two
processes on the same system
Try multiprocessing and pipes.
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-lis
#x27;t know if Windows support is sufficient for
your needs.
> I've looked at various mechanisms and the
> class that seems to fit my needs is Popen in the subprocess module, but
> I can't seem to get more than a single round-trip message through Popen.
> I first call Popen
https://occovid19.ochealthinfo.com/coronavirus-in-oc I'm trying to
communicate using a continuing dialog between two
processes on the same system. I've looked at various mechanisms and the
class that seems to fit my needs is Popen in the subprocess module, but
I can't seem to
In comp.lang.python, lampahome wrote:
> what I tried many times like enter password, but it failed.
> I just want to use ps.stdin.write(password) to send password, but it always
> jump password prompt immediately.
Passwords are frequently read from stderr, not stdin, so that tools can
get a huma
On Tue, Sep 17, 2019 at 3:25 PM Cameron Simpson wrote:
> However, I repeat my recommendation to use a keypair for the
> authentication, as it avoids needing interactive passwords (and having
> your programme know the password has its own suite of problems to do
> with where that password comes fro
urity (having a terminal is a proxy for "talking to a human"),
and partly because ssh normally passes stdin to the remote process once
authentication is complete, so things get fiddly.
You can give it a terminal by obtaining a pty and associating the
subprocess with that. You could inst
he far
> end either. You can get ssh to open a remote tty with the -t option.
>
> But I suspect you don't want stdin=PIPE or stdout=PIPE at all. Why are
> they there?
>
> I thought I can use ps.stdin.write(password), so I make stdin and stdout
be pipe as input and output.
On 17Sep2019 12:13, lampahome wrote:
Hello, I use python3.5 and found no way to solve this problem
from subprocess import Popen, PIPE
ps = Popen('ssh -o \'StrictHostKeyChecking no\' hello@192.168.80.11 \'sudo
sysctl -w vm.drop_caches=3\', stdin=PIPE, stdout=PIP
Hello, I use python3.5 and found no way to solve this problem
>from subprocess import Popen, PIPE
>ps = Popen('ssh -o \'StrictHostKeyChecking no\' hello@192.168.80.11 \'sudo
sysctl -w vm.drop_caches=3\', stdin=PIPE, stdout=PIPE, stderr=PIPE,
bufsize=0, shell
Hi all,
First time posting! I need an async context manager that ensures a
Process has finished before it `__exit__()`s, either by graceful or
forceful termination, and regardless of cancellation. I've put my code
at the bottom.
I'm relatively new to asyncio, so I'm looking for feedback on any
as
On 6/17/2019 11:36 AM, Terry Reedy wrote:
On 6/14/2019 11:09 AM, Douglas Beard via Python-list wrote:
Error: IDLE's Subprocess didn't make connection. Either IDLE can't
start a subprocess or personal firewall is blocking the
connection.python has been working fine until to
On 6/14/2019 11:09 AM, Douglas Beard via Python-list wrote:
Error: IDLE's Subprocess didn't make connection. Either IDLE can't start a
subprocess or personal firewall is blocking the connection.python has been
working fine until today. I used the python repair but no luck. it do
Error: IDLE's Subprocess didn't make connection. Either IDLE can't start a
subprocess or personal firewall is blocking the connection.python has been
working fine until today. I used the python repair but no luck. it does not
seem my firewall is blocking. please help
--
https://
ed to the subprocess module.
Where are they?
Here:
https://docs.python.org/3/library/subprocess.html#subprocess.getstatusoutput
--
https://mail.python.org/mailman/listinfo/python-list
utput() have been moved to the subprocess
> module.
>
> Where are they?
Doh, never mind. They were only moved in Python3. I didn't realize
that the "In Python 3.x" qualifier from the beginning of the previous
sentence applied to the entire paragraph.
--
Grant Edwards
I'm trying to update a python2 app to make it python3 compatible. It
uses commands.getstatusoutput(), which according to
https://docs.python.org/2/library/commands.html#commands.getstatusoutput
... getstatusoutput() and getoutput() have been moved to the subprocess module.
Where are
uot;license" for more information.
>>> >1
>> 4
>>> 9
>>> 1>>> 6
>
I found that the pty module might be a solution, also from the helpful comments
in this thread, but I can't find a simple example how to make it work.
regards
Finn
This is my l
On 3/18/2019 9:10 AM, finnkochin...@keemail.me wrote:
I try to start a separate python subprocess using the attached code. This
example should catch all stdout and stderr output from the launched subprocess
and send commands to its stdin.
Subprocess is not intended for interaction. My
> On 15 Mar 2019, at 22:17, Martin De Kauwe wrote:
>
> Hi,
>
> I'm trying to write a script that will make a checkout from a svn repo and
> build the result for the user. However, when I attempt to interface with the
> shell it asks the user for their filename and I don't know how to captur
On 2019-03-18, wrote:
> I try to start a separate python subprocess using the attached
> code. This example should catch all stdout and stderr output from
> the launched subprocess and send commands to its stdin. The problem
> is that the prompt ">>>" asking for
On Tue, Mar 19, 2019 at 2:50 AM wrote:
>
> Hello,
> I try to start a separate python subprocess using the attached code. This
> example should catch all stdout and stderr output from the launched
> subprocess and send commands to its stdin.
> The problem is that the prompt &qu
Hello,
I try to start a separate python subprocess using the attached code. This
example should catch all stdout and stderr output from the launched subprocess
and send commands to its stdin.
The problem is that the prompt ">>>" asking for then next input is neither sent
to s
ut. That allowed their use in a pipeline
> without contaminating the pipe's data with the password prompt and
> password. In "normal" usage /dev/tty and stdin/stdout/stderr are all
> the same device, but when used via a library like subprocess, you
> couldn't provide
On 2019-03-16, dieter wrote:
> Otherwise, you must monitor what it written to the subprocess'
> "stdout" and "stderr", recognized the interaction request
> perform the interaction with the user and send the result
> to the subprocess' stdin.
I don'
ration file.
Otherwise, you must monitor what it written to the subprocess'
"stdout" and "stderr", recognized the interaction request
perform the interaction with the user and send the result
to the subprocess' stdin.
Thanks, I think this solution will work.
import s
; > approach, would be much appreciated. I need to solve this with standard
> > python libs as I'm trying to make this as simple as possible for the user.
>
> That is non-trivial.
>
> Read the "svn" documentation. You might be able to pass in the
> required informatio
Read the "svn" documentation. You might be able to pass in the
required information by other means, maybe an option, maybe
an envvar, maybe via a configuration file.
Otherwise, you must monitor what it written to the subprocess'
"stdout" and "stderr", recognized the interaction request
perform the interaction with the user and send the result
to the subprocess' stdin.
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
I'm trying to write a script that will make a checkout from a svn repo and
build the result for the user. However, when I attempt to interface with the
shell it asks the user for their filename and I don't know how to capture this
with my implementation.
user = "XXX578"
root="https://trac
subprocess: subprocess is limited to pipes (unless you build your own
alternate comms mechanism), whereas multiprocessing takes care of
marshalling python objects and transporting them to the other processes.
This can be huge in some applications, like we were using it to run batch
monte carlo
s are launched independent of
the parent (manager) process?"
I just want to point out that subprocess (which uses the operating system to
start another processes, to run whatever you say - doesn't have to be Python
running another script, can be an .exe) does not have that restriction. The
ipts may end
> up running in parallel. There are no dependencies between individual worker
> scripts. I'm looking for the pros and cons of using multiprocessing or
> subprocess to launch these worker scripts. Looking for a solution that works
> across Windows and Linux. Open to usin
individual worker
scripts. I'm looking for the pros and cons of using multiprocessing or
subprocess to launch these worker scripts. Looking for a solution that works
across Windows and Linux. Open to using a 3rd party library. Hoping to avoid
the use of yet another system component like Cele
info.strip('||')
> print g_info
> print info
> fp.close()
> Error:
> AttributeError: 'Popen' object has no attribute 'read'
You have to specify the stream/file, e. g.
g_info.stdout.read()
but when want both stdout and stderr your rea
r".
> >
> > ChrisA
>
> Yeah, and once you find out you need to go faster and subsequently start
> looking into ways you *can* go faster, you finally end up with code similar
> to what is implemented in the grep family of tools.
>
Maybe... but most likely not using
On Thursday, January 3, 2019 at 9:40:43 PM UTC+1, Chris Angelico wrote:
> On Fri, Jan 4, 2019 at 7:37 AM Mohan Mohta wrote:
> > I am no expert in python but I found grep is lot faster in than the methods
> > of reading files from python point me to direction if you know of
> > anything faste
On Fri, Jan 4, 2019 at 7:37 AM Mohan Mohta wrote:
> I am no expert in python but I found grep is lot faster in than the methods
> of reading files from python point me to direction if you know of
> anything faster I would appreciate it.
>
Try doing things the simple and easy way in Python,
On Thursday, January 3, 2019 at 1:49:31 PM UTC-6, Chris Angelico wrote:
> On Fri, Jan 4, 2019 at 6:46 AM Mohan Mohta wrote:
> >
> > Hello,
> > I am trying to grep the keyword (which I got from report_file ) from
> > report_file
> >
> > I tried multiple ways but am unable to get it to work.
>
> H
Agreeing with the other poster that it's probably not the best way to handle it.
But for the sake of helping with subprocess:
https://docs.python.org/3.7/library/subprocess.html#popen-objects
Popen Objects don't have read() as the error says. That's on their .stdout and
.std
On Fri, Jan 4, 2019 at 6:46 AM Mohan Mohta wrote:
>
> Hello,
> I am trying to grep the keyword (which I got from report_file ) from
> report_file
>
> I tried multiple ways but am unable to get it to work.
How about, instead, you simply open the file and iterate through it,
looking for the keywor
info=g_info.read()
g_info=g_info.strip()
info=g_info.strip('||')
print g_info
print info
fp.close()
Result :
The Code executes but the output is in screen and does not get stored in a
variable.
I am interested if I can achieve the same result with subp
uot; " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'module' is not iterable
--
> I'm currently facing this error while execute another py_script from one
> script.
> and i
gt; On 2018-11-18 14:59, srinivasan wrote:
> > Dear Python Experts Team,
> >
> > As am newbie to python and learning python, working on embedded linux
> > platform, my intention is to delete all the SSID's before connecting my
> > Wi-Fi module to specific SSID.,
g
the "subprocess" with wrapper "execute_cmd_output_string" written on
it described
as below, using the nmcli commands "*nmcli -t -f TYPE,UUID con" and "**"nmcli
connection delete uuid ".*
Could you please help me, what could be the bug in the below met
Dear Python Experts Team,
As am newbie to python and learning python, working on embedded linux
platform, my intention is to delete all the SSID's before connecting my
Wi-Fi module to specific SSID., I am trying to parse command output using
the "subprocess"
On Mon, Nov 12, 2018 at 11:20 PM Anssi Saari wrote:
>
> Chris Angelico writes:
>
> > On Fri, Nov 9, 2018 at 11:11 PM Anssi Saari wrote:
> >>
> >> Chris Angelico writes:
> >>
> >> > No helper needed. Safe against command injection. Uses the known
> >> > format of the command's output; if you wan
ell
>> > as the type, you could get that too.
>>
>> Can someone let me in on this secret helper module? Doesn't seem to
>> match the helper module in PyPI at least.
>>
>
> What helper?
Helper module used in the original post. I assumed you know what it
srinivasan wrote:
> Even after changing as per the below
> "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3"
> or:
> 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3'
> or:
> "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3"
>
> Still my output is:
> */dev/mmcblk1p1: LABEL="efi" UUID="1084
oo.
>
> Can someone let me in on this secret helper module? Doesn't seem to
> match the helper module in PyPI at least.
>
What helper? I said you don't need one. Just use subprocess directly.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
Chris Angelico writes:
> No helper needed. Safe against command injection. Uses the known
> format of the command's output; if you want other information as well
> as the type, you could get that too.
Can someone let me in on this secret helper module? Doesn't seem to
match the helper module in
Many Thanks a lot , I can use for reliably "lsblk %s -n -o FSTYPE" in the
reused code of mine as below
cmd = "lsblk %s -n -o FSTYPE" % partition_path
return self._helper.execute_cmd_output_string(cmd)
I really appreciate for all your support w.r.t this..
I feel I have kick start
srinivasan writes:
> Even after changing as per the below
> "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3"
> or:
> 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3'
> or:
> "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3"
>
> Still my output is:
> */dev/mmcblk1p1: LABEL="efi" UUID="108
On Wed, Nov 7, 2018 at 11:42 PM srinivasan wrote:
>
> Some I managed to fix temporarily as below, might be useful for others. Also
> please correct me if anything wrong or for any improvements in the below
>
> cmd = "blkid -o export %s" % partition_path
> out = self._helper.execut
Some I managed to fix temporarily as below, might be useful for others.
Also please correct me if anything wrong or for any improvements in the
below
cmd = "blkid -o export %s" % partition_path
out = self._helper.execute_cmd_output_string(cmd)
var = out.split("TYPE=", 1)[1]
On Wed, Nov 7, 2018 at 11:36 PM Qian Cai wrote:
>
> srinivasan wrote:
> > Even after changing as per the below
> > "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3"
> > or:
> > 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3'
> > or:
> > "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3"
>
srinivasan wrote:
> Even after changing as per the below
> "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3"
> or:
> 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3'
> or:
> "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3"
>
> Still my output is:
> */dev/mmcblk1p1: LABEL="efi" UUID="1084
Even after changing as per the below
"blkid -o export %s | grep 'TYPE' | cut -d'=' -f3"
or:
'blkid -o export %s | grep "TYPE" | cut -d"=" -f3'
or:
"blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3"
Still my output is:
*/dev/mmcblk1p1: LABEL="efi" UUID="1084-AA42" TYPE="vfat"*
My expected outp
On Wed, 2018-11-07 at 10:22 +0100, srinivasan wrote:
> blkid -o export %s | grep \'TYPE\' | cut -d\"=\" -f3
You don't need to escape the single quotes.
Try either:
"blkid -o export %s | grep 'TYPE' | cut -d'=' -f3"
or:
'blkid -o export %s | grep "TYPE" | cut -d"=" -f3'
or:
"blkid -o export %s | g
x27;TYPE' | cut -d"
> and BETA=" -f3"
>
> Other issues may also be there.
> -Original Message-
> From: Tutor On Behalf Of
> Alan Gauld via Tutor
> Sent: Tuesday, November 6, 2018 7:37 PM
> To: tu...@python.org
> Cc: python-...@python.org
> Subje
On 06/11/2018 18:10, srinivasan wrote:
root:~/qa/test_library# python3 sd.py
File "sd.py", line 99
*cmd = "blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)*
* ^*
*SyntaxError: can't assign to literal*
Look at the 'cut' element of the pipeline. You have used double quotes
Dear Python Experts Team,
As am newbie to python development, I am trying to use the below function
to get verify the filesystem type of the SD card parition using bash
command in python using subprocess module, I ma seeing the below Error
"SyntaxError: can't assign to liter
gt;> well be able to get something that works well enough for your specific
>>> needs - but it's not obvious from your snippet of code what you're
>>> trying to achieve).
>>
>> To send and receive text from a subprocess..even when there are exceptions.
>
it's not obvious from your snippet of code what you're
>> trying to achieve).
>
> To send and receive text from a subprocess..even when there are exceptions.
You can do this without threads on Linux using select (or similar):
https://docs.python.org/3.7/library/select.html#select.select
--
Oscar
--
https://mail.python.org/mailman/listinfo/python-list
On 8/2/2018 3:52 PM, cseber...@gmail.com wrote:
subprocess is not meant for interaction through the pipes. That is why,
I have been told, IDLE uses a socket for interaction. Multiprocess is
apparently better suited for interaction without resorting to a socket.
So use normal socket on
;re
> > trying to achieve).
>
> To send and receive text from a subprocess..even when there are exceptions.
For an arbitrary program as the subprocess? You need some sort of
threading in your process, or maybe some sort of async processing with
non-blocking reads/writes, as you cannot as
1 - 100 of 1881 matches
Mail list logo