![]() Registered Member ![]()
|
Hi, how can I execute a python script doubleclicking on it? i tried to make it executable by typing
I added
at the beginning of the file (i tried also env python3, pithon, env python), but I still can't open it with a doubleclick... if i right click it and select 'open with' and search for python, no result appears. but python 3 is installed, and if in a terminal I type
it works i don't know what to do, please help me! ![]() thank you in advance! |
![]() Registered Member ![]()
|
The first time I tried this on a python script (that contained the line you mention, plus had the execute permission set), Dolphin asked if I wanted to execute the file. This dialog also contained an option if "Do not ask again". After selecting this, from then on, double-clicking the file ran the script (or any python script). Question, will your script run from the command line without first typing 'python3', in other words, just:
Currently running KDE Neon 5.22.5 and 5.19.4 (with Windows 10 in a VM); migrated from Linux Mint 17.3
|
![]() Registered Member ![]()
|
sorry, I completely forgot to answer to this topic! yes, typing just the name works, and doubleclicking does open the "do not ask again" window, but if in this window I select execute, it just open the text editor (which is the default program to open), the only way I found to execute it clicking on it is assigning it python as the default program to open it, so I'm not executing it, but opening it with the interpreter is it normal this behaviour? or there is something messed up in my settings? ![]() bye! |
Registered users: bartoloni, Bing [Bot], Google [Bot], q.ignora, watchstar