Skip to content
Advertisement

Opening pdf file

I wanna open pdf file from python console, I can do it with os.system(filename), it will open in adobe reader, but the problem is that os.system also opens a command prompt, is there another way that won’t open command prompt?

Advertisement

Answer

Try:

import subprocess
subprocess.Popen([file],shell=True)
Advertisement