Windows subprocess.call problem

Tom Borkin borkintom at gmail.com
Mon Jan 21 06:25:06 EST 2013


Hi;
I have this code:

#!/Python27/python
import os, subprocess, sys
lyrics_path = "/Users/Tom/Documents/lyrics"
os.chdir(lyrics_path)

songs = ['livin-la-vida-loca', 'whos-that-lady']
for song in songs:
  subprocess.call(['notepad.exe', '%s.txt' % song])
my_songs_path = "aa english lyrics"
os.chdir(my_songs_path)
for song in my_songs:
  subprocess.call(['notepad.exe', '%s.txt' % song])
  print song

It opens the first song and hangs on subsequent songs. It doesn't open the
next song or execute the print until I have closed the first one. I want it
to open all in the list, one after another, so I have all those songs
available. Please advise.
TIA,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130121/702c975e/attachment.html>


More information about the Python-list mailing list