Q:

Equivalent of os.system without a console window?

I have a line that I can use it with os.system like;
os.system("ffmpeg -i file.smh -acodec libmp3lame file.mp3")

Where ffmpeg is an exe file. But It creates a console window on the screen. Normally I hide the console window by the following:
import win32console,win32gui

win = win32console.GetConsoleWindow()
win32gui.ShowWindow(win,1)

I tried this but it didn't work. os.system still shows me the console window. So I have two options:

I need a way to hide the console window if I use os.system.
Or I need a subprocess equivalent of os.system.

I tried to use subprocess.Popen(["ffmpeg.exe -i file.smh -acodec libmp3lame file.mp3"]), but it can't find ffmpeg.exe. 
How can I fix this?

A:

subprocess.Popen(["ffmpeg.exe -i file.smh -acodec libmp3lame file.mp3"])
should be:
subprocess.Popen(["ffmpeg.exe", "-i", "file.smh", "-acodec", "libmp3lame file.mp3"])

The way you hade it, your OS will look for an executable named ffmpeg.exe -i ... rather than an executable named ffmpeg with -i, file.smh, ... as arguments
If splitting the arguments is problematic for some reason, you can use shlex.split to correctly split the arguments for you (It'll handle splitting quoted arguments correctly).

