How to open a PDF file in python

Hi…today i found how to open a PDF file in python..it’s so easy to open the PDF file in python..

import os
os.system(' /usr/bin/gnome-open  /home/mydirectory/filename.pdf')

output :

Thats it….Thanks….

Author: Balaji

Hi..My name is Balaji and i am working as a Senior Software Developer in India. I am interested in Shell scripts, python, erlang , linux kernel .

2 thoughts on “How to open a PDF file in python”

  1. Hello
    1 when i use this code the cmd also opened. hoe can i open just pdf without the cmd?
    2 how can i open several pdf ?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: