I have a python script written to run on a system in our office which runs CentOS. It has Python2.6.6 installed by root user and hence I don't have access to install pip or any other tool. My goal is to create a standalone executable such that users shall be able to run the python script without the hassle of writing commands and running it from the terminal. Here's the script
import Tkinter as tk
global root
def file_download():
root.withdraw()
# download functionality code
root.deiconify()
def file_upload():
root.withdraw()
# upload functionality code
root.deiconify()
def sim_dialog():
global root
root = tk.Tk()
root.title('Sample file manager')
root.resizable(0, 0)
dwnld = tk.Button(root, text="Download", width=10, command=file_download)
dwnld.pack(expand=0, padx=90, pady=10)
upld = tk.Button(root, text="Upload", width=10, command=file_upload)
upld.pack(expand=0, padx=90, pady=10)
root.mainloop()
sim_dialog()
Just like windows, double click should launch the application. After checking some forums added shebang line #!/usr/bin/env python2.6 in my script but nothing happens.
Please help me figure out (one of the below)
- Correct shebang line
- Create standalone executable for CentOS. Please note I don't have root access and hence I can't install pip or any other tools or libraries.
- Create standalone executable for CentOS using Python on Windows. I'm free to do anything on windows as I have successfully created virtual environment.
Thanks in advance for the help and please let me know if any more information is required.
I've been suggested to create desktop shortcut
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false # true if it's a terminal application
Exec=/home/user001/Desktop/sim_dialog.py # or just the name, e.g. polo-gtk
Name=sim_dialog
Comment=
Icon=
Ran this desktop shortcut with and without shebang line. Doesn't work in both the cases.