- Download Python For Mac Os
- Can You Compile Python
- Python For Mac
- Compile Python To App Mac Youtube
- Python For Mac Os
Nov 28, 2015 Submitting a Python App to the Mac App Store (dafoster.net) PyInstaller - Another tool to create cross-platform standalone apps (libraries like PyQt, Django or matplotlib are fully supported) rumps - Ridiculously Uncomplicated Mac OS X Python Statusbar Apps; py2exe - same as py2app but for Windows.exe files. Sketch Python is a iOS application can do python language editing and operation procedures. Can be used for learning to learn python programming language. Contains the following functions: 1 code editor: syntax highlighting, auto indent 2 automatic complement 3 code is compiled to run: direct local compile operation, does not need the network.
I am on Leopard and trying to use the C/C++ compiler from the command line.
I have Xcode installed and I can compile from Xcode with no problems.
However I would like to be able to simply type in the command line:
% cc (or gcc or whatever) myfile.c
Neither cc or gcc or g++ was found in my PATH so I had to either alias or softlink to the Xcode nstallation which is /Developer/usr/bin/g++
Having done that, I managed to access the compiler, however it then complains about the libraries (can't find <stdio.h> for example).
Even if I try a silly program with no libraries (e.g. main() {} ) the linker returns the error
ld: library not found for -lcrt1.10.5.o
What do I need to set in order to be able to compile from the command line?
I normally use Xcode for any serious program, but I would still be able to access the compiler from the command line occasionally. One example is when I download something that needs to be compiled, like the id3 libraries which I need for a project. I cannot run the configure script because it fails to find the compiler and/or the standard libraries.
Any help would be greatly appreciated
Thanks in advance
/Andrea
Power G5, Mac OS X (10.5.4)
Posted on
GUI2exe
Download Python For Mac Os
An excellent wxPython based graphical builder to the various Python executable builders. Available on Google Code, also see Mike Driscoll's blog for a tutorial on using GUI2exe with Py2exe
The McMillan Installer
The mcillian installer development is discontinued.
mirror: http://davidf.sjsoft.com/mirrors/mcmillan-inc/installer_dnld.html
Continued development(not tested yet): http://pyinstaller.hpcf.upr.edu/cgi-bin/trac.cgi
This works on Win32.
Unzip the Installer in a directory of your choice, and cd there.
Configure the Installer by running:
Python must be in your PATH for this to work, if it's not, type from the command prompt:
where c:python23 must be replaced with the root of your python installation.
Then, assuming the source code is app.py (placed in c:source):
Replace 'app' everywhere above with your application name.
You will end up with appapp.exe under the Installer dir.This is a one file .exe containing all the application.
If you don't want a one-file build, suppress the option --onefile above.
If you don't have upx installed (or don't want to use it), suppress the option --upx above.
The option --noconsole is needed to produce a windows gui application, instead of a console one (so the command shell won't pop up when you run the application).
[ More details to be written... ]
py2exe
http://py2exe.sourceforge.net/
Can You Compile Python
Create a setup.py script for using py2exe to generating the exe file. (The script to compile in this case is wxTail.py):
Sample of the win32 command for running py2exe:
If you use the unicode version of wxpython you have to manually include the file unicows.dll form your python installation directory. Otherwise the application will crash at least on Windows 98.
--GeraldKlix
[ More details to be written... ]
Installer
To turn your binary and accompanying library files into a Windows installer you can use:
innosetup from http://www.jrsoftware.org/isinfo.php
NSIS from http://nsis.sourceforge.net/ (and HM-NSIS-Edit http://hmne.sourceforge.net/ for the wizard).
Issues
When using py2exe with pythoncom (or with wxPython's ActiveXWrapper which uses pythoncom) py2exe has trouble finding the code for the generated COM wrapper modules and you end up with import errors. Here is the solution, which was sent to the mail list by Clark C. Evans:
- When pythonwin is called to create an Python binding for a COM component, it generates a new python class and puts this class in the gen_py directory (which magically appears). I believe the problem is that the py2exe program doesn't expand the Python path to include the deployment directory, otherwise this directory would be found... To work-aroud this problem, simply use the makepy program to generate a python wrapper for the activeX component you have (for example, IE Explorer). Then, rename this module file to something more palatable (like ie.py). Then, instead of using 'ensure module' simply import the re-named file -- the imported module is the class module. For example, to make the IE ActiveX demo work...
- Generate ie.py using makepy using the '-o' option
- Replace the 'ensure module' stuff in the demo code with...
Python For Mac
Another work-around if you run into issues running py2exe compiled programs with the ActiveXWrapper controls (specifically the PDF Window control in wxPython 2.8) is to add a typelibs entry to the options argument in your setup.py file. See the sample setup.py below for an example.
Basically the typelibs line ensures py2exe picks up the dynamically imported module in pdfwin.py that is included with the Windows wxPython distribution.
On Linux
Summary
A binary distribution of a Python/wxPython program on Linux has these advantages:
- There is no need for the user to have Python, wxPython or any other extensions you use installed
- The versions of Python, wxPython and extensions are the ones you ship, not any they may already have installed. That means you don't need to worry about users using different versions of the extensions with your software.
Prerequisites
cx_Freeze
cx_Freeze turns a Python script into a binary file and any referenced binary modules.
Download cx_Freeze I recommend getting the binary distribution. If you extract it in /opt, then it will end up installed in /opt/cx_Freeze-2.1/ (this location is assumed through the rest of this document).
Also note that while cx_Freeze is free software, you do need to abide by the license agreement on the same page.
chrpath
The wxPython shared libraries have some pathnames hardcoded into them (also known as an rpath). chrpath removes this hardcoded path for where other shared libraries are searched.
Download chrpath from http://freshmeat.net/projects/chrpath/ By default it installs in /usr/local/bin which should be on your path.
Compile Python To App Mac Youtube
Making your binary distribution
Make an output directory
Create a clean directory for the resulting files. I make one named dist.
Run cxFreeze
Assuming the main entrypoint to your program is example.py, this is what you run:
Everything should end up in the dist subdirectory, and the main binary will be named dist/example
Run chrpath
Python For Mac Os
You now need to remove hard coded path information from the wxPython and other shared libraries. I use this shell script:
Change into the dist subdirectory and run the script. It should fix at least wxPython.wxc.so, and same other wx-controls you may use (eg calendar).
Package it up
You can now just tar up the dist subdirectory. Users can place the contents anywhere they choose on the filesystem, and call the main executable for everything to work.
I normally put all the files in a subdirectory of /usr/lib (for example: /usr/lib/example-1.0 and then put a wrapper script in /usr/bin that execs the binary in /usr/lib/example-1.0.
On Mac
py2app
http://undefined.org/python/py2app.html
BundleBuilder.py
The Python included with Mac OS X contains a tool called BundleBuilder.py which lets you package Python scripts into '.app' bundles that can be distributed on computers even without Python installed. (Although OS X 10.3 contains a complete implementation of Python.) Documentation on this tool (including an example of a wxPython app building script) can be found here:
http://www.python.org/cgi-bin/moinmoin/BundleBuilder
The important part to note is that you must manually include the wxWindows dynamic libraries at this point. See the lines in the example script containing myapp.libs.append to see how to do so. Hopefully a more targeted and detailed tutorial will be forthcoming. =) In the meantime, please feel free to post your questions to either wxPython-mac@lists.sourceforge.net or pythonmac-sig@python.org .
Examples
BitPim
The bitpim project produces Windows and Linux binary installers that don't require the user to have Python or wxPython installed (or even have to know what they are!)
Code is available in http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/bitpim/bitpim/
makedist.py does the actual build an invokes the various other tools. bitpim.iss is the innosetup file. p2econfig.py is the py2exe file.