[Tutor] how to open a file using os.system
Tiger12506
keridee at jayco.net
Wed Jan 9 22:03:53 CET 2008
> hi
>
> i am developing a GUI application using TKINTER
>
> i want to open a file from the askopenfile(which is a tkFileDialog) using
> OS.SYSTEM.
>
> i have already created the file open dilog using
> tkFileDialog.askopenfile(parent=root,mode='rb',title='choose a file')
> Now i want to open a file from this dialog using OS.SYSTEM
I am not completely familiar with tkFileDialog but I would bet that it
returns the file you choose as a string. Try this.
fn = tkFileDialog.askopenfile(parent=root,mode='rb',title='choose a file')
os.system(fn)
Note: This means open a file as explorer.exe would open a file, such as an
executable
More information about the Tutor
mailing list