Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there an GUI libraries for Python that allow you to compile to an EXE (windows) and APP(Mac)?

I'm working on an application that I need to be cross-platform. I'd like to use Python for it, and am looking for GUI toolkits that make interface programming simple and easy. After a slight hunt, I found PythonCard. This looks like it fits the bill perfectly, but I'm not sure if it will be possible to compile this down to an appropriate executable for each operating system. I found these instructions, but they're 6 years old.

Whatever solution I choose must support the following:

  • Write one GUI to work on both Windows and Mac OSX
  • Must 'compile' into an easily distributable file for both windows/mac
  • Compiled file must not require Python to be installed on the users computer

Can anyone recommend a library/solution before I have to wade into the desolate world of Java?

like image 915
Mike Trpcic Avatar asked Aug 30 '10 20:08

Mike Trpcic


2 Answers

I think the answer here is less about the particular GUI toolkit and more about distributing stand-alone python applications. Personally, I've found the tools for this a little less perfect than I'd like but, after some finagling, they get the job done. The most likely candidate that'd fit your needs is cx_Freeze. Though there's a Windows specific py2exe and Mac specific py2app that might fill the bill if cx_Freeze is insufficient.

like image 190
Rakis Avatar answered Sep 19 '22 08:09

Rakis


Use PyInstaller to distribute an app using PyQt or WxPython gui toolkits. From the website:

PyInstaller is a program that converts (packages) Python programs into stand-alone executables, under Windows, Linux, and Mac OS X.

As for gui toolkits, PyInstaller is documented to work with Qt3, Qt4, and WxPython.

StackOverflow contributor dF, uses PyInstaller "for an app which depends on PyQt, PyQwt, numpy, scipy and a few more."

like image 21
Steven Rumbalski Avatar answered Sep 22 '22 08:09

Steven Rumbalski