Is there any way, under Windows 7, to emulate the behaviour of the & character in OS X's Terminal?
I'm trying to run multiple Wget instances simultaneously: I can do this without any problem of sort under OS X, because I have a Python script which builds a long string, in which each instance of Wget is &-separated. When I execute it with os.system() everything goes fine.
Under Windows, though, this doesn't work, and the instances are run in sequence. Which is not what I want.
I'm open to all suggestions: cmd.exe hacks, shell ports, more Python, anything, as long as new windows shell windows are created. Thanks in advance!

Edit: I've found out that files are in fact downloaded using this method, but under Windows, cmd.exe just ends abruptly the execution, and lets the user accept new commands. Is there any way to avoid this, and keep the console "hanging" until all Wget instances have finished downloading?

Edit 2: posting the code I'm using.

for track in album.tracks():
    tracknum = track["track_num"]
    tracktit = track["title"]
    URL = track["file"]["mp3-128"]
    filename = str(tracknum) + " - " + tracktit + ".mp3"

Now, under OS X, this code work wonderfully.

    execstr += 'bandcamp-support' +os.sep+ 'wget --tries=0 -O"{}" "{}" -q & '.format(filename,URL)
    os.system('bandcamp-support' +os.sep+ 'wget' execstr[:-3])

Under Windows, instead, this doesn't replicate the behaviour that I experience on OS X.

    os.system('start /B bandcamp-support' +os.sep+ 'wget --tries=0 -q -O"{}" "{}"'.format(filename,URL))

If you are a fan of *NIX shells, you can install Cygwin and have access to all those shells and tools with Cygwin. Ot you can just install a Bash shell with Win-Bash. However, I think you would be better off with Cygwin, as it has a lot of functionality.

|improve this answer|||||
  • 1
    Cygwin is interesting, but it requires a lot of DLLs... isn't there a single binary file out there? Or a way to pack it into a binary myself? Now I know why all programmers use Linux/OS X... and why everyone hates Windows. :D – Jetlef Aug 7 '13 at 16:36
  • 1
    I highly recommend Cygwin, worst case you can uninstall it. Its stable and you can get all the *NIX tools you can ever want. Wget isnt part of the base package, you can search for it (get the one under web tools, which is the full application, not the Perl based implementation). – Keltari Aug 7 '13 at 16:48
  • Ah, I give up. Windows' scared another one away. I guess what I want to do can be somehow accomplished using these techniques: Wait the end of subprocesses with multiple parallel jobs, but I'd need to adapt those examples to Windows, and I'm just tired of doing this. – Jetlef Aug 7 '13 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.