Re: [Pythonmac-SIG] python program in menu bar
Dan wrote: > Thanks so much for that. It was quite easy to adapt it to my needs, > even though I don't understand the Cocoa side of the code. A few > questions: Glad it helped. I recommend getting familiar with the Cocoa libraries, they are quite rich, and PyObjC makes it very easy to experiment. The AppKiDo application makes it very easy to browse and search the documentation. > 1) I noticed that my code runs fine directly from the shell prompt, so > I'm curious what the advantage of making a real .app is. I guess this > would allow me to add the program as a "Startup Item". (Or can one > run any command as a Startup Item?) Making it a real application makes it double-clickable from the Finder and may make it behave better with other Cocoa applications. You will see your application's name when you switch to it, rather than "Python." And I think Startup Items are expected to be .app applications, although I wouldn't swear to it. It's relatively easy to make it a .app with py2app, and good practice for when you develop a killer app that you want to distribute far and wide. > 2) It is easy to change the colour of the title text that appears > in the menu bar? It should be. I'm borrowing my wife's computer right now (mine was stolen recently) so I don't actually have the docs handy, but it should be easy to figure out. I think NSAttributedString is the relevant class to start with. > 3) Is it easy to generate a beep of some sort? NSBeep is your friend. > I plan to look over some of the PyObjC documentation and examples, and I > apologize if some of this is answered there. Thanks again for pointing > out your code to me, as it is almost exactly what I was looking for! All of it is answerd in the Cocoa docs, but the hard part is knowing where to start. I hope I've been able to give you some good starting points. I'm glad the code example was helpful. One of these days I'm going to get my weblog working again, and I'll post it as a tutorial. --Dethe ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] python program in menu bar
"Dethe Elza" <[EMAIL PROTECTED]> writes: > On 9/26/07, Dan Christensen <[EMAIL PROTECTED]> wrote: >> Can anyone point to a simple example of a python program that runs in >> the menu bar? I'd like a program that just displays a few characters of >> text in the menu bar, and updates the display once a minute or so. > > I posted a very simple example of getting an NSStatusItem using PyObjC > on this list awhile back: > http://mail.python.org/pipermail/pythonmac-sig/2005-April/013731.html Thanks so much for that. It was quite easy to adapt it to my needs, even though I don't understand the Cocoa side of the code. A few questions: 1) I noticed that my code runs fine directly from the shell prompt, so I'm curious what the advantage of making a real .app is. I guess this would allow me to add the program as a "Startup Item". (Or can one run any command as a Startup Item?) 2) It is easy to change the colour of the title text that appears in the menu bar? 3) Is it easy to generate a beep of some sort? I plan to look over some of the PyObjC documentation and examples, and I apologize if some of this is answered there. Thanks again for pointing out your code to me, as it is almost exactly what I was looking for! Dan ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] py2app: how to include the entire standard library of modules?
Am 2007-09-29 um 20:54 schrieb Nick Anderson: > I am attempting to build a mac application using py2app. I need to > include all of the standard modules even though the application does > not import them expressly. (The end user will be able to write > scripts, and if his script uses a standard module it needs to be > available.) The only way I have found to do this is by using the -i > argument: You can set that up in your setup.py (sic!), but it's hard to find how. The py2app docs are no help: http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html Documentation for py2exe is better (and mostly valid for py2app, too): http://www.py2exe.org/ e.g. http://www.py2exe.org/index.cgi/PassingOptionsToPy2Exe You can use the command line options in a dict like: opts = { 'py2app' : { 'includes' : ('os', 'sys'), } } setup ( options = opts ) Did you try just to import all the modules in your main script? (Don't know if py2app optimizes that away...) Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] py2app: how to include the entire standard library of modules?
Hello: I am attempting to build a mac application using py2app. I need to include all of the standard modules even though the application does not import them expressly. (The end user will be able to write scripts, and if his script uses a standard module it needs to be available.) The only way I have found to do this is by using the -i argument: python setup.py py2app -i "THE NAMES OF ALL MODULES SEPARATED BY A COMMA" I guess I could write a shell script that contains the above command but is there an easier way? ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig