0

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?

2
  • Do you want to create an installer for OSX, or just asking how to create an installer for a program you wrote in OSX? Commented Jun 5, 2013 at 9:20
  • installer for a program I have written in OSX :) Commented Jun 5, 2013 at 9:38

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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..
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..
0

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

Know what the recipe for creating a app for OSX that is run-forever and has no interface? (i.e. a TCPServer)?
can you be a little bit more clear?? is this pyinstaller is something what you were asking???
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 :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.