I have some code written in Python designed for Mac OS X - its a TCP server that runs until it gets halted. Any way of making it a standalone application that could be installed easily by a third party? I have seen pyinstaller but not sure about how to build it for something like this need. Any ideas?
-
Do you want to create an installer for OSX, or just asking how to create an installer for a program you wrote in OSX?Burhan Khalid– Burhan Khalid2013-06-05 09:20:23 +00:00Commented Jun 5, 2013 at 9:20
-
installer for a program I have written in OSX :)willwade– willwade2013-06-05 09:38:41 +00:00Commented Jun 5, 2013 at 9:38
Add a comment
|
2 Answers
let it be a python script and add a small gui with it.
from Tkinter import *
import sys
master = Tk()
def callback():
master.destroy()
sys.exit()
b = Button(master, text="Click to close", command=callback)
b.pack()
mainloop()
which will close the running application and you will not have to ctrl+c to close it.. and Tkinter comes with python default.
2 Comments
abhishekgarg
and if you want to distribute it, then you can use the pyinstaller so it will work on computer without python as well.. and yes it will create a single executable(windows) file that can be used anywhere..
abhishekgarg
also you can do it change the myscript.py to myscript.pyw so it will not show the console and will show just the gui..
you can use pyinstaller, I've used it with windows and it works perfectly.
also is you compare other tools like this, pyinstaller is the best because it gives you the ability to create just a single installer instead of a package.
3 Comments
willwade
Know what the recipe for creating a app for OSX that is run-forever and has no interface? (i.e. a TCPServer)?
abhishekgarg
can you be a little bit more clear?? is this
pyinstaller is something what you were asking???willwade
OK so my script does this (for example): python myscript.py --argument1 True --argument2 False And then it runs until you send Ctrl+C to kill the script. What I want to do is create a double clickable app that when run, runs the above command and is killed by hitting the x (close window - or Quit) command. Possible? I doubt it.. So I figured it may be a app that has to be called on the line command. Thing is apps don't get called like that on OSX right? Hope that makes sense. Apologies for any confusion :)