473,394 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Re: like py2exe, but on a mac


On 13 jul 2008, at 00:39, Alexnb wrote:
>
Hi All

I am wondering what I can do to turn a python app (.py) into a mac OSX
applicaiton (.app). Just like py2exe does.
i use these:
http://undefined.org/python/py2app.html
http://effbot.org/pyfaq/how-do-i-create-a-pyc-file.htm
But I am also wondering since in
your applications folder on macs it usually doesn't have an actual
folder
for each app. Rather an icon. so for firefox, you just see the icon.
Unlike
windows where you have a folder with everything, and the actual
program is
in it. where is all the application info stored? just in the .app?
apps on OSX are also folder, yet with the reserved .app extension
the OS then presents this as an app (right click on an app and choose
'Show package content')

py2app creates all that for you

Finally
whether or not there is an app like py2exe for mac, is there a way
to skip
the middle man and turn it straight into a .dmg with the app inside?
--
a dmg is a disk image, similar to iso on windows
you can create an empty one with Disk Utility then drop everything in
it's NOT an installer
>
cheers
Arno
Jul 12 '08 #1
13 3404
On Sun, 13 Jul 2008 00:58:59 +0200, Python.Arno wrote:
http://undefined.org/python/py2app.html
py2app bundles Python itself into the app, right? I wonder, is there no
way to create an app bundle that relies on the existing installation of
Python, since OS X already comes with Python? I have a tiny little
program (~20k) that I'd like to make into an app bundle, if only to
suppress the console window, and I'd rather not lump in the whole Python
interpreter if I can avoid it.

--
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on
Jul 28 '08 #2

On 28 jul 2008, at 03.59, William McBrine wrote:
On Sun, 13 Jul 2008 00:58:59 +0200, Python.Arno wrote:
>http://undefined.org/python/py2app.html

py2app bundles Python itself into the app, right? I wonder, is there
no
way to create an app bundle that relies on the existing installation
of
Python, since OS X already comes with Python? I have a tiny little
program (~20k) that I'd like to make into an app bundle, if only to
suppress the console window, and I'd rather not lump in the whole
Python
interpreter if I can avoid it.

--
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on
--
http://mail.python.org/mailman/listinfo/python-list
There is Platypus, a general open source program to wrap a script
in an Macintosh (GUI) Application.

----------------------------------
Skinheads are so tired of immigration, that they are going to move to
a country that don't accept immigrants!
Tommy Nordgren
to************@comhem.se


Jul 28 '08 #3
On Mon, 28 Jul 2008 19:51:26 +0200, Tommy Nordgren wrote:
There is Platypus, a general open source program to wrap a script
in an Macintosh (GUI) Application.
Thanks. I tried Platypus, and it's close to what I want. But I still
can't seem to get rid of the small "Console" window that pops up behind
my Tkinter app.

--
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on
Jul 28 '08 #4

On 28 jul 2008, at 20.22, William McBrine wrote:
On Mon, 28 Jul 2008 19:51:26 +0200, Tommy Nordgren wrote:
>There is Platypus, a general open source program to wrap a script
in an Macintosh (GUI) Application.

Thanks. I tried Platypus, and it's close to what I want. But I still
can't seem to get rid of the small "Console" window that pops up
behind
my Tkinter app.

--
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on
--
http://mail.python.org/mailman/listinfo/python-list
Try setting the Output popup menu to 'None'
------
What is a woman that you forsake her, and the hearth fire and the home
acre,
to go with the old grey Widow Maker. --Kipling, harp song of the Dane
women
Tommy Nordgren
to************@comhem.se

Jul 28 '08 #5
William McBrine wrote:
On Mon, 28 Jul 2008 19:51:26 +0200, Tommy Nordgren wrote:
>There is Platypus, a general open source program to wrap a script
in an Macintosh (GUI) Application.

Thanks. I tried Platypus, and it's close to what I want. But I still
can't seem to get rid of the small "Console" window that pops up behind
my Tkinter app.
That's not something that py2app can solve.

Add this call to your Python script somewhere (modify as needed):

try:
self.tk.call('console', 'hide')
except TclError:
pass

HTH,
Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
Jul 28 '08 #6
On Mon, 28 Jul 2008 21:09:10 +0200, Tommy Nordgren wrote:
Try setting the Output popup menu to 'None'
That was the first thing I did.

--
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on
Jul 29 '08 #7
On Mon, 28 Jul 2008 15:18:43 -0400, Kevin Walzer wrote:
Add this call to your Python script somewhere (modify as needed):

try:
self.tk.call('console', 'hide')
except TclError:
pass
Ah, yes! Thanks.

--
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on
Jul 29 '08 #8
In article <5K9jk.278$rb5.198@trnddc04>,
William McBrine <wm******@users.sf.netwrote:
On Sun, 13 Jul 2008 00:58:59 +0200, Python.Arno wrote:
http://undefined.org/python/py2app.html

py2app bundles Python itself into the app, right? I wonder, is there no
way to create an app bundle that relies on the existing installation of
Python, since OS X already comes with Python? I have a tiny little
program (~20k) that I'd like to make into an app bundle, if only to
suppress the console window, and I'd rather not lump in the whole Python
interpreter if I can avoid it.
That is exactly what py2app does by default if you run py2app with the
system python.

If you run py2app with a non-system python then that python is bundled
with the application.

Note that different versions of MacOS X have different versions of
system python. So if your application needs any 3rd party packages then
including python with the app will allow it work with more versions of
MacOS X.

-- Russell
Jul 29 '08 #9
In article <ma************************************@python.org >,
Tommy Nordgren <to************@comhem.sewrote:
On 28 jul 2008, at 03.59, William McBrine wrote:
On Sun, 13 Jul 2008 00:58:59 +0200, Python.Arno wrote:
http://undefined.org/python/py2app.html
py2app bundles Python itself into the app, right? I wonder, is there
no
way to create an app bundle that relies on the existing installation
of
Python, since OS X already comes with Python? I have a tiny little
program (~20k) that I'd like to make into an app bundle, if only to
suppress the console window, and I'd rather not lump in the whole
Python
interpreter if I can avoid it.
There is Platypus, a general open source program to wrap a script
in an Macintosh (GUI)
It's an interesting application, but... I tried it to bundle a script
that puts up a standard Tkinter file save dialog box and I found that
the dialog box was not in front -- I had to switch applications to get
to it. Still, it looks useful for fully faceless applications; unlike
py2applet the text to stdout shows up in a log window.

-- Russell
Jul 29 '08 #10
On Tue, 29 Jul 2008 12:24:49 -0700, Russell E. Owen wrote:
That is exactly what py2app does by default if you run py2app with the
system python.
Thanks. I see that it* avoids the issue with Tk starting in the
background that I get with Platypus, too.

In fact, it looks like the bundlebuilder module is adequate for my needs.
It does put in a version-specific #! line, but if I change that to
#!/usr/bin/env python, the app still works, and it seems to me that it
will work for any version of Python on OS 10.4, 10.5, and maybe 10.3.

* I still haven't actually tried "it" (py2app), since I realized that I
already had bundlebuilder, but I'm assuming it's the same in this respect.

--
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on
Jul 30 '08 #11
On Wed, 30 Jul 2008 16:57:35 +0000, I wrote:
[bundlebuidler] does put in a version-specific #! line, but if I change
that to #!/usr/bin/env python, the app still works, and it seems to me
that it will work for any version of Python on OS 10.4, 10.5, and maybe
10.3.
Then again, I see now that it has more hardwired paths in the "Python"
binary. Bah.

--
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on
Jul 30 '08 #12
oops didn't send it to the list...

On 31 jul 2008, at 23:28, Python.Arno wrote:
>
On 30 jul 2008, at 20:48, William McBrine wrote:
>On Wed, 30 Jul 2008 16:57:35 +0000, I wrote:
>>[bundlebuidler] does put in a version-specific #! line, but if I
change
that to #!/usr/bin/env python, the app still works, and it seems
to me
that it will work for any version of Python on OS 10.4, 10.5, and
maybe
10.3.

Then again, I see now that it has more hardwired paths in the
"Python"
binary. Bah.


Arno wrote:
oh just one i forgot, you can also compile python scripts into
executables
with apple's Xcode, in the developer's tools
gr
Arno
Aug 1 '08 #13
William McBrine wrote:
On Tue, 29 Jul 2008 12:24:49 -0700, Russell E. Owen wrote:
>That is exactly what py2app does by default if you run py2app with the
system python.

Thanks. I see that it* avoids the issue with Tk starting in the
background that I get with Platypus, too.

In fact, it looks like the bundlebuilder module is adequate for my needs.
It does put in a version-specific #! line, but if I change that to
#!/usr/bin/env python, the app still works, and it seems to me that it
will work for any version of Python on OS 10.4, 10.5, and maybe 10.3.

* I still haven't actually tried "it" (py2app), since I realized that I
already had bundlebuilder, but I'm assuming it's the same in this respect.
Bundlebuilder is pretty much obsolete--py2app is much better, cleaner.
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
Aug 1 '08 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RJS | last post by:
Hi all, I can't get a py2exe compiled app to run with numarray (numarray-0.5.win32- py2.2). Also wxPythonWIN32-2.3.3.1-Py22 and ActivePython-2.2.1-222. In the sample below, commenting out...
1
by: | last post by:
I want a binnary file to my aplicattion, but py2exe don't match the xmll.sax module. the py2exe shows this errors: warning: py2exe:...
2
by: Stefan Behrens | last post by:
Hi, does anybody know how I can get py2exe to work with wxPython's wxCalendarCtrl? Currently, I have just a "standard" setup.py, and py2exe gives me a syntax error. Do I need to include any...
0
by: Kathleen Kudzma | last post by:
I'm having a problem with py2exe for Python 2.3. I got fixed the Lookuperror no codec search functions registered: can't find encoding by following the instructions on the py2exe page (added...
8
by: Kathleen Kudzma | last post by:
Does anyone know how to resolve the following problem that I'm getting in Python 2.2 and 2.3? PROBLEM: When I try to create a classReader object I get an exception: "SAXReaderNotAvailable: No...
0
by: Steven Bell | last post by:
I am trying to build an executable from a python script. Using python 2.3, SOAPpy 0.10.3, Py2exe 0.4.2. Build command: python setup.py py2exe -w --includes xml.sax.drivers2.drv_py I get the...
6
by: Luc Saffre | last post by:
Hello, I had a strange problem when freezing (using either py2exe or McMillan installer) a script that imports reportlab (which imports PIL (which imports FixTk))). - Python 2.3.3c (also with...
0
by: David Vaughan | last post by:
py2exe and Pmw problem ---------------------- I was really surprised not to find some faq setting out what to do to get py2exe working for a program using Pmw. I'm haemorrhaging time here, and...
0
by: Larry Bates | last post by:
Jimmy Retzlaff wrote: Everyone, Thanks for all your hard work on py2exe, it is greatly appreciated. -Larry Bates
0
by: Jimmy Retzlaff | last post by:
py2exe 0.6.9 released ===================== py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.