Spawn/Exec with asterisk in argument

jeremyfee at gmail.com jeremyfee at gmail.com
Thu Apr 19 15:29:35 EDT 2007


On Apr 18, 7:24 pm, Michael Hoffman <cam.ac... at mh391.invalid> wrote:

> If you want to process asterisk the way the shell does, you can pass
> things through the shell. os.system is one way of doing that. Probably
> better is:
>
> subprocess.check_call("ls -l *", shell=True)

Thanks for the reply Michael.  I used ls as a simple example, but I'm
using this with scp to transfer files and need shell expansion.  It
makes sense since the shell isn't spawning the process, but it's been
a while since I've worked with ipc.  I had converted to os.system
before posting, but subprocess gives me more control than I originally
hoped for

Thanks again




More information about the Python-list mailing list