Hello,
Iâm having trouble trying to pass a variable into
re.compile(), using the ârâ option. Letâs say I
have the following:
import re
arg1 = â10â
p = re.compile(r + arg1 + '\.(\d+\.\d+\.\d+)')
This works if I do:
p = re.compile(r â10\.(\d+\.\d+\.\d+)')
Is there
Hello,
I'm trying to replace some strings in a line of text,
using some regex functions. My question is: If there's
more then one regex grouping I want to replace in one
line of a file, how can I use the String Formatting
operator (%s) in two places?
Here's the line it matches in the file:
Her
Hi Kent,
Sorry I didn't make my question clearer. Bascially I
want to replace this line:
With:
So the regex grouping are that I want to keep
portNumber= and tcpORudp= and replace the values.
Which will be varibles in my code.
The question is more on the string formatting in the
replace. Ho
Hello,
I'm trying to start a shell script from my python
script using os.spawnlp. But I'm not getting msgs from
stderr. I thought that I could use popen2/popen3 to
replace os.spawnlp but I'm having problems with syntax
and how to do this. Can someone point me in the right
direction? Here's my orig
Hello,
I'm trying to start a shell script with 4 arguments
from my python script. I'm having problems trying to
figure out the best way to do this. I'm using
variables as the arguments to the shell script. I want
to use popen3 to keep track of stdin, stdout, and err,
but from the docs I only see u
Thank you, Alan! I'll try using POPEN.
Jerome
--- Alan Gauld <[EMAIL PROTECTED]> wrote:
> > I'm trying to start a shell script with 4
> arguments
> > from my python script. I'm having problems trying
> to
> > figure out the best way to do this.
>
> Use a format string:
>
> cmd = "myscript %s
Hi,
I've been trying to write a wrapper around some shells
scripts using the subprocess module. But I'm getting
errors I quite don't know how to debug. I've only been
writing Python for a few months and starting processes
are new to me. Here's my code:
import os
import re
import subprocess
#
Hi Bo,
Jerome Jabson åé:
> Hi,
>
> I've been trying to write a wrapper around some
shells
> scripts using the subprocess module. But I'm getting
> errors I quite don't know how to debug. I've only
been
> writing Python for a few months and starting
pro
Hi Bo,
Thank you very much for all your help!! But I'm having
some problems with the line of code you recommended:
if isinstance(cmd, types.StringTypes):
cmd = cmd.split(' ')
I'm getting the following error:
NameError: global name 'types' is not defined
As you instructed, I put in the
Hello,
I'm running a Java process from my python script using
the subprocess module. But there seems to be some
problem with the return code to subprocess and the
Java program is just hanging waiting for something. If
I run the Java program from shell it terminates
normally and if run the same pro
10 matches
Mail list logo