Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening pdf file

Tags:

python

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?

like image 909
Aleksa Avatar asked Oct 18 '13 15:10

Aleksa


People also ask

Why can't I open a PDF file on my computer?

Here are some of the most common culprits to consider: Your laptop doesn't have a PDF reader installed. Your PDF reader or preferred program is out of date and needs an update. Your PDF application is potentially damaged or needs to be rebooted.

How do I open PDF files for free?

Your Web Browser Web browsers like Google Chrome, Firefox, and Safari all have integrated PDF readers. To view a PDF on your browser, all you have to do is click on the PDF link. You can also open PDF files that are already stored on your computer by dragging them to an open tab in your browser.

How do I open a PDF without Adobe?

Google Chrome can function as your default local PDF viewer, too. Right-click your PDF, and select Properties. Select Change, followed by Google Chrome. Then select Apply.


1 Answers

Try:

import subprocess subprocess.Popen([file],shell=True) 
like image 59
Daniel Wärnå Avatar answered Sep 20 '22 05:09

Daniel Wärnå