Ask Your Question

set default application to a terminal command?

asked 2018-12-10 14:32:05 -0500

Hi, I have a .py file I am trying to open. I can open it with the terminal with python, but I want to set python (filename) as the default for .py files. Is there a way to do this? I'm running fedora workstation 29, btw.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-12-10 18:36:46 -0500

fcomida gravatar image

Use a shebang

Put #!/usr/bin/env python3 at the beginning of your python script and make it executable: chmod +x You can now run it this way:

$ ./

or just:


if it's in your PATH

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2018-12-10 14:32:05 -0500

Seen: 82 times

Last updated: Dec 10 '18