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 Lead Developer in India. I am interested in Shell scripts, python, erlang , linux kernel , Machine Learning.

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 comment