0

I have full path of some pdf files which are in different directories and I want to show those files in one Window from where user can click and open them by and document viewer.

Since I'm new to python and QtGUI, I am unable to figure out how to do this. Here is something that i had seen but unable to figure out how it is happening. When I run it, shows folder hierarchy , but instead of that i just want to show files of which i have complete path.

Thanks in advance.

Community
  • 1
  • 1
vaibhav1312
  • 863
  • 4
  • 13
  • 31

1 Answers1

1

This code was working for me

import subprocess
import os
import sys
files = ['/home/test/kelvin/refresh.html','/home/test/kelvin/thread.html']
print list(enumerate(files))
no=raw_input("enter the file no\n")
no1 = int(no)
if sys.platform == 'linux2':
    subprocess.call(["xdg-open", files[no1]])
else
    os.startfile(files[no1])
kelvin
  • 149
  • 7
  • Thanks kelvin, xdg-open solved my problem.Initially I wanted to make a window to display files in separately , but since I have the the file path I can open them with "xdg-open" – vaibhav1312 Feb 24 '13 at 17:38