473,394 Members | 1,916 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.

Clickable (wx)python app in OS X

AAAAARRRRRRRRGGHGHGHGHGHGHGHGHGH!!!!!! I hate Macs.

I have a wxPython program. It runs fine on OS X when I launch it from
the Terminal ("pythonw appname.py") . The user wants to be able to
click it. Two main suggestions on the Internet, neither of which
works:

1) "Use Platypus" So I download it, upgrade Stuffit, install both,
figure out how to use it, create an app....and it doesn't work for
graphical apps. Nice to know, thanks for telling me ahead of time!

2) "Just associate .py files with PythonInterpreter". Sounds easy!
So I navigate to appname.py, Get Info, Open With, navigate to
PythonInterpreter....WhereTF is "PythonInterpreter"? Not on the OS X
system anywhere and Google only finds a Python module.

So, how do I create a clickable icon that will launch my wxPython
program?
Jul 18 '05 #1
6 2313
PhysicsGenius wrote:
AAAAARRRRRRRRGGHGHGHGHGHGHGHGHGH!!!!!! I hate Macs.

I have a wxPython program. It runs fine on OS X when I launch it from
the Terminal ("pythonw appname.py") . The user wants to be able to
click it. Two main suggestions on the Internet, neither of which
works:

1) "Use Platypus" So I download it, upgrade Stuffit, install both,
figure out how to use it, create an app....and it doesn't work for
graphical apps. Nice to know, thanks for telling me ahead of time!

2) "Just associate .py files with PythonInterpreter". Sounds easy!
So I navigate to appname.py, Get Info, Open With, navigate to
PythonInterpreter....WhereTF is "PythonInterpreter"? Not on the OS X
system anywhere and Google only finds a Python module.

So, how do I create a clickable icon that will launch my wxPython
program?


Well you are opening it with pythonw so why not associate *.py with
pythonw or python?

Chris
Jul 18 '05 #2
Chris McD wrote:
PhysicsGenius wrote:
AAAAARRRRRRRRGGHGHGHGHGHGHGHGHGH!!!!!! I hate Macs.

I have a wxPython program. It runs fine on OS X when I launch it from
the Terminal ("pythonw appname.py") . The user wants to be able to
click it. Two main suggestions on the Internet, neither of which
works:

1) "Use Platypus" So I download it, upgrade Stuffit, install both,
figure out how to use it, create an app....and it doesn't work for
graphical apps. Nice to know, thanks for telling me ahead of time!

2) "Just associate .py files with PythonInterpreter". Sounds easy! So
I navigate to appname.py, Get Info, Open With, navigate to
PythonInterpreter....WhereTF is "PythonInterpreter"? Not on the OS X
system anywhere and Google only finds a Python module.

So, how do I create a clickable icon that will launch my wxPython
program?

Well you are opening it with pythonw so why not associate *.py with
pythonw or python?

Chris


I was pretty sure this was impossible, but I may
have done it. For anyone else as frustrated as I
was (and still am, kinda): I associated .py with
/System/Library/Frameworks/Python.framework/Resources/PythonLauncher.
It still brings up a Terminal window, but at
least the app launches from a click.

Mac OS X: It Just Works (poorly)
Jul 18 '05 #3
has
de*************@gmail.com (PhysicsGenius) wrote in message news:<26**************************@posting.google. com>...
So, how do I create a clickable icon that will launch my wxPython
program?


http://pythonmac.org/wiki/BundleBuilder
Jul 18 '05 #4
PhysicsGenius <de*************@gmail.com> wrote:
AAAAARRRRRRRRGGHGHGHGHGHGHGHGHGH!!!!!! I hate Macs.


Just the perfect approach to get any help whatsoever from those of us
who don't.

*PLONK*.
Alex
Jul 18 '05 #5

On 25-sep-04, at 19:35, PhysicsGenius wrote:
Chris McD wrote:
PhysicsGenius wrote:
AAAAARRRRRRRRGGHGHGHGHGHGHGHGHGH!!!!!! I hate Macs.

I have a wxPython program. It runs fine on OS X when I launch it
from
the Terminal ("pythonw appname.py") . The user wants to be able to
click it. Two main suggestions on the Internet, neither of which
works:

1) "Use Platypus" So I download it, upgrade Stuffit, install both,
figure out how to use it, create an app....and it doesn't work for
graphical apps. Nice to know, thanks for telling me ahead of time!

2) "Just associate .py files with PythonInterpreter". Sounds easy!
So I navigate to appname.py, Get Info, Open With, navigate to
PythonInterpreter....WhereTF is "PythonInterpreter"? Not on the OS X
system anywhere and Google only finds a Python module.

So, how do I create a clickable icon that will launch my wxPython
program? Well you are opening it with pythonw so why not associate *.py with
pythonw or python?
Chris


I was pretty sure this was impossible, but I may have done it. For
anyone else as frustrated as I was (and still am, kinda): I associated
.py with
/System/Library/Frameworks/Python.framework/Resources/PythonLauncher.
It still brings up a Terminal window, but at least the app launches
from a click.


If you asked your question on the pythonmac SIG you'd have gotten your
answer a lot sooner :-)

The best way to build a double-clickeable application on OSX is by
building an .app bundle that contains your application. One way to do
this is using bundlebuilder:

# buildapp.py
from bundlebuilder import buildapp

buildapp(
name = "My Application",
mainprogram = "TableModel.py",
resources = ["English.lproj"],
nibname = "MainMenu",
)
# end of buildapp.py

You can now run 'python buildapp.py build' to create the application
bundle, run 'python buildapp.py' to see some more options.

Mac OS X: It Just Works (poorly)


No, it works differently :-)

Jul 18 '05 #6
has wrote:
de*************@gmail.com (PhysicsGenius) wrote in message news:<26**************************@posting.google. com>...
So, how do I create a clickable icon that will launch my wxPython
program?


http://pythonmac.org/wiki/BundleBuilder


You could also try creating a bundle by hand. I tried that
as an experiment recently, and I got it to work. From memory,
all you need is a directory structure that contains

NameOfApp.app/Contents/MacOS/NameOfApp

where the final NameOfApp is the executable. This can be
a Python script with a #! line that invokes the appropriate
interpreter (python or pythonw). Any other modules that it
needs can be put in the MacOS directory alongside it.

Another way is to use AppletBuilder to create a "skeleton"
bundle from your main .py file, and then manually add other
required modules to the MacOS directory. That will give
you command line emulation, ability to give it a nice icon,
etc.

--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg

Jul 18 '05 #7

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

Similar topics

2
by: Markus | last post by:
Hello, I've written a couple of Python scripts on OS X that I would like to start from the Finder by doing a double-click on them. I guess I have to create a Package. Does anybody know an...
0
by: Eric_Dexter | last post by:
I was looking at vpython and it would seem to be an easy thing to add to boa-constuctors classes but I am not sure if that is possible within the boa-constructor interface. Is it possible to do...
1
by: sudhakaranr | last post by:
Hi all, I have data in MySql, I want to create a front end for the database..... which one is easy and standard either tkinter or wx python? We should pick the values from database...
2
by: dudds | last post by:
Hi I really haven't used wxPython before and I was just wondering if there was some sort of timer event that can be used. For example if I have a database that I want to query at regular intervals...
3
by: Doru Moisa | last post by:
Hello, How can I capture the output of a long runnning process which I open with popen() ? I tried reading line by line, char by char, but the result always comes when the process finishes. (I...
4
by: ateale | last post by:
Hey guys I have had a bit of a hunt around on google to try find out how to change the overall default font style/size for a wx.python app - but not had any luck. Does anyone have any idea if...
2
Elias Alhanatis
by: Elias Alhanatis | last post by:
Hello friends!!! I am writing a program ( using wx.Python ) in which i want the mainloop to check every hour a certain database i have conected to the program. ( Most of the time the GUI is idle...
3
by: lee.walczak | last post by:
Hi, I have just started writing a GUI using wxpython after finding a limitation using Tkinter. I have read most tutorials on wxpython and slowly becoming accustomed considering I started with...
4
by: askalottaqs | last post by:
i know everyone keeps saying that one needs to be using classes and not just functions, but so far i haven't had any problems with functions aside from the fact that everyone's using them and when i...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.