The appropriate way to start any process or application via GUI is using a .desktop file. You can also use it to run scripts with sudo privileges. In its simplest form that would be:
[Desktop Entry]
Name=Some Name
Exec=gksu python3 /path/to/script
Type=Application
If the script is executable, you could simply use:
Exec=gksu /path/to/script
In the Exec= -line
important notes
- You need to make the
.desktop file executable to make it work on double- click.
- You can "dress up" the
.desktop file with more options, such as an icon etc., as shown here.
Alternatively
More complicated and kind of a detour, but it should be mentioned nevertheless:
You could set nautilus to run (executable) scripts on double- click, as described here.
Then (doing it "your way"), a separate bash script:
#!/bin/bash
gksu python3 /path/to/script
made executable, would also run the python script, similarly to the .desktop file.