[Tutor] How to pass a python variable to subprocess.call?

2010-10-25 Thread Sean Carolan
I'm rewriting a bunch of my bash scripts to get some python practice. There are some instances where python doesn't have the built-in text processing that I need, so I'm using subprocess.call. How can I pass a python variable to these subprocesses? For example: mydir = /usr/local/bin

Re: [Tutor] How to pass a python variable to subprocess.call?

2010-10-25 Thread Abhijeet Rastogi
On Tue, Oct 26, 2010 at 3:31 AM, Sean Carolan scaro...@gmail.com wrote: I'm rewriting a bunch of my bash scripts to get some python practice. There are some instances where python doesn't have the built-in text processing that I need, so I'm using subprocess.call. How can I pass a python

Re: [Tutor] How to pass a python variable to subprocess.call?

2010-10-25 Thread Bill Campbell
On Mon, Oct 25, 2010, Sean Carolan wrote: I'm rewriting a bunch of my bash scripts to get some python practice. There are some instances where python doesn't have the built-in text processing that I need, so I'm using subprocess.call. How can I pass a python variable to these subprocesses? For

Re: [Tutor] How to pass a python variable to subprocess.call?

2010-10-25 Thread Steve Willoughby
On 25-Oct-10 15:19, Abhijeet Rastogi wrote: subprocess.call(ls -l +mydir,shell=True) will do the job. In python, we can simply concatenate the strings like that. How do I replace /usr/local/bin in the subprocess call with the mydir variable? It's often preferable (for reasons ranging