how I can make clickable or executable python file in linux.

118 views
Skip to first unread message

Jung Hun

unread,
May 19, 2015, 8:59:51 PM5/19/15
to python_in...@googlegroups.com
Hello,

I was trying to make clickable python file in linux. but it does not work for some reason.

I made test.py file and wrote down like below.
 
#!/usr/local/bin/python
print "this is test"
raw_input()

and I did chmod 777 test.py and also chmod +x test.py in the shell.
and when I double clicked it in file manager which is dolphin, it does not happen anything.

my system is
System:  Fedora release 13 (Goddard)
KDE:  4.5.5 (KDE 4.5.5)

thanks for your help in advance.
-Jun


Justin Israel

unread,
May 19, 2015, 10:05:36 PM5/19/15
to python_in...@googlegroups.com
Hi,

Is your expectation that double clicking an executable python script would result in a terminal window being popped up? That isn't what is happening here. Most likely what you are getting is your python process not ending, because it is sitting on input from stdin, which it never gets.  See what happens after you double click the file, and then run this in a terminal:

$ ps aux | grep test

My guess is you will see these processes hanging around, until you kill it. 

Justin


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/55eb2e80-1e0f-4eb3-9e54-7ea8afcc11f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jung Hun

unread,
May 20, 2015, 12:01:33 PM5/20/15
to python_in...@googlegroups.com
Hello Justin,

thanks for the reply

my goal is pyqt window being popped up with double clicking in file browser like the other software without typing python command in the shell.

this is the video that I was following. but it did not work for me.
https://www.youtube.com/watch?v=d5NuWrOcZt4

and what is the best way to do this?

cheers,
-Jun



On Tuesday, 19 May 2015 19:05:36 UTC-7, Justin Israel wrote:
Hi,

Is your expectation that double clicking an executable python script would result in a terminal window being popped up? That isn't what is happening here. Most likely what you are getting is your python process not ending, because it is sitting on input from stdin, which it never gets.  See what happens after you double click the file, and then run this in a terminal:

$ ps aux | grep test

My guess is you will see these processes hanging around, until you kill it. 

Justin


On Wed, May 20, 2015 at 12:59 PM Jung Hun <jun.j...@gmail.com> wrote:
Hello,

I was trying to make clickable python file in linux. but it does not work for some reason.

I made test.py file and wrote down like below.
 
#!/usr/local/bin/python
print "this is test"
raw_input()

and I did chmod 777 test.py and also chmod +x test.py in the shell.
and when I double clicked it in file manager which is dolphin, it does not happen anything.

my system is
System:  Fedora release 13 (Goddard)
KDE:  4.5.5 (KDE 4.5.5)

thanks for your help in advance.
-Jun


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

Daniel Lindsey

unread,
May 25, 2015, 5:04:11 PM5/25/15
to python_in...@googlegroups.com
Hey Jung,
I think the issue is that in KDE, you can associate default applications for file types.
On my system, it seemed to default to emacs (my editor of choice), I was able to change this
in the system settings, and make python the default app to launch.  However
this may not be very useful to you if you are trying to make this work in a production
environment as everyone may have their default apps set to apps other than python.

Hope this is at least a bit of help for you.

-Daniel
Reply all
Reply to author
Forward
0 new messages