how to open a file with corresponding application from terminal? how to open a file with corresponding application from terminal? tkinter tkinter

how to open a file with corresponding application from terminal?


A repeat of an earlier question, but it's hard to search for if you don't know about the "start" command in windows or "open" on OSX. xdg-open is the Linux desktop equivalent.

https://superuser.com/questions/38984/linux-equivalent-command-for-open-command-on-mac-windows

[Edit] I'm taking the requirement to mean "command picture.jpg" should open in your image viewer, "command song.mp3" should open in the users music player etc. Open from the terminal, not literally in the terminal... If command == xdg-open, it should work.


Refer here Opening File (Tkinter)

In GUI programming, think of the GUI as a tree or a graph. The root is your main GUI window, and within it contains different elements (Labels, Buttons, Images, TextBoxes, etc.), which are your children to your tree.

In order to use tkinter in python:

import tkinter as tkroot = tk.Tk()

A window pops up. that is your root GUI window with nothing in it. If you close this window, the root GUI object will be destroyed.

You can use similar approach for your GUI. See more here http://www.python-course.eu/tkinter_labels.php