Oct-02-2025, 06:39 PM
(This post was last modified: Oct-03-2025, 05:20 PM by Tycho_2025.)
Dear forum members,
I use Linux Mint Cinnamon 22.2 with Python 3.12.3
I have this simple script myscripy.py:
I would like to run the scrip by double clicking, like I would in windows.
What I would like to happen if I double click the file:
a console opens and the text 'Hello World!' and 'press enter to exit' appears.
The program runs, but the console does not open, so I can't see the ouput of a print command.
I tried several things:
If I create a launcher with the command
$ python3 ./myscript.py
the console does not open.
If I run the script from the terminal
$ python3 ./myscript.py
the console opens with the text.
If I run the script from Visual Studio Code, the console also opens showing the text.
But I prefer to double click.
When I googled I found posts suggesting the st.out buffer needs to be flushed.
So I tried to use header
Does anyone has a suggestion?
I use Linux Mint Cinnamon 22.2 with Python 3.12.3
I have this simple script myscripy.py:
#!/usr/bin/python
print('Hello World!')
input('press enter to exit')The file is executable.I would like to run the scrip by double clicking, like I would in windows.
What I would like to happen if I double click the file:
a console opens and the text 'Hello World!' and 'press enter to exit' appears.
The program runs, but the console does not open, so I can't see the ouput of a print command.
I tried several things:
If I create a launcher with the command
$ python3 ./myscript.py
the console does not open.
If I run the script from the terminal
$ python3 ./myscript.py
the console opens with the text.
If I run the script from Visual Studio Code, the console also opens showing the text.
But I prefer to double click.
When I googled I found posts suggesting the st.out buffer needs to be flushed.
So I tried to use header
#!/usr/bin/python -uAnd I also tried to use
print('Hello World!', flush=True)but still the console does not open.Does anyone has a suggestion?
