0

Possible Duplicate:
Run python script without DOS shell appearing
How do I hide the console when I use os.system() or subprocess.call()?

I need to make a Python2.2 program to close a process. The problem is that I do not want the user to see the CMD window. Is it possible?

import os
os.system("taskkill /im injector* /f")
os.system("taskkill /im *injector /f")
Community
  • 1
  • 1
  • 1
    related: [How do I hide the console when I use os.system() or subprocess.call()?](http://stackoverflow.com/q/7006238/4279) – jfs Jan 29 '13 at 00:46

1 Answers1

0

Try using subprocess module, samples are here

You need to specify shell=True Something like:

subprocess.call("taskkill.exe /im injector* /f", shell=True)

will not show console window.

Don't forget to

import subprocess
Vahid Farahmand
  • 2,528
  • 2
  • 14
  • 20