472,126 Members | 1,494 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,126 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 3334
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by RJS | last post: by
1 post views Thread by | last post: by
2 posts views Thread by Stefan Behrens | last post: by
reply views Thread by Kathleen Kudzma | last post: by
8 posts views Thread by Kathleen Kudzma | last post: by
reply views Thread by Steven Bell | last post: by
6 posts views Thread by Luc Saffre | last post: by
reply views Thread by David Vaughan | last post: by
reply views Thread by Larry Bates | last post: by
reply views Thread by Jimmy Retzlaff | last post: by
reply views Thread by leo001 | last post: by

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.