From Chris.Barker at noaa.gov Fri Feb 1 23:55:13 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 01 Feb 2008 14:55:13 -0800 Subject: [Pythonmac-SIG] Key Bindings on cross platform apps. Message-ID: <47A3A351.60204@noaa.gov> Hi all I'm trying help out Rob McMullen get his "Peppy" editor working well on OS-X. I'm thinking about about key bindings. Apple has the "command" key, but also an "alt"(option) key and a "control" key. I kind of wish they had never introduced a control key, but so be it. Anyway, it seems that for the standard conventions, like cut, copy, paste, save, etc, that Macintosh apps use the "command" key where Windows (and KDE and GNOME) apps use the "control" key. This, for cross platform apps, this is what I think should be done: On the Mac, the default behavior should be for "command" to do everything that "control" does on Windows and Linux, and "control" should do nothing. The alt(option) key should do the same thing as alt on the other platforms. This seems like it makes for the best compatibility. Is this a standard and good way to do it? thanks, -Chris PS: A plug for Peppy: Peppy is yet another text editor written with wxPython. When it first came out, I though "arrggg! why another one?". But it turns out that the author's reasons for another one pretty much exactly match my reasons for never fully adopting any of the others -- they simple weren't designed to be as powerful and flexible as I need to make it my do-everything editor. I've been looking for years for an editor that meets these requirements: - Runs the same way on Linux, Windows, and OS-X - Works well for editing all the kinds of text I need to edit -- with customized modes for all of them (Or the ability to create such modes) - Good python support - Modern UI (all the "standard" keystrokes, etc), and integration with the OS (drag and drop, etc) - Scriptable in Python, so I can add the stuff it doesn't have. - Multiple top-level windows. In a nutshell, I want (X)emacs with a modern UI, and scriptable in python. Rob has set out to build exactly that, and I think he has done an admirable job of creating the kind of flexible, powerful framework that's required to really make it shine. It's still rough around the edges (particularly on the Mac -- I'm his only Mac user right now, and he doesn't have a Mac), but it would be great if some other folks could check it out and help clean up those rough edges. I urge you to give it a try. http://peppy.flipturn.org/ getting the SVN version is probably your best bet. I just added a setup_mac.py file that you can build an alias application bundle with: python setup_mac.py py2app -A I haven't yet tested a full app bundle, but it works pretty well with the Alias mode. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From robin at alldunn.com Sat Feb 2 00:55:15 2008 From: robin at alldunn.com (Robin Dunn) Date: Fri, 01 Feb 2008 15:55:15 -0800 Subject: [Pythonmac-SIG] Key Bindings on cross platform apps. In-Reply-To: <47A3A351.60204@noaa.gov> References: <47A3A351.60204@noaa.gov> Message-ID: <47A3B163.6030909@alldunn.com> Christopher Barker wrote: > Hi all > > I'm trying help out Rob McMullen get his "Peppy" editor working well on > OS-X. I'm thinking about about key bindings. > > Apple has the "command" key, but also an "alt"(option) key and a > "control" key. I kind of wish they had never introduced a control key, > but so be it. > > Anyway, it seems that for the standard conventions, like cut, copy, > paste, save, etc, that Macintosh apps use the "command" key where > Windows (and KDE and GNOME) apps use the "control" key. This, for cross > platform apps, this is what I think should be done: > > On the Mac, the default behavior should be for "command" to do > everything that "control" does on Windows and Linux, and "control" > should do nothing. The alt(option) key should do the same thing as alt > on the other platforms. > > This seems like it makes for the best compatibility. Is this a standard > and good way to do it? A lot of this can be automated in wxPython by following some basic rules. First of all wxMac will automatically convert Ctrl-whatever accelerators in menu items to be Command-whatever, so for example if somebody writes the app on Windows and uses Ctrl-C for the Copy menu accelerator then when it runs on Mac it will be turned into a Cmd-C. For other key bindings, such as those handled in explicit EVT_KEY_DOWN event handlers you can use the CmdDown() method in the key event object instead of MetaDown() on Mac and ControlDown() on the other platforms. CmdDown is simply defined like this: bool CmdDown() const { #if defined(__WXMAC__) || defined(__WXCOCOA__) return MetaDown(); #else return ControlDown(); #endif } For explicit accelerator tables there is a wx.ACCEL_CMD identifier that works the same way, it's equivalent to wx.ACCEL_CTRL on Windows and GTK and to the command key on Mac. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! From Chris.Barker at noaa.gov Sat Feb 2 01:20:54 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 01 Feb 2008 16:20:54 -0800 Subject: [Pythonmac-SIG] Key Bindings on cross platform apps. In-Reply-To: <47A3B163.6030909@alldunn.com> References: <47A3A351.60204@noaa.gov> <47A3B163.6030909@alldunn.com> Message-ID: <47A3B766.80308@noaa.gov> Robin Dunn wrote: > Christopher Barker wrote: >> On the Mac, the default behavior should be for "command" to do >> everything that "control" does on Windows and Linux, and "control" >> should do nothing. The alt(option) key should do the same thing as alt >> on the other platforms. >> >> This seems like it makes for the best compatibility. Is this a standard >> and good way to do it? > > A lot of this can be automated in wxPython by following some basic > rules. Thanks Robin, I knew some of that, mostly because a remarkable number of apps do "just work". However: - I wanted to confirm that I had the right goal -- it's obviously the way to do it to me, but I might have missed some Mac convention I don't know about. - Peppy is doing some weird things with key bindings, in order to allow people to totally customize them, and to allow emacs-style multi-stroke bindings -- Ctrl-X Ctrl-O for "file open", for instance. It's now mostly working, but not quite, so as I set out to debug, I want to make sure I've got the goals right! Thanks, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From bwaters at nrao.edu Sat Feb 2 02:41:10 2008 From: bwaters at nrao.edu (Boyd Waters) Date: Fri, 1 Feb 2008 18:41:10 -0700 Subject: [Pythonmac-SIG] Key Bindings on cross platform apps. In-Reply-To: <47A3B766.80308@noaa.gov> References: <47A3A351.60204@noaa.gov> <47A3B163.6030909@alldunn.com> <47A3B766.80308@noaa.gov> Message-ID: Chris: FWIW Qt has addressed this with QtKeySequence, there is a table of key bindings for standard keys here: http://doc.trolltech.com/4.2/qkeysequence.html#details Note that this table may be confusing: > On Mac OS X, references to "Ctrl", Qt::CTRL, Qt::Control and > Qt::ControlModifier correspond to the Command keys on the Macintosh > keyboard, and references to "Meta",Qt::META, Qt::Meta and > Qt::MetaModifier correspond to the Control keys. Developers on Mac > OS X can use the same shortcut descriptions across all platforms, > and their applications will automatically work as expected on Mac OS > X. Still, it's worth a look... - boyd From grzessnik at interia.pl Sat Feb 2 12:02:06 2008 From: grzessnik at interia.pl (Grzegorz Laszczyk) Date: Sat, 02 Feb 2008 12:02:06 +0100 Subject: [Pythonmac-SIG] installing MySQLdb problem Message-ID: <47A44DAE.7060703@interia.pl> Hi. I have to work with MySQL database. I'm trying to install MySQLdb module on my MacBook Pro (with Tiger). I've downloaded source .gz from site, unpack it. When trying to install it, an error occured. grzesieks-computer:~/desktop grzesiek$ cd MySQL-python-1.2.2 grzesieks-computer:~/desktop/MySQL-python-1.2.2 grzesiek$ python setup.py build sh: line 1: mysql_config: command not found Traceback (most recent call last): File "setup.py", line 16, in metadata, options = get_config() File "/Users/grzesiek/Desktop/MySQL-python-1.2.2/setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "/Users/grzesiek/Desktop/MySQL-python-1.2.2/setup_posix.py", line 24, in mysql_config raise EnvironmentError, "%s not found" % mysql_config.path EnvironmentError: mysql_config not found grzesieks-computer:~/desktop/MySQL-python-1.2.2 grzesiek$ Can you help me. Maybe it is other way to work witk MySQL. Thanks Grzesiek ---------------------------------------------------------------------- Zmus swojego faceta, zeby to przeczytal Kliknij >>> http://link.interia.pl/f1ceb From Larry.Meyn at nasa.gov Sat Feb 2 17:52:49 2008 From: Larry.Meyn at nasa.gov (Larry Meyn) Date: Sat, 2 Feb 2008 08:52:49 -0800 Subject: [Pythonmac-SIG] installing MySQLdb problem In-Reply-To: <47A44DAE.7060703@interia.pl> References: <47A44DAE.7060703@interia.pl> Message-ID: <2B07897D-B3F0-4F8B-9C52-616B114AD2D4@nasa.gov> There is a consistent problem compiling MySQLdb on OS X, wether it's 10.4 or 10.5. The following link details a work around. Even though it specifically mentions 10.5, the problem exists on 10.4. http://www.nickshanny.com/2007/10/os-x-105-python-and-mysqldb.html I hope this works for you. Cheers, Larry On Feb 2, 2008, at 3:02 AM, Grzegorz Laszczyk wrote: > Hi. > I have to work with MySQL database. I'm trying to install MySQLdb > module > on my MacBook Pro (with Tiger). > > I've downloaded source .gz from site, unpack it. > When trying to install it, an error occured. > > grzesieks-computer:~/desktop grzesiek$ cd MySQL-python-1.2.2 > grzesieks-computer:~/desktop/MySQL-python-1.2.2 grzesiek$ python > setup.py build > sh: line 1: mysql_config: command not found > Traceback (most recent call last): > File "setup.py", line 16, in > metadata, options = get_config() > File "/Users/grzesiek/Desktop/MySQL-python-1.2.2/setup_posix.py", > line > 43, in get_config > libs = mysql_config("libs_r") > File "/Users/grzesiek/Desktop/MySQL-python-1.2.2/setup_posix.py", > line > 24, in mysql_config > raise EnvironmentError, "%s not found" % mysql_config.path > EnvironmentError: mysql_config not found > grzesieks-computer:~/desktop/MySQL-python-1.2.2 grzesiek$ > > Can you help me. Maybe it is other way to work witk MySQL. > > Thanks > Grzesiek > > > > ---------------------------------------------------------------------- > Zmus swojego faceta, zeby to przeczytal > Kliknij >>> http://link.interia.pl/f1ceb > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20080202/102ba73d/attachment.htm From massimodisasha at yahoo.it Sat Feb 2 19:31:03 2008 From: massimodisasha at yahoo.it (sasha) Date: Sat, 02 Feb 2008 19:31:03 +0100 Subject: [Pythonmac-SIG] numpy+ipython+scipy+matplotlib Message-ID: <1201977063.5800.6.camel@sasha.homenet.telecomitalia.it> Hi, i ve upgraded my mac book pro from tiger to leopard but i've some problems to build scipy and matplotlib :-/ i tried the svn source installation, but it worked fine only for ipython instead scypy and matplotlib fails. as solution i tried to install the scipysuperpack that use the standard python 2.5 used by the system now numpy ipyrhon and scipy seems that works, but matplotlib give me errors about freetype. please can you suggest me a way to solve these issue ? again .. during these time i also tried to install macpython frameworks and then istall all the needed sw from source but without success :-( how can delete all the code generated by the pythonmazc-framework installation ? thanks a lot for any suggestion! regards, Massimo. Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com From piet at cs.uu.nl Sat Feb 2 21:24:22 2008 From: piet at cs.uu.nl (Piet van Oostrum) Date: Sat, 02 Feb 2008 21:24:22 +0100 Subject: [Pythonmac-SIG] Help with path settings In-Reply-To: (George Wright's message of "Wed\, 30 Jan 2008 18\:09\:21 +1100") References: Message-ID: >>>>> George Wright (GW) wrote: >GW> I guess I should leave the python 2.3 where it is Yes, you should never remove the system provided Python from your computer. >>> There are quite a lot of places where environment variables can be set. >>> >>> E.g. ~/.profile ~/.bashrc ~/.login ~/.bash_profile, ~/.bash_login, >>> ~/.cshrc >>> ~/.tcshrc >>> /etc/csh.cshrc /etc/csh.login /etc/profile /etc/bashrc >>> ~/.MacOSX/environment.plist >>> >GW> Well this is a very helpful list. First time I've seen them all at once. >GW> Are there any more? The /etc/rc* files are executed at boot time under certain circumstances, but I am not sure if the environment variables they set will reach the shell or the desktop environment. -- Piet van Oostrum URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4] Private email: piet at vanoostrum.org From grzessnik at interia.pl Sun Feb 3 16:54:08 2008 From: grzessnik at interia.pl (Grzegorz Laszczyk) Date: Sun, 03 Feb 2008 16:54:08 +0100 Subject: [Pythonmac-SIG] Tuples Message-ID: <47A5E3A0.3060607@interia.pl> Hi all :) I have a newbie question. Do you use tuples? If yes, maybe can you explain me where and why. I know, how to use strings, dictionaries, lists. But tulpes? Python is my first language, where I found this. Thanks for explanation. Grzesiek ---------------------------------------------------------------------- Zmus swojego faceta, zeby to przeczytal Kliknij >>> http://link.interia.pl/f1ceb From hraban at fiee.net Sun Feb 3 17:44:03 2008 From: hraban at fiee.net (Henning Hraban Ramm) Date: Sun, 3 Feb 2008 17:44:03 +0100 Subject: [Pythonmac-SIG] Tuples In-Reply-To: <47A5E3A0.3060607@interia.pl> References: <47A5E3A0.3060607@interia.pl> Message-ID: Am 2008-02-03 um 16:54 schrieb Grzegorz Laszczyk: > I have a newbie question. > Do you use tuples? If yes, maybe can you explain me where and why. > I know, how to use strings, dictionaries, lists. But tulpes? Python is > my first language, where I found this. You can use tuples, where 1. they're expected 2. you need a "list" that never changes (you can assign a new tuple, of course) 2a. constants AFAIK tuples are a bit faster and need less memory than lists, esp. with big datasets. see also http://docs.python.org/tut/ node7.html#SECTION007300000000000000000 Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From tavis at naughtylittlemonkey.org Sun Feb 3 22:11:58 2008 From: tavis at naughtylittlemonkey.org (Tavis) Date: Sun, 3 Feb 2008 13:11:58 -0800 Subject: [Pythonmac-SIG] Getting cantera to run Message-ID: <1453D569-1520-4676-8CC9-D29ED7931314@naughtylittlemonkey.org> Hello, I've been struggling to get cantera to run on my mac. I have OX 10.4.11 with Python 2.5.1 installed and numarray 1.5.2. Importing numarray in python doesn't generate any errors, so I assume it to be working. I ran a Cantera 1.6 binary and it seemed to install ok, but I can't get python to recognize it. I added /Applications/Cantera/bin to my path and I ran the setup_cantera file, though I had to run it line by line in terminal since I couldn't get it to work as a shell script (maybe I should have added .sh to the file? Thats a question for another day). Whenever i try "import cantera" at a python prompt, i get Traceback (most recent call last): File "", line 1, in ImportError: No module named cantera Would I be better off trying to compile cantera 1.7 for the source files? Any other suggestions. From Jack.Jansen at cwi.nl Sun Feb 3 22:32:30 2008 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sun, 3 Feb 2008 22:32:30 +0100 Subject: [Pythonmac-SIG] Key Bindings on cross platform apps. In-Reply-To: <47A3A351.60204@noaa.gov> References: <47A3A351.60204@noaa.gov> Message-ID: <9DDD2EFD-7723-46F4-A29D-AAD987544A22@cwi.nl> On 1-Feb-2008, at 23:55 , Christopher Barker wrote: > Hi all > > I'm trying help out Rob McMullen get his "Peppy" editor working > well on > OS-X. I'm thinking about about key bindings. There are some apps that have sets of keyboard shortcuts and let you switch between them with a preference. This is very handy, because now a Mac user of application X can chose whether s/he wants Mac- oriented shortcuts (so find will be command-F, for example) and another user of X on the Mac who happens to be familiar with the Windows version of X can chose Windows-X-compatible shortcuts (so find would be F3, probably). I don't like customizable keyboard shortcuts in general (this is what makes it impossible to type anything in someone else's Emacs, for example), but in this one case I think it's definitely worth it. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20080203/35ad5a0f/attachment.htm From tavis at naughtylittlemonkey.org Fri Feb 1 04:26:36 2008 From: tavis at naughtylittlemonkey.org (Tavis) Date: Thu, 31 Jan 2008 19:26:36 -0800 Subject: [Pythonmac-SIG] Installing Cantera Message-ID: <271DE97C-9BC2-4382-9E53-1C00792245D7@naughtylittlemonkey.org> Hello, I'm using os 10.4.11. I installed python2.4.4 and got it running as well as numarray, and it seems to be running as well (import numarray doesn't create any error messages.) I've been trying to install cantera next. When i run the installer it seems to install everything except python. I get this error message Warning: the Cantera Python package is not installed. If you intentionally skipped it, ignore this message. Otherwise, type 'make python' and/or 'make python-install' and look for error messages. Note that you must first install the 'numarray' package before installing the Cantera package. The make python-install command brings up a huge string of error messages. here is the beginning: gcc: installation problem, cannot exec 'i686-apple-darwin8- gcc-4.0.0': No such file or directory In file included from src/pycantera.cpp:16: /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/ Python.h:18:20: error: limits.h: No such file or directory /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/ Python.h:21:2: error: #error "Something's broken. UCHAR_MAX should be defined in limits.h." /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/ Python.h:25:2: error: #error "Python's source code assumes C's unsigned char is an 8-bit type." /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/ Python.h:32:19: error: stdio.h: No such file or directory /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/ Python.h:34:5: error: #error "Python.h requires that stdio.h define NULL." /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/ Python.h:37:20: error: string.h: No such file or directory /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/ Python.h:38:19: error: errno.h: No such file or directory /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/ Python.h:39:20: error: stdlib.h: No such file or directory /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/ Python.h:41:20: error: unistd.h: No such file or directory /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/ Python.h:53:20: error: assert.h: No such file or directory In file included from /Library/Frameworks/Python.framework/Versions/ 2.4/include/python2.4/Python.h:55, from src/pycantera.cpp:16: /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/ pyport.h:7:20: error: stdint.h: No such file or directory From geometrian at gmail.com Sun Feb 3 02:18:07 2008 From: geometrian at gmail.com (Ian Mallett) Date: Sat, 2 Feb 2008 17:18:07 -0800 Subject: [Pythonmac-SIG] Error in py2app Message-ID: Hi, I'm getting the following error when running py2app: *** creating application bundle: Gravity *** Traceback (most recent call last): File "C:\dev\Python25\lib\site-packages\py2app- 0.3.6-py2.5.egg\py2app\build_ap p.py", line 548, in _run self.run_normal() File "C:\dev\Python25\lib\site-packages\py2app- 0.3.6-py2.5.egg\py2app\build_ap p.py", line 619, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "C:\dev\Python25\lib\site-packages\py2app- 0.3.6-py2.5.egg\py2app\build_ap p.py", line 710, in create_binaries target, arcname, pkgexts, copyexts, target.script) File "C:\dev\Python25\lib\site-packages\py2app- 0.3.6-py2.5.egg\py2app\build_ap p.py", line 1043, in build_executable appdir, resdir, plist = self.create_bundle(target, script) File "C:\dev\Python25\lib\site-packages\py2app- 0.3.6-py2.5.egg\py2app\build_ap p.py", line 973, in create_bundle use_runtime_preference=use_runtime_preference File "C:\dev\Python25\lib\site-packages\py2app- 0.3.6-py2.5.egg\py2app\build_ap p.py", line 962, in create_appbundle extension=self.extension, File "C:\dev\Python25\lib\site-packages\py2app- 0.3.6-py2.5.egg\py2app\create_a ppbundle.py", line 29, in create_appbundle srcmain = module.setup.main() File "C:\dev\Python25\lib\site-packages\py2app- 0.3.6-py2.5.egg\py2app\apptempl ate\setup.py", line 14, in main CC = cfg['CC'] KeyError: 'CC' > c:\dev\python25\lib\site-packages\py2app- 0.3.6-py2.5.egg\py2app\apptemplate\se tup.py(14)main() -> CC = cfg['CC'] (Pdb) What can I do to fix this? Thanks, Ian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20080202/1950d1b7/attachment.htm From Chris.Barker at noaa.gov Mon Feb 4 20:26:54 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 04 Feb 2008 11:26:54 -0800 Subject: [Pythonmac-SIG] Key Bindings on cross platform apps. In-Reply-To: <9DDD2EFD-7723-46F4-A29D-AAD987544A22@cwi.nl> References: <47A3A351.60204@noaa.gov> <9DDD2EFD-7723-46F4-A29D-AAD987544A22@cwi.nl> Message-ID: <47A766FE.3010605@noaa.gov> Jack Jansen wrote: > There are some apps that have sets of keyboard shortcuts and let you > switch between them with a preference. Yes, and Peppy is one of them -- one of it's strengths. > This is very handy, because now a > Mac user of application X can chose whether s/he wants Mac-oriented > shortcuts (so find will be command-F, for example) and another user of X > on the Mac who happens to be familiar with the Windows version of X can > chose Windows-X-compatible shortcuts (so find would be F3, probably). Right. I switch a lot between OS-X, Windows, and Linux a lot. I've found that most apps these days follow the same convention for the really standard stuff -- cut/copy/paste, save, except that the Mac uses "command" where Windows and Linux (which is to say KDE, GNOME, and Mozilla) use "control" -- why apple ever even added a control key, rather than making command==control, I'll never know. But there you go. Anyway, to help with that confusion, I've re-mapped my Mac keyboard so that: key action ___________________ command == command control == command caps lock == control Since CapsLock is evil anyway, I've remapped it to control on Windows and Linux also, so I can do the same thing everywhere. As far as Peppy is concerned, what I want is to have it behave the same on all platforms, except using the command key instead of control on OS-X. There are two options for doing this: 1) enforce that command==control in Peppy. This is what wx does by default if you use the right constants to define your keys 2) have a "Mac" keyboard mapping that is different than the other ones. I prefer the 1st approach -- it makes it easier have a default set of key bindings that is the same everywhere, and easier to move a key bindings config file between platforms. I was polling this group to see if that approach made sense to others too. It seems it does. > I don't like customizable keyboard shortcuts in general (this is what > makes it impossible to type anything in someone else's Emacs, for > example), I agree -- I found the default emacs bindings painful enough that I've added my own, but now I can hardly use emacs if I don't have my own config for it. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From Chris.Barker at noaa.gov Mon Feb 4 20:39:29 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 04 Feb 2008 11:39:29 -0800 Subject: [Pythonmac-SIG] Key Bindings on cross platform apps. In-Reply-To: <65fadfc30802021356m9f20817le8741a50402296e1@mail.gmail.com> References: <47A3A351.60204@noaa.gov> <65fadfc30802021356m9f20817le8741a50402296e1@mail.gmail.com> Message-ID: <47A769F1.1020301@noaa.gov> Nehemiah Dacres wrote: > What is the difference between this editor and editra The big difference is that Peppy has been designed to be more flexible and expendable -- I think it has the potential to be a really great editor for ALL types of text files (and some others -- binary, etc.). Some of the key features: - user-definable key bindings, including emacs style multi-key bindings. - User definable major-modes for different file types. (and I think they are inheritable, so you could create one that was almost like an existing mode, then add/change a bit for your use. - Minor modes -- these are kind of like mix-ins -- extra functionality you can tack onto various major modes -- like word wrapping etc. - You can view the same buffer (file) in multiple windows at the same time. Is does currently lack a bit of polish, particularly on the Mac. Editra (and PyPE, SPE, ulipad, etc....), on the other hand has been built to do what it does well, but without the built-in flexibility. No different modes, no user-definable key bindings, etc. It does work better for the basic stuff out-of-the-box, but I've bumped into limits already with it. In short, the developers have taken a different tack -- Peppy has been designed from the ground up with a focus on getting a flexible (and admittedly complex) framework in place, with some of the usability details on the back burner. Editra, on the other hand, has focused on getting basic functionality in place, including the usability niceties. This does make early version more usable, but I think, in the long run, Peppy has more room to grow. > and is there any > possibility that i would be able to use this via a console? I think there is a possibility in the future that a console mode could be built -- it's got good separation of functionality from UI, but there is only a wx UI at the moment -- I don't think he has plans for a console version. -Chris PS: Peppy is the only editor other than (X)emacs that has a python mode that does indentation right. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From tomp at earthlink.net Mon Feb 4 20:52:43 2008 From: tomp at earthlink.net (Tom Pollard) Date: Mon, 4 Feb 2008 14:52:43 -0500 Subject: [Pythonmac-SIG] Key Bindings on cross platform apps. In-Reply-To: <47A766FE.3010605@noaa.gov> References: <47A3A351.60204@noaa.gov> <9DDD2EFD-7723-46F4-A29D-AAD987544A22@cwi.nl> <47A766FE.3010605@noaa.gov> Message-ID: <4AF22AEB-12B3-496A-B312-6B27B49E4C3E@earthlink.net> On Feb 4, 2008, at 2:26 PM, Christopher Barker wrote: > I've found that most apps these days follow the same convention for > the really > standard stuff -- cut/copy/paste, save, except that the Mac uses > "command" where Windows and Linux (which is to say KDE, GNOME, and > Mozilla) use "control" -- why apple ever even added a control key, > rather than making command==control, I'll never know. But there you > go. My recollection is that the control key has been around since the stone ages (ASR-33 teletypes, at least) and that many of the standard control-key combinations (ctl-C, for one) had their well-defined meanings long before the Mac was introduced. For Apple to introduce a command key rather than saying ctl-c no longer meant 'interrupt' but now 'copy' makes sense. That MS (or IBM, or whoever) decided to start using ctl-key combinations to mirror Apple's cmd-key combinations seems like the more egregious offense. (If I'm misremembering the history, please correct me.) Tom From njriley at uiuc.edu Mon Feb 4 21:38:14 2008 From: njriley at uiuc.edu (Nicholas Riley) Date: Mon, 4 Feb 2008 14:38:14 -0600 Subject: [Pythonmac-SIG] Key Bindings on cross platform apps. In-Reply-To: <4AF22AEB-12B3-496A-B312-6B27B49E4C3E@earthlink.net> References: <47A3A351.60204@noaa.gov> <9DDD2EFD-7723-46F4-A29D-AAD987544A22@cwi.nl> <47A766FE.3010605@noaa.gov> <4AF22AEB-12B3-496A-B312-6B27B49E4C3E@earthlink.net> Message-ID: <20080204203814.GA47221@uiuc.edu> On Mon, Feb 04, 2008 at 02:52:43PM -0500, Tom Pollard wrote: > My recollection is that the control key has been around since the > stone ages (ASR-33 teletypes, at least) and that many of the standard > control-key combinations (ctl-C, for one) had their well-defined > meanings long before the Mac was introduced. For Apple to introduce a > command key rather than saying ctl-c no longer meant 'interrupt' but > now 'copy' makes sense. That MS (or IBM, or whoever) decided to start > using ctl-key combinations to mirror Apple's cmd-key combinations > seems like the more egregious offense. (If I'm misremembering the > history, please correct me.) That's more or less it. The Apple II had a Control key before it had open/closed-Apple (Command/Option) keys. The Mac Plus and earlier had only Command-Option keys and no Control (or Escape) key, which made terminal emulation software rather unhappy - they typically used the Option key. The Apple IIgs and Mac SE/II were the first machines to get ADB, and thus keyboard compatibility between the two. The other II/Mac unification changes were the Escape key, renaming "Backspace" to "Delete" and adding the (open) Apple logo to the Command key, from which it was only recently removed. Apple had three ADB keyboards at that point: - the Apple Extended keyboard, the basis of every desktop Apple keyboard since, until the recent aluminum keyboard design - the Apple Standard keyboard, with Control to the left of A, caps lock at the bottom left, escape to the left of 1 and arrow keys in order: - the IIgs keyboard, which was essentially a smaller version of the Apple Standard keyboard (and came out first): The Extended keyboard was designed to be infrequently purchased, only by those people who wanted to run PC software on their Macs (Apple also shipped a 5 1/4" drive to be used with Macintosh PC Exchange around the same time), but it ended up becoming the dominant keyboard. -- Nicholas Riley | From xkenneth at gmail.com Tue Feb 5 05:05:30 2008 From: xkenneth at gmail.com (Kenneth miller) Date: Mon, 04 Feb 2008 22:05:30 -0600 Subject: [Pythonmac-SIG] Guages, Sliders, Graphs and py2app Message-ID: <47A7E08A.4040309@gmail.com> All, Couple quick questions here. I've got a small program I'm distributing, all in python, and I'm relying on py2app to distribute it. Which is fine, I can even get it to work with Tk etc. I like Tk, it's simple, but it's too simple for what I want to do. I'd like to be able to display data using widgets like a thermometer, guages (like in your car), orthogonal graphs, polar graphs, etc. Is there a python GUI framework available with these types of widgets that's easy to distribute along with an App built with py2app? Regards, Kenneth Miller From Chris.Barker at noaa.gov Tue Feb 5 07:10:55 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 04 Feb 2008 22:10:55 -0800 Subject: [Pythonmac-SIG] Guages, Sliders, Graphs and py2app In-Reply-To: <47A7E08A.4040309@gmail.com> References: <47A7E08A.4040309@gmail.com> Message-ID: <47A7FDEF.7070602@noaa.gov> Kenneth miller wrote: > I like Tk, it's simple, but it's too simple for what I > want to do. I'd like to be able to display data using widgets like a > thermometer, guages (like in your car), orthogonal graphs, polar graphs, > etc. Is there a python GUI framework available with these types of > widgets that's easy to distribute along with an App built with py2app? wxPython is a pretty good bet. It's got a lot more high level widgets than Tk --you'll be very happy, unless you depend a lot on the tk Text or Canvas widgets -- there are good wx alternatives for most uses of these, but nothing quite so easy and comprehensive. Andrea Gavana Has written a bunch of widgets that might suite you: http://xoomer.alice.it/infinity77/main/freeware.html For instance: http://xoomer.alice.it/infinity77/main/freeware.html#speedmeter I've seen a set of gages and what not widgets for QT too- ut can't find them with a quick google. As for graphs, Matplotlib is a good bet -- it works with wx, gtk, qt and tk. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception From vip at avatar.com.au Tue Feb 5 07:53:44 2008 From: vip at avatar.com.au (DavidW) Date: Tue, 5 Feb 2008 17:53:44 +1100 Subject: [Pythonmac-SIG] module metrics and Framework comparisons Message-ID: <7CBF7AD0-2BB4-40D3-A37B-CE120BEB6561@avatar.com.au> Hi All, Does anyone know of a set of (formalized software engineering) metrics against which (python) modules can be evaluated? I am about to (yet again) summarise several modules which do similar things and I wondered if anyone knows of a such a set. I'd like to be able to include things like level of support, code readability, documentation. I guess you all know the rap. Also, I've been background reading around Application Frameworks and wondered if anyone's got a good/favourite reference which compares Python with others. Couldn't find anything on python.org. thanks a million, David ________________________________________________ David Worrall - Experimental Polymedia: www.avatar.com.au - Education for Financial Independence: www.mindthemarkets.com.au Australian research affiliations: - Capital Markets Cooperative Research Centre: www.cmcrc.com - Sonic Communications Research Group: creative.canberra.edu.au/scrg From vip at avatar.com.au Tue Feb 5 07:54:39 2008 From: vip at avatar.com.au (DavidW) Date: Tue, 5 Feb 2008 17:54:39 +1100 Subject: [Pythonmac-SIG] Guages, Sliders, Graphs and py2app In-Reply-To: <47A7FDEF.7070602@noaa.gov> References: <47A7E08A.4040309@gmail.com> <47A7FDEF.7070602@noaa.gov> Message-ID: <5E6CCBE9-C50F-4D86-8CBE-7F3C884EC607@avatar.com.au> Hi Kenneth, I can confirm Chris' pointers to wxPython (google for an excellent book on the topic) and there's a useful development framework which I use: wxglade.sourceforge.net/ I also use matplotlib with wxPython - just be careful to get the right version - I've never py2app'ed any of it though. ciao, David On 05/02/2008, at 5:10 PM, Christopher Barker wrote: > Kenneth miller wrote: >> I like Tk, it's simple, but it's too simple for what I >> want to do. I'd like to be able to display data using widgets like a >> thermometer, guages (like in your car), orthogonal graphs, polar >> graphs, >> etc. Is there a python GUI framework available with these types of >> widgets that's easy to distribute along with an App built with >> py2app? > > wxPython is a pretty good bet. It's got a lot more high level widgets > than Tk --you'll be very happy, unless you depend a lot on the tk Text > or Canvas widgets -- there are good wx alternatives for most uses of > these, but nothing quite so easy and comprehensive. > > Andrea Gavana Has written a bunch of widgets that might suite you: > > http://xoomer.alice.it/infinity77/main/freeware.html > > For instance: > http://xoomer.alice.it/infinity77/main/freeware.html#speedmeter > > > I've seen a set of gages and what not widgets for QT too- ut can't > find > them with a quick google. > > As for graphs, Matplotlib is a good bet -- it works with wx, gtk, qt > and tk. > > -Chris > > ________________________________________________ David Worrall - Experimental Polymedia: www.avatar.com.au - Education for Financial Independence: www.mindthemarkets.com.au Australian research affiliations: - Capital Markets Cooperative Research Centre: www.cmcrc.com - Sonic Communications Research Group: creative.canberra.edu.au/scrg From kent37 at tds.net Tue Feb 5 14:27:56 2008 From: kent37 at tds.net (Kent Johnson) Date: Tue, 05 Feb 2008 08:27:56 -0500 Subject: [Pythonmac-SIG] module metrics and Framework comparisons In-Reply-To: <7CBF7AD0-2BB4-40D3-A37B-CE120BEB6561@avatar.com.au> References: <7CBF7AD0-2BB4-40D3-A37B-CE120BEB6561@avatar.com.au> Message-ID: <47A8645C.3020506@tds.net> DavidW wrote: > Hi All, > > Does anyone know of a set of (formalized software > engineering) metrics against which (python) modules can be evaluated? http://pycheesecake.org/ attempts to evaluate the 'kwalitee' (their word) of software packages by applying automatic metrics. > Also, I've been background reading around Application Frameworks and > wondered if anyone's got a good/favourite reference which compares > Python with others. Python itself is a programming language, not an application framework. Are you looking to compare Python frameworks with each other, or with other languages, or ?? The only Python desktop (not web) application framework under active development that I know of is Dabo: http://dabodev.com/ Kent From vip at avatar.com.au Tue Feb 5 14:59:50 2008 From: vip at avatar.com.au (DavidW) Date: Wed, 6 Feb 2008 00:59:50 +1100 Subject: [Pythonmac-SIG] module metrics and Framework comparisons In-Reply-To: <47A8645C.3020506@tds.net> References: <7CBF7AD0-2BB4-40D3-A37B-CE120BEB6561@avatar.com.au> <47A8645C.3020506@tds.net> Message-ID: Hi Kent. I'd never actually used cheeecake for evaluation, just as a source of SW, so thanks. On 06/02/2008, at 12:27 AM, Kent Johnson wrote: > DavidW wrote: >> Hi All, >> Does anyone know of a set of (formalized software >> engineering) metrics against which (python) modules can be evaluated? > > http://pycheesecake.org/ attempts to evaluate the 'kwalitee' (their > word) of software packages by applying automatic metrics. > >> Also, I've been background reading around Application Frameworks >> and wondered if anyone's got a good/favourite reference which >> compares Python with others. > > Python itself is a programming language, not an application > framework. Are you looking to compare Python frameworks with each > other, or with other languages, or ?? > badly expressed, sorry. Yes I meant "compare those written in Python with others" > The only Python desktop (not web) application framework under active > development that I know of is Dabo: > http://dabodev.com/ > Looks interesting. Perhaps I could see what cheesecake thinks of it! thanks again, David > > Kent > From rowen at cesmail.net Wed Feb 6 21:29:10 2008 From: rowen at cesmail.net (Russell E. Owen) Date: Wed, 06 Feb 2008 12:29:10 -0800 Subject: [Pythonmac-SIG] Using py2app on 10.5 to build apps that run on 10.4? Message-ID: I'd love to upgrade to Leopard, but I maintain a python application that needs to run on 10.4 (and preferably 10.3.9). So...is it now practical to build 10.4-compatible applications using py2app on a 10.5 computer? What is involved? (For instance I remember reading that the built-in python needed some fixes for distutils to be able to make fat binaries, but I have no idea what the fixes are or how to install them). Does it help (or hurt?) if I use a 3rd party installation of Python, instead of the built in python? -- Russell From kw at codebykevin.com Wed Feb 6 22:02:13 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Wed, 06 Feb 2008 16:02:13 -0500 Subject: [Pythonmac-SIG] Using py2app on 10.5 to build apps that run on 10.4? In-Reply-To: References: Message-ID: <47AA2055.5070007@codebykevin.com> Russell E. Owen wrote: > I'd love to upgrade to Leopard, but I maintain a python application that > needs to run on 10.4 (and preferably 10.3.9). > > So...is it now practical to build 10.4-compatible applications using > py2app on a 10.5 computer? What is involved? (For instance I remember > reading that the built-in python needed some fixes for distutils to be > able to make fat binaries, but I have no idea what the fixes are or how > to install them). > > Does it help (or hurt?) if I use a 3rd party installation of Python, > instead of the built in python? > > -- Russell > As long as all the binary bits in your app bundle are compatible with 10.4, then you should be fine. I develop and build Phynchronicity (http://www.codebykevin.com/phynchronicity.html) on 10.5, and it runs with no problem on 10.4. I build everything using the "-mmacosx-version-min=10.4." This is using a custom build of Python 2.5.1 that links to Tk 8.5, my own build of Tk 8.5, and various Tk extensions. I can't speak for 10.3.9. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From servuz_max_guat at yahoo.de Wed Feb 6 22:42:50 2008 From: servuz_max_guat at yahoo.de (Max Guat) Date: Wed, 6 Feb 2008 21:42:50 +0000 (GMT) Subject: [Pythonmac-SIG] tkinter shows chinese instead of arabic, os x Message-ID: <512532.82947.qm@web26704.mail.ukl.yahoo.com> hello, my little lexicon-programm shows chinese (??) glyphs instead of arabic glyphs (tkinter, sqlite, python 2.5, os x - leopard). Especially, this appears in list- and entry-widgets; buttons are (rather) ok. File enconding, output to console is ok. Confusing enough, the same script works fine with Windows. any ideas? Thank you very much max guat Here are a description and screenshots in my blog: http://servuzmaxguat.wordpress.com/2008/01/24/tkinter-macos-und-arabisch/ __________________________________ Ihre erste Baustelle? Wissenswertes f?r Bastler und Hobby Handwerker. www.yahoo.de/clever -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20080206/98951359/attachment.htm From stephenlists at gmail.com Thu Feb 7 17:17:14 2008 From: stephenlists at gmail.com (Stephen Uhlhorn) Date: Thu, 7 Feb 2008 11:17:14 -0500 Subject: [Pythonmac-SIG] OS X leopard installation clarification Message-ID: Sorry, but I've been off the list for a couple of weeks, and I'm just trying to catch up on the mac os leopard status... If I understand this correctly: http://ipython.scipy.org/moin/InstallationOSXLeopard , I should stick with the system python and update readline, rather than maintain a separate python.org python, correct? But according to the notes at the bottom of the page, it sounds like if I update numpy, I could bust some system apps. I don't use pyobjc, but I work with numpy/scipy/matplotlib and like to keep these packages up to date. I worry about a new numpy breaking stuff. If I use the system python, will setuptools allow me to keep numpy up to date, without overt breakage? Thanks- -stephen From mhjorleifsson at mac.com Thu Feb 7 20:18:35 2008 From: mhjorleifsson at mac.com (Michele (Mike) Hjorleifsson) Date: Thu, 7 Feb 2008 14:18:35 -0500 Subject: [Pythonmac-SIG] what happened to idle ? In-Reply-To: References: Message-ID: <8AF670F2-EB91-43A7-AF0A-7B66B57F9FB5@mac.com> I installed leopard, pretty pumped that it has python 2.5 on it but i cant seem to find IDLE or a way to install IDLE without installing an external 2.5 which from the threads seems the wrong way to go. please help From Chris.Barker at noaa.gov Thu Feb 7 21:13:48 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 07 Feb 2008 12:13:48 -0800 Subject: [Pythonmac-SIG] module metrics and Framework comparisons In-Reply-To: <47A8645C.3020506@tds.net> References: <7CBF7AD0-2BB4-40D3-A37B-CE120BEB6561@avatar.com.au> <47A8645C.3020506@tds.net> Message-ID: <47AB667C.3080500@noaa.gov> Kent Johnson wrote: > The only Python desktop (not web) application framework under active > development that I know of is Dabo: > http://dabodev.com/ Well, that depends on how you define Application Framework. Many would give that name to wxPython, PyQT, PyGTK, PyObjC (cocoa), Tkinter -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From tobias.rodaebel at mac.com Fri Feb 8 10:55:08 2008 From: tobias.rodaebel at mac.com (=?ISO-8859-1?Q?Tobias_Rod=E4bel?=) Date: Fri, 8 Feb 2008 10:55:08 +0100 Subject: [Pythonmac-SIG] what happened to idle ? In-Reply-To: <8AF670F2-EB91-43A7-AF0A-7B66B57F9FB5@mac.com> References: <8AF670F2-EB91-43A7-AF0A-7B66B57F9FB5@mac.com> Message-ID: On 07.02.2008, at 20:18, Michele (Mike) Hjorleifsson wrote: > I installed leopard, pretty pumped that it has python 2.5 on it but i > cant seem to find IDLE or a way to install IDLE without installing an > external 2.5 which from the threads seems the wrong way to go. > please help Try /System/Library/Frameworks/Python.framework/Versions/Current/bin/ idle on the command line. From skip at pobox.com Sun Feb 10 03:21:00 2008 From: skip at pobox.com (skip at pobox.com) Date: Sat, 9 Feb 2008 20:21:00 -0600 Subject: [Pythonmac-SIG] Having trouble building Python w/ Tcl/Tk on my new Macbook Pro Message-ID: <18350.24460.204632.524763@montanaro-dyndns-org.local> I finally put my PowerBook G4 out to pasture and bought a MacBook Pro. I used SetupAssistant to transfer data from the old box to the new one. I'm having trouble building any version of _tkinter (from svn 2.5, trunk (2.6) or py3k) on my new box. Today I decided to debug the problem a bit. I'm getting this warning when linking _tkinter.so: ld: warning in /Library/Frameworks//Tcl.framework/Tcl, file is not of required architecture ld: warning in /Library/Frameworks//Tk.framework/Tk, file is not of required architecture which suggests to me that those versions of Tcl and Tk are probably PPC only. (I suspect old AquaTk frameworks copied over by SetupAssistant.) Looking in /Library/Frameworks I see drwxr-xr-x 6 root admin 204 Apr 29 2007 AquaTerm.framework drwxr-xr-x 6 root staff 204 Jan 26 2005 CamelBones.framework drwxrwxr-x 5 root admin 170 Aug 4 2007 FxPlug.framework drwxr-xr-x 10 root admin 340 Aug 15 2005 GMP.framework drwxrwxr-x 8 root admin 272 Jan 31 00:40 HPDeviceModel.framework drwxrwxr-x 6 root admin 204 Jan 31 00:40 HPPml.framework drwxrwxr-x 7 root admin 238 Jan 31 00:40 HPServicesInterface.framework drwxrwxr-x 7 root admin 238 Jan 31 00:40 HPSmartPrint.framework drwxrwxrwx 6 skip staff 204 Feb 8 2005 HaskellSupport.framework drwxr-xr-x 9 ellen wheel 306 Sep 6 2006 Mono.framework drwxrwxr-x 5 root admin 170 Aug 4 2007 PluginManager.framework drwxrwxr-x 4 root staff 136 Jun 20 2003 PrintMeSSL.framework drwxrwxr-x 5 root admin 170 Aug 4 2007 ProFX.framework drwxrwxr-x 7 skip admin 238 Apr 18 2007 Python.framework drwxrwxr-x 6 root admin 204 Jan 31 2005 SASL2.framework drwx------ 5 skip admin 170 May 2 2004 SDL.framework drwxrwxr-x@ 6 root admin 204 Sep 26 2005 StuffIt.framework drwxrwxr-x@ 5 root admin 170 Sep 26 2005 StuffItSupport.framework drwxr-xr-x 11 root admin 374 May 14 2004 Tcl.framework dr-xr-xr-x 11 root staff 374 May 14 2004 Tk.framework drwxrwxr-x@ 6 root admin 204 Jan 24 2002 XPrint2ModemCtrAPI.framework There are a number of frameworks there which look suspiciously old. How can I tell which are PPC and which are Intel? Is it okay to just remove the Tcl & Tk frameworks? (Renaming them caused the link to succeed.) I noticed much more recent versions in /System/Library/Frameworks. Thanks, Skip From kw at codebykevin.com Sun Feb 10 03:40:43 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Sat, 09 Feb 2008 21:40:43 -0500 Subject: [Pythonmac-SIG] Having trouble building Python w/ Tcl/Tk on my new Macbook Pro In-Reply-To: <18350.24460.204632.524763@montanaro-dyndns-org.local> References: <18350.24460.204632.524763@montanaro-dyndns-org.local> Message-ID: <47AE642B.6010103@codebykevin.com> skip at pobox.com wrote: > I finally put my PowerBook G4 out to pasture and bought a MacBook Pro. I > used SetupAssistant to transfer data from the old box to the new one. > > I'm having trouble building any version of _tkinter (from svn 2.5, trunk > (2.6) or py3k) on my new box. Today I decided to debug the problem a bit. > I'm getting this warning when linking _tkinter.so: > > ld: warning in /Library/Frameworks//Tcl.framework/Tcl, file is not of required architecture > ld: warning in /Library/Frameworks//Tk.framework/Tk, file is not of required architecture > > which suggests to me that those versions of Tcl and Tk are probably PPC > only. (I suspect old AquaTk frameworks copied over by SetupAssistant.) It looks like you were using PPC Tcl/Tk frameworks, which won't work well on Intel. Removing them is indeed the correct solution--Python will link to the native frameworks in /System/Library/Frameworks. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From njriley at uiuc.edu Sun Feb 10 03:33:46 2008 From: njriley at uiuc.edu (Nicholas Riley) Date: Sat, 9 Feb 2008 20:33:46 -0600 Subject: [Pythonmac-SIG] Having trouble building Python w/ Tcl/Tk on my new Macbook Pro In-Reply-To: <18350.24460.204632.524763@montanaro-dyndns-org.local> References: <18350.24460.204632.524763@montanaro-dyndns-org.local> Message-ID: On Feb 9, 2008, at 8:21 PM, skip at pobox.com wrote: > There are a number of frameworks there which look suspiciously old. > How can > I tell which are PPC and which are Intel? file(1) is probably easiest. You'll need to run them on the actual dylib inside the framework. For example: % file /Library/Frameworks/QtGui.framework/QtGui /Library/Frameworks/QtGui.framework/QtGui: Mach-O universal binary with 2 architectures /Library/Frameworks/QtGui.framework/QtGui (for architecture ppc): Mach- O dynamically linked shared library ppc /Library/Frameworks/QtGui.framework/QtGui (for architecture i386): Mach-O dynamically linked shared library i386 otool -fv works too but is considerably more verbose. > Is it okay to just remove the Tcl > & Tk frameworks? (Renaming them caused the link to succeed.) I > noticed > much more recent versions in /System/Library/Frameworks. Unless you've got something else that relies on them, I don't see why not. You should be able to nuke anything in /Library in general; it's supposed to be user-serviceable (or at least administrator-serviceable). -- Nicholas Riley | From skip at pobox.com Sun Feb 10 05:05:43 2008 From: skip at pobox.com (skip at pobox.com) Date: Sat, 9 Feb 2008 22:05:43 -0600 Subject: [Pythonmac-SIG] Having trouble building Python w/ Tcl/Tk on my new Macbook Pro In-Reply-To: <47AE642B.6010103@codebykevin.com> References: <18350.24460.204632.524763@montanaro-dyndns-org.local> <47AE642B.6010103@codebykevin.com> Message-ID: <18350.30743.564993.934782@montanaro-dyndns-org.local> Thanks Nicholas & Kevin for the hints about /Library and discovering the PPC-ed-ness of files. Skip From daniellord at mac.com Sun Feb 10 16:56:03 2008 From: daniellord at mac.com (Daniel Lord) Date: Sun, 10 Feb 2008 07:56:03 -0800 Subject: [Pythonmac-SIG] Having trouble building Python w/ Tcl/Tk on my new Macbook Pro In-Reply-To: <18350.30743.564993.934782@montanaro-dyndns-org.local> References: <18350.24460.204632.524763@montanaro-dyndns-org.local> <47AE642B.6010103@codebykevin.com> <18350.30743.564993.934782@montanaro-dyndns-org.local> Message-ID: <89E9332E-AE5C-47D5-8BE1-C4B128720639@mac.com> Or if you really want to get fancy and check your entire install: find -type f -exec file {} \; | grep "Mach-O object ppc" (I love UNIX ;-) On Feb 9, 2008, at 8:05 PM, skip at pobox.com wrote: > Thanks Nicholas & Kevin for the hints about /Library and discovering > the > PPC-ed-ness of files. > > Skip > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From hengist.podd at virgin.net Mon Feb 11 17:29:59 2008 From: hengist.podd at virgin.net (has) Date: Mon, 11 Feb 2008 16:29:59 +0000 Subject: [Pythonmac-SIG] py-appscript 0.19.0 preview Message-ID: <87D39738-05F6-4B85-86E6-D6953220434F@virgin.net> Hi all, If anyone's interested in checking out the next version of py- appscript, revision 461 moves the py-appscript-0.19.0 branch to the main trunk: svn checkout http://appscript.svn.sourceforge.net/svnroot/appscript/trunk py-appscript-0.19.0 Much clearing out of accumulated baggage has occurred since 0.18.x, bringing py-appscript more or less into line with rb-appscript. I've still to check that 64-bit support actually works (advice on how to build 4-way fat extensions on Leopard's Apple-installed Python would be appreciated), and there's a few other things still to do, but once all that's sorted I'm thinking of declaring it beta at long last. Comments, suggestions, offers of help, etc. welcome as always. Cheers, has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org From emoy at apple.com Mon Feb 11 20:16:16 2008 From: emoy at apple.com (Edward Moy) Date: Mon, 11 Feb 2008 11:16:16 -0800 Subject: [Pythonmac-SIG] py-appscript 0.19.0 preview In-Reply-To: <87D39738-05F6-4B85-86E6-D6953220434F@virgin.net> References: <87D39738-05F6-4B85-86E6-D6953220434F@virgin.net> Message-ID: See: http://developer.apple.com/releasenotes/OpenSource/PerlExtensionsRelNotes/ (which contrary to the name, is about building perl, python and ruby extensions universal). On Leopard, just set ARCHFLAGS to '-arch i386 - arch ppc -arch ppc64 -arch x86_64'. -------------------------------------------------------------------------- Edward Moy Apple Inc. emoy at apple.com On Feb 11, 2008, at 8:29 AM, has wrote: > Hi all, > > If anyone's interested in checking out the next version of py- > appscript, revision 461 moves the py-appscript-0.19.0 branch to the > main trunk: > > svn checkout http://appscript.svn.sourceforge.net/svnroot/appscript/trunk > py-appscript-0.19.0 > > Much clearing out of accumulated baggage has occurred since 0.18.x, > bringing py-appscript more or less into line with rb-appscript. > > I've still to check that 64-bit support actually works (advice on how > to build 4-way fat extensions on Leopard's Apple-installed Python > would be appreciated), and there's a few other things still to do, but > once all that's sorted I'm thinking of declaring it beta at long last. > > Comments, suggestions, offers of help, etc. welcome as always. > > Cheers, > > has > -- > http://appscript.sourceforge.net > http://rb-appscript.rubyforge.org > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------------------------------------------------------------------- Edward Moy Apple Inc. emoy at apple.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20080211/e9b3daa3/attachment.htm From hengist.podd at virgin.net Mon Feb 11 22:58:03 2008 From: hengist.podd at virgin.net (has) Date: Mon, 11 Feb 2008 21:58:03 +0000 Subject: [Pythonmac-SIG] py-appscript 0.19.0 preview In-Reply-To: References: <87D39738-05F6-4B85-86E6-D6953220434F@virgin.net> Message-ID: On 11 Feb 2008, at 19:16, Edward Moy wrote: > See: > > http://developer.apple.com/releasenotes/OpenSource/PerlExtensionsRelNotes/ > > (which contrary to the name, is about building perl, python and ruby > extensions universal). On Leopard, just set ARCHFLAGS to '-arch > i386 -arch ppc -arch ppc64 -arch x86_64'. Thanks, that did the trick. (My C-fu is poor, as you can tell.) Off to beat out the bugs... has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org From Chris.Barker at noaa.gov Thu Feb 14 00:21:18 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 13 Feb 2008 15:21:18 -0800 Subject: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app Message-ID: <47B37B6E.6070906@noaa.gov> Hi all, I generally use Terminal.app as my terminal with python. With all the default settings, it appears to be a showing up as an ascii terminal to python. This means that if I do: print UnicodeObject it tried to encode it as ascii, which often fails. However, it seems that OS-X is pretty unicode savy, so you'd think I should be able to do this. Indeed, if I go to setting, I see that under display, it's set to UTF-8. So how to I get Python to convert to utf-8 with a print statement, instead of ascii? thanks, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From skip at pobox.com Thu Feb 14 01:08:27 2008 From: skip at pobox.com (skip at pobox.com) Date: Wed, 13 Feb 2008 18:08:27 -0600 Subject: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app In-Reply-To: <47B37B6E.6070906@noaa.gov> References: <47B37B6E.6070906@noaa.gov> Message-ID: <18355.34427.28951.826944@montanaro-dyndns-org.local> Chris> So how to I get Python to convert to utf-8 with a print Chris> statement, instead of ascii? The print statement can't do it directly, but you can encode Unicode objects using different charsets then print the result. Try this: >>> unicode("\xef", "latin-1") u'\xef' >>> unicode("\xef", "latin-1").encode("utf-8") '\xc3\xaf' >>> print unicode("\xef", "latin-1").encode("utf-8") ? -- Skip Montanaro - skip at pobox.com - http://www.webfast.com/~skip/ From Chris.Barker at noaa.gov Thu Feb 14 01:27:53 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 13 Feb 2008 16:27:53 -0800 Subject: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app In-Reply-To: <18355.34427.28951.826944@montanaro-dyndns-org.local> References: <47B37B6E.6070906@noaa.gov> <18355.34427.28951.826944@montanaro-dyndns-org.local> Message-ID: <47B38B09.6020305@noaa.gov> skip at pobox.com wrote: > Chris> So how to I get Python to convert to utf-8 with a print > Chris> statement, instead of ascii? > > The print statement can't do it directly, but you can encode Unicode objects > using different charsets then print the result. Try this: > >>> print unicode("\xef", "latin-1").encode("utf-8") > ? Thanks skip, that works. Do what I'm doing is encoding the unicode object into a string with the utf-8 encoding. I'm surprised that that prints! I guess you can print any string, but I figured it would escape all the non-ascii values, and send that to the terminal. The question is, will this work on other terminals?? And here is the answer (from http://www.jorendorff.com/articles/unicode/python.html): """ To print data reliably, you must know the encoding that this display program expects. ... The Windows console still emulates CP437. So this print statement will work, on Windows, under a console window. # Windows console mode only >>> s = u'\N{POUND SIGN}' >>> print s.encode('cp-437') ? Several SSH clients display data using the Latin-1 character set; Tkinter assumes UTF-8, when 8-bit strings are passed into it. So in general it is not possible to determine what encoding to use with print. """ I suppose what I would like is if I could change the default encoding that str() uses -- or at least change it to "replace" or "ignore" mode. Boy, I'm looking forward to all-unicode, all the time. Thanks, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From kent37 at tds.net Thu Feb 14 04:12:05 2008 From: kent37 at tds.net (Kent Johnson) Date: Wed, 13 Feb 2008 22:12:05 -0500 Subject: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app In-Reply-To: <47B38B09.6020305@noaa.gov> References: <47B37B6E.6070906@noaa.gov> <18355.34427.28951.826944@montanaro-dyndns-org.local> <47B38B09.6020305@noaa.gov> Message-ID: <47B3B185.20907@tds.net> Christopher Barker wrote: > I suppose what I would like is if I could change the default encoding > that str() uses -- or at least change it to "replace" or "ignore" mode. You can, with sys.setdefaultencoding(). See here for discussion of how: http://blog.ianbicking.org/illusive-setdefaultencoding.html and here for arguments that this is a bad idea (mostly because it makes your code non-portable): http://faassen.n--tree.net/blog/view/weblog/2005/08/02/0 Kent From Chris.Barker at noaa.gov Thu Feb 14 21:10:51 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 14 Feb 2008 12:10:51 -0800 Subject: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app In-Reply-To: <47B3B185.20907@tds.net> References: <47B37B6E.6070906@noaa.gov> <18355.34427.28951.826944@montanaro-dyndns-org.local> <47B38B09.6020305@noaa.gov> <47B3B185.20907@tds.net> Message-ID: <47B4A04B.2070301@noaa.gov> Kent Johnson wrote: > You can, with sys.setdefaultencoding(). See here for discussion of how: > http://blog.ianbicking.org/illusive-setdefaultencoding.html > and here for arguments that this is a bad idea (mostly because it makes > your code non-portable): > http://faassen.n--tree.net/blog/view/weblog/2005/08/02/0 Thanks for the links. I'm nervous about messing with sys.setdefaultencoding() too - partly because I have no idea what all the implications are. It sure would be nice to be able to just change it for "print" though. Even if it's going to us ascii, it really should use "replace" or "ignore" -- it's much better to get something, rather than an error. It's just a handy utility function after all. Maybe I can re-map print to something like: TerminalEncoding = "utf-8" def uni_print(object): sys.stdout.write(unicode(object).encode(TerminalEncoding)) sys.stdout.write("\n") but print is a statement, rather than a function, so I don't know how to do that. I may start using a utility function like that for my code, though. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From robin at alldunn.com Thu Feb 14 22:44:26 2008 From: robin at alldunn.com (Robin Dunn) Date: Thu, 14 Feb 2008 13:44:26 -0800 Subject: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app In-Reply-To: <47B4A04B.2070301@noaa.gov> References: <47B37B6E.6070906@noaa.gov> <18355.34427.28951.826944@montanaro-dyndns-org.local> <47B38B09.6020305@noaa.gov> <47B3B185.20907@tds.net> <47B4A04B.2070301@noaa.gov> Message-ID: <47B4B63A.5050107@alldunn.com> Christopher Barker wrote: > Kent Johnson wrote: >> You can, with sys.setdefaultencoding(). See here for discussion of how: >> http://blog.ianbicking.org/illusive-setdefaultencoding.html > > > and here for arguments that this is a bad idea (mostly because it makes > > your code non-portable): > > http://faassen.n--tree.net/blog/view/weblog/2005/08/02/0 > > Thanks for the links. > > I'm nervous about messing with sys.setdefaultencoding() too - partly > because I have no idea what all the implications are. > > It sure would be nice to be able to just change it for "print" though. > Even if it's going to us ascii, it really should use "replace" or > "ignore" -- it's much better to get something, rather than an error. > It's just a handy utility function after all. > > Maybe I can re-map print to something like: > > TerminalEncoding = "utf-8" > def uni_print(object): > sys.stdout.write(unicode(object).encode(TerminalEncoding)) > sys.stdout.write("\n") > > > but print is a statement, rather than a function, so I don't know how to > do that. I may start using a utility function like that for my code, though. Just replace sys.stdout with an object with a write() method that does what you want. If you need to use the original stdout for the actual output then you can get to is from sys.__stdout__. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! From Chris.Barker at noaa.gov Fri Feb 15 00:11:57 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 14 Feb 2008 15:11:57 -0800 Subject: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app In-Reply-To: <47B4B63A.5050107@alldunn.com> References: <47B37B6E.6070906@noaa.gov> <18355.34427.28951.826944@montanaro-dyndns-org.local> <47B38B09.6020305@noaa.gov> <47B3B185.20907@tds.net> <47B4A04B.2070301@noaa.gov> <47B4B63A.5050107@alldunn.com> Message-ID: <47B4CABD.3090100@noaa.gov> Robin Dunn wrote: > Just replace sys.stdout with an object with a write() method that does > what you want. I don't think that will do it, as "print" will have already converted the object to a string, and it does that with str(), which calls object.__str__, which used the default encoding.... oh well, I'm really just whining, but this transition to unicode is pretty painful! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From robin at alldunn.com Fri Feb 15 02:48:13 2008 From: robin at alldunn.com (Robin Dunn) Date: Thu, 14 Feb 2008 17:48:13 -0800 Subject: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app In-Reply-To: <47B4CABD.3090100@noaa.gov> References: <47B37B6E.6070906@noaa.gov> <18355.34427.28951.826944@montanaro-dyndns-org.local> <47B38B09.6020305@noaa.gov> <47B3B185.20907@tds.net> <47B4A04B.2070301@noaa.gov> <47B4B63A.5050107@alldunn.com> <47B4CABD.3090100@noaa.gov> Message-ID: <47B4EF5D.1010302@alldunn.com> Christopher Barker wrote: > Robin Dunn wrote: >> Just replace sys.stdout with an object with a write() method that does >> what you want. > > I don't think that will do it, as "print" will have already converted > the object to a string, and it does that with str(), which calls > object.__str__, which used the default encoding.... Ah, you're right. I didn't think the process through far enough. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! From kent37 at tds.net Fri Feb 15 03:57:09 2008 From: kent37 at tds.net (Kent Johnson) Date: Thu, 14 Feb 2008 21:57:09 -0500 Subject: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app In-Reply-To: <47B4CABD.3090100@noaa.gov> References: <47B37B6E.6070906@noaa.gov> <18355.34427.28951.826944@montanaro-dyndns-org.local> <47B38B09.6020305@noaa.gov> <47B3B185.20907@tds.net> <47B4A04B.2070301@noaa.gov> <47B4B63A.5050107@alldunn.com> <47B4CABD.3090100@noaa.gov> Message-ID: <47B4FF85.6020701@tds.net> Christopher Barker wrote: > Robin Dunn wrote: >> Just replace sys.stdout with an object with a write() method that does >> what you want. > > I don't think that will do it, as "print" will have already converted > the object to a string, and it does that with str(), which calls > object.__str__, which used the default encoding.... That's what I thought, too, but a Q&D experiment seemed to work... Kent From kent37 at tds.net Fri Feb 15 04:00:28 2008 From: kent37 at tds.net (Kent Johnson) Date: Thu, 14 Feb 2008 22:00:28 -0500 Subject: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app In-Reply-To: <47B4FF85.6020701@tds.net> References: <47B37B6E.6070906@noaa.gov> <18355.34427.28951.826944@montanaro-dyndns-org.local> <47B38B09.6020305@noaa.gov> <47B3B185.20907@tds.net> <47B4A04B.2070301@noaa.gov> <47B4B63A.5050107@alldunn.com> <47B4CABD.3090100@noaa.gov> <47B4FF85.6020701@tds.net> Message-ID: <47B5004C.1090306@tds.net> Kent Johnson wrote: > Christopher Barker wrote: >> Robin Dunn wrote: >>> Just replace sys.stdout with an object with a write() method that does >>> what you want. >> I don't think that will do it, as "print" will have already converted >> the object to a string, and it does that with str(), which calls >> object.__str__, which used the default encoding.... > > That's what I thought, too, but a Q&D experiment seemed to work... Here it is: In [4]: s = u'\xe3' In [5]: print s ------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in : 'ascii' codec can't encode character u'\xe3' in position 0: ordinal not in range(128) In [6]: print s.encode('utf-8') ? In [7]: import sys In [8]: class convert(object): ...: def write(self, s): ...: if isinstance(s, unicode): ...: s = s.encode('utf-8') ...: sys.__stdout__.write(s) ...: ...: In [9]: sys.stdout = convert() In [10]: print s ? I guess the conversion actually happens in sys.stdout.write(), not in print. Kent From robin at alldunn.com Fri Feb 15 04:25:52 2008 From: robin at alldunn.com (Robin Dunn) Date: Thu, 14 Feb 2008 19:25:52 -0800 Subject: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app In-Reply-To: <47B5004C.1090306@tds.net> References: <47B37B6E.6070906@noaa.gov> <18355.34427.28951.826944@montanaro-dyndns-org.local> <47B38B09.6020305@noaa.gov> <47B3B185.20907@tds.net> <47B4A04B.2070301@noaa.gov> <47B4B63A.5050107@alldunn.com> <47B4CABD.3090100@noaa.gov> <47B4FF85.6020701@tds.net> <47B5004C.1090306@tds.net> Message-ID: <47B50640.5090604@alldunn.com> Kent Johnson wrote: > > I guess the conversion actually happens in sys.stdout.write(), not in print. That's good to know, thanks for trying it out. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! From ronaldoussoren at mac.com Fri Feb 15 13:42:47 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 15 Feb 2008 13:42:47 +0100 Subject: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app In-Reply-To: <47B4CABD.3090100@noaa.gov> References: <47B37B6E.6070906@noaa.gov> <18355.34427.28951.826944@montanaro-dyndns-org.local> <47B38B09.6020305@noaa.gov> <47B3B185.20907@tds.net> <47B4A04B.2070301@noaa.gov> <47B4B63A.5050107@alldunn.com> <47B4CABD.3090100@noaa.gov> Message-ID: On 15 Feb, 2008, at 0:11, Christopher Barker wrote: > Robin Dunn wrote: >> Just replace sys.stdout with an object with a write() method that >> does >> what you want. > > I don't think that will do it, as "print" will have already converted > the object to a string, and it does that with str(), which calls > object.__str__, which used the default encoding.... > > oh well, I'm really just whining, but this transition to unicode is > pretty painful! On my system print u"text" already does the right thing, even when the text contain non-ascii characters. This is with the system install of python. >>> import sys >>> sys.getdefaultencoding() 'ascii' >>> sys.stdout.encoding 'UTF-8' That's because the system (OSX 10.5) has set an environment variable that Python knows about: LANG=en_US.UTF-8. YMMV, Ronald > > > -Chris > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From erik at letterror.com Sat Feb 16 13:45:09 2008 From: erik at letterror.com (Erik van Blokland) Date: Sat, 16 Feb 2008 13:45:09 +0100 Subject: [Pythonmac-SIG] CoreGraphics, 10.5 Message-ID: Folks, I've been wrestling with some CoreGraphics stuff, OSX 10.5.2, stock Python 2.5.1. I want to load a RGB image, then load a grayscale image, draw one while using the other as a mask. I can build all the required objects. I can draw with "masking-like things" happening to the image. But the masking appears to be according to a (random) piece of memory, rather than the pixels from the mask image. The RGB image: http://erik.letterror.com/cg/picture.png The grayscale mask: http://erik.letterror.com/cg/mask.tif The resulting image: http://erik.letterror.com/cg/results.png The script: http://erik.letterror.com/cg/cgMaskTestPost.py The script which draws this file is below. Yellow background, rgb image of a neon sign, mask. I get the impression I'm somehow not making the right kind of mask. Or perhaps the parameters I'm passing to it are wrong. Perhaps the mask image is wrong. I've tried black/ white bitmaps, tiff, jpeg, png, grayscale 8 bit, 24 bit. Different formats result in different patterns being used as a mask - so there is some correlation between the file and the result. Is this anywhere close to how it needs to be done? Any pointers are most welcome, thanks! Erik van Blokland #! /usr/bin/python2.5 from CoreGraphics import * import os def test(): testWidth = 1000 testHeight = 500 fileName = 'picture.png' # name of a 8 bit PNG, RGB image maskName = 'mask.tif' # name of an 8 bit, grayscale tiff # the paths root = os.getcwd() filePath = os.path.join(root,fileName) maskPath = os.path.join(root,maskName) dstPath = os.path.join(root, "results.png") # data providers for the image and the mask img = CGImageImport(CGDataProviderCreateWithFilename(filePath)) maskProvider = CGDataProviderCreateWithFilename(maskPath) imgMask = CGImageImport(maskProvider) # first, let's find out some things about the mask. width = imgMask.getWidth() height = imgMask.getHeight() bitsPerComponent = imgMask.getBitsPerComponent() bitsPerPixel = imgMask.getBitsPerPixel() bytesPerRow = imgMask.getBytesPerRow() shouldInterpolate = True decode = [0,255] # not relevant? # make the mask maskObject = CGImageMaskCreate(width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, maskProvider, decode, shouldInterpolate) # now make the image with source image AND mask imgWithMask = CGImage_createWithMask(img, maskObject) # make a new image to save it all ctx = CGBitmapContextCreateWithColor(testWidth, testHeight, CGColorSpaceCreateDeviceRGB(), (0,0,0,0)) # a background color ctx.setRGBFillColor(.9, .9, 0, .8) ctx.addRect(CGRectMake(0, 0, testWidth, testHeight)) ctx.fillPath() # draw the masked image ctx.drawImage(CGRectMake(50, 50, width, height), imgWithMask) CGContext_writeToFile(ctx, dstPath, kCGImageFormatPNG) print "done" if __name__ == "__main__": test() -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20080216/6c1871d1/attachment.htm From Jack.Jansen at cwi.nl Mon Feb 18 09:30:34 2008 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon, 18 Feb 2008 09:30:34 +0100 Subject: [Pythonmac-SIG] CoreGraphics, 10.5 In-Reply-To: References: Message-ID: Are you sure your mask is actually greyscale? If I looks as if there's a repeating pattern in your result image. Maybe you could also use an assert to make sure bitsPerComponent() == bitsPerPixel() and #components==1. On 16-Feb-2008, at 13:45 , Erik van Blokland wrote: > > Folks, > > I've been wrestling with some CoreGraphics stuff, OSX 10.5.2, stock > Python 2.5.1. I want to load a RGB image, then load a grayscale > image, draw one while using the other as a mask. I can build all > the required objects. I can draw with "masking-like things" > happening to the image. But the masking appears to be according to > a (random) piece of memory, rather than the pixels from the mask > image. > > The RGB image: > http://erik.letterror.com/cg/picture.png > > The grayscale mask: > http://erik.letterror.com/cg/mask.tif > > The resulting image: > http://erik.letterror.com/cg/results.png > > The script: > http://erik.letterror.com/cg/cgMaskTestPost.py > > The script which draws this file is below. Yellow background, rgb > image of a neon sign, mask. I get the impression I'm somehow not > making the right kind of mask. Or perhaps the parameters I'm > passing to it are wrong. Perhaps the mask image is wrong. I've > tried black/white bitmaps, tiff, jpeg, png, grayscale 8 bit, 24 > bit. Different formats result in different patterns being used as a > mask - so there is some correlation between the file and the > result. Is this anywhere close to how it needs to be done? > > Any pointers are most welcome, thanks! > > Erik van Blokland > > > > > #! /usr/bin/python2.5 > > from CoreGraphics import * > import os > > def test(): > testWidth = 1000 > testHeight = 500 > fileName = 'picture.png' # name of a 8 bit PNG, RGB image > maskName = 'mask.tif' # name of an 8 bit, grayscale tiff > # the paths > root = os.getcwd() > filePath = os.path.join(root,fileName) > maskPath = os.path.join(root,maskName) > dstPath = os.path.join(root, "results.png") > > # data providers for the image and the mask > img = CGImageImport(CGDataProviderCreateWithFilename(filePath)) > maskProvider = CGDataProviderCreateWithFilename(maskPath) > imgMask = CGImageImport(maskProvider) > > # first, let's find out some things about the mask. > width = imgMask.getWidth() > height = imgMask.getHeight() > bitsPerComponent = imgMask.getBitsPerComponent() > bitsPerPixel = imgMask.getBitsPerPixel() > bytesPerRow = imgMask.getBytesPerRow() > shouldInterpolate = True > decode = [0,255] # not relevant? > # make the mask > maskObject = CGImageMaskCreate(width, height, > bitsPerComponent, bitsPerPixel, > bytesPerRow, maskProvider, > decode, shouldInterpolate) > # now make the image with source image AND mask > imgWithMask = CGImage_createWithMask(img, maskObject) > # make a new image to save it all > ctx = CGBitmapContextCreateWithColor(testWidth, testHeight, > CGColorSpaceCreateDeviceRGB(), (0,0,0,0)) > # a background color > ctx.setRGBFillColor(.9, .9, 0, .8) > ctx.addRect(CGRectMake(0, 0, testWidth, testHeight)) > ctx.fillPath() > # draw the masked image > ctx.drawImage(CGRectMake(50, 50, width, height), imgWithMask) > CGContext_writeToFile(ctx, dstPath, kCGImageFormatPNG) > print "done" > > if __name__ == "__main__": > test() > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20080218/3a2660d3/attachment.htm From erik at letterror.com Mon Feb 18 18:33:36 2008 From: erik at letterror.com (Erik van Blokland) Date: Mon, 18 Feb 2008 18:33:36 +0100 Subject: [Pythonmac-SIG] CoreGraphics, 10.5 In-Reply-To: References: Message-ID: <1D4661D2-80CA-42F8-8ADF-57FFDC4BAD3F@letterror.com> On 18 feb 2008, at 09:30, Jack Jansen wrote: >> Are you sure your mask is actually greyscale? If I looks as if >> there's a repeating pattern in your result image. Maybe you could >> also use an assert to make sure bitsPerComponent() == >> bitsPerPixel() and #components==1. The mask.tif file checks for 8 bit grayscale in photoshop. When I load the image first, this works: bitsPerPixel = imgMask.getBitsPerPixel() bytesPerRow = imgMask.getBytesPerRow() assert bitsPerComponent == bitsPerPixel cs = imgMask.getColorSpace() print "img getNumberOfComponents", cs.getNumberOfComponents() >> img getNumberOfComponents 1 When I build the mask object, this works as well: maskObject = CGImageMaskCreate(width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, maskProvider, decode, shouldInterpolate) bitsPerComponent = maskObject.getBitsPerComponent() bitsPerPixel = maskObject.getBitsPerPixel() assert bitsPerComponent == bitsPerPixel The mask object returns None for getColorSpace(). So, the image checks for 1 component and 8 bits, but I don't know whether the mask itself should. I've posted the updated test script here: http://erik.letterror.com/cg/cgMaskTestPost.py Thanks for looking though! :) Erik >> On 16-Feb-2008, at 13:45 , Erik van Blokland wrote: >> >>> >>> Folks, >>> >>> I've been wrestling with some CoreGraphics stuff, OSX 10.5.2, >>> stock Python 2.5.1. I want to load a RGB image, then load a >>> grayscale image, draw one while using the other as a mask. I can >>> build all the required objects. I can draw with "masking-like >>> things" happening to the image. But the masking appears to be >>> according to a (random) piece of memory, rather than the pixels >>> from the mask image. >>> >>> The RGB image: >>> http://erik.letterror.com/cg/picture.png >>> >>> The grayscale mask: >>> http://erik.letterror.com/cg/mask.tif >>> >>> The resulting image: >>> http://erik.letterror.com/cg/results.png >>> >>> The script: >>> http://erik.letterror.com/cg/cgMaskTestPost.py >>> >>> The script which draws this file is below. Yellow background, rgb >>> image of a neon sign, mask. I get the impression I'm somehow not >>> making the right kind of mask. Or perhaps the parameters I'm >>> passing to it are wrong. Perhaps the mask image is wrong. I've >>> tried black/white bitmaps, tiff, jpeg, png, grayscale 8 bit, 24 >>> bit. Different formats result in different patterns being used as >>> a mask - so there is some correlation between the file and the >>> result. Is this anywhere close to how it needs to be done? >>> >>> Any pointers are most welcome, thanks! >>> >>> Erik van Blokland >>> >>> From hexsprite at gmail.com Tue Feb 19 18:56:47 2008 From: hexsprite at gmail.com (hexsprite) Date: Tue, 19 Feb 2008 09:56:47 -0800 (PST) Subject: [Pythonmac-SIG] py2app error with pygraphviz module Message-ID: <15561550.post@talk.nabble.com> I am using py2app to create an application that has a dependency on pygraphviz module. It builds fine but when I run it I get the following error in the console: ----- 19/02/08 11:18:14 AM PPM[7521] PPM Error An unexpected error has occurred during execution of the main script ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/pygraphviz/_graphviz.so' not found ---- I checked that the library was copied and sure it enough here it is: ------ total 240 drwxr-xr-x 3 jordan jordan 102 19 Feb 11:11 . drwxr-xr-x 4 jordan jordan 136 19 Feb 11:11 .. -rw-r--r-- 1 jordan jordan 120996 19 Feb 11:11 _graphviz.so jordan at nada pygraphviz $ pwd /Users/jordan/Code/willppm/dist/PPM.app/Contents/Resources/lib/python2.5/lib-dynload/pygraphviz jordan at nada pygraphviz $ ------- For some reason it is not using the packaged version of this SO. Any ideas why? Thanks -hex. -- View this message in context: http://www.nabble.com/py2app-error-with-pygraphviz-module-tp15561550p15561550.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. From hexsprite at gmail.com Tue Feb 19 17:26:46 2008 From: hexsprite at gmail.com (hexsprite) Date: Tue, 19 Feb 2008 08:26:46 -0800 (PST) Subject: [Pythonmac-SIG] py2app error with pygraphviz module Message-ID: <15561550.post@talk.nabble.com> I am using py2app to create an application that has a dependency on pygraphviz module. It builds fine but when I run it I get the following error in the console: ----- 19/02/08 11:18:14 AM PPM[7521] PPM Error An unexpected error has occurred during execution of the main script ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/pygraphviz/_graphviz.so' not found ---- I checked that the library was copied and sure it enough here it is: ------ total 240 drwxr-xr-x 3 jordan jordan 102 19 Feb 11:11 . drwxr-xr-x 4 jordan jordan 136 19 Feb 11:11 .. -rw-r--r-- 1 jordan jordan 120996 19 Feb 11:11 _graphviz.so jordan at nada pygraphviz $ pwd /Users/jordan/Code/willppm/dist/PPM.app/Contents/Resources/lib/python2.5/lib-dynload/pygraphviz jordan at nada pygraphviz $ ------- For some reason it is not using the packaged version of this SO. Any ideas why? Thanks -hex. -- View this message in context: http://www.nabble.com/py2app-error-with-pygraphviz-module-tp15561550p15561550.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. From stephenlists at gmail.com Thu Feb 21 16:59:48 2008 From: stephenlists at gmail.com (Stephen Uhlhorn) Date: Thu, 21 Feb 2008 10:59:48 -0500 Subject: [Pythonmac-SIG] uninstalling macpython Message-ID: Hello- How do I uninstall MacPython cleanly from my leopard system? I'd like to revert to the system python without reinstalling the entire OS. Do I just zap /Library/Frameworks/Python.Framework and fix my PATH? Or, are there other considerations? Thanks- -stephen From kw at codebykevin.com Thu Feb 21 17:12:03 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Thu, 21 Feb 2008 11:12:03 -0500 Subject: [Pythonmac-SIG] uninstalling macpython In-Reply-To: References: Message-ID: <47BDA2D3.1040500@codebykevin.com> Stephen Uhlhorn wrote: > Hello- > > How do I uninstall MacPython cleanly from my leopard system? I'd like > to revert to the system python without reinstalling the entire OS. Do > I just zap /Library/Frameworks/Python.Framework and fix my PATH? Or, > are there other considerations? > That should do it. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From ronaldoussoren at mac.com Fri Feb 22 15:37:42 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 22 Feb 2008 15:37:42 +0100 Subject: [Pythonmac-SIG] uninstalling macpython In-Reply-To: <47BDA2D3.1040500@codebykevin.com> References: <47BDA2D3.1040500@codebykevin.com> Message-ID: On 21 Feb, 2008, at 17:12, Kevin Walzer wrote: > Stephen Uhlhorn wrote: >> Hello- >> >> How do I uninstall MacPython cleanly from my leopard system? I'd like >> to revert to the system python without reinstalling the entire OS. Do >> I just zap /Library/Frameworks/Python.Framework and fix my PATH? Or, >> are there other considerations? >> > > That should do it. Don't forget to remove /Applications/MacPython 2.5 and the symlinks in /usr/local/bin. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20080222/4aacca43/attachment.bin From matthias.baas at gmail.com Fri Feb 22 21:17:23 2008 From: matthias.baas at gmail.com (Matthias Baas) Date: Fri, 22 Feb 2008 20:17:23 +0000 Subject: [Pythonmac-SIG] Creating binary packages on OSX Message-ID: <47BF2DD3.6060709@gmail.com> Hi, I have a question about distributing binary package on OSX (I'm still rather new to OSX but now that I have a Mac I'd like to provide an OSX binary of an Open Source package of mine). I was using the bdist_mpkg distutils extension to create a binary and could turn that into a *.dmg. Testing this installer on my own machine works fine. So generating the binary is no problem at all (thanks to all who contributed to this distutils extension! Great work! I hope this will make it into the official Python build eventually) My question is rather about the requirements of the generated installer, i.e. who can use it to install the package? Does the installer only work with MacPython or will it work with any version of Python (provided that the version number matches, of course)? Does the installer just copy the files into a predefined directory that must be the same on all machines or is it like the Windows installer and it figures out itself where Python is installed and puts the files into the correct location? I'm creating the binary on Tiger. Will the binary work on Leopard as well or does this require a recompile? Is there anything else that needs to be considered to get a "true" OSX binary package? (I made sure everything was compiled as a universal binary, but that's about it) I'm grateful for any infos on how to properly create a binary package on OSX. Cheers, - Matthias - From rowen at cesmail.net Sat Feb 23 00:23:03 2008 From: rowen at cesmail.net (Russell E. Owen) Date: Fri, 22 Feb 2008 15:23:03 -0800 Subject: [Pythonmac-SIG] Using py2app on 10.5 to build apps that run on 10.4? References: <47AA2055.5070007@codebykevin.com> Message-ID: In article <47AA2055.5070007 at codebykevin.com>, Kevin Walzer wrote: > Russell E. Owen wrote: > > I'd love to upgrade to Leopard, but I maintain a python application that > > needs to run on 10.4 (and preferably 10.3.9). > > > > So...is it now practical to build 10.4-compatible applications using > > py2app on a 10.5 computer? What is involved? (For instance I remember > > reading that the built-in python needed some fixes for distutils to be > > able to make fat binaries, but I have no idea what the fixes are or how > > to install them). > > > > Does it help (or hurt?) if I use a 3rd party installation of Python, > > instead of the built in python? > > > > -- Russell > > > > As long as all the binary bits in your app bundle are compatible with > 10.4, then you should be fine. > > I develop and build Phynchronicity > (http://www.codebykevin.com/phynchronicity.html) on 10.5, and it runs > with no problem on 10.4. I build everything using the > "-mmacosx-version-min=10.4." This is using a custom build of Python > 2.5.1 that links to Tk 8.5, my own build of Tk 8.5, and various Tk > extensions. > > I can't speak for 10.3.9. Thank you very much. So if I understand this right...as long as I install a python that was built with the -mmacosx-version-min=10.4 flag then distutils will automatically build python packages using the same flag. (Of course I can also install 10.4-compatible package binaries, but I'm hoping to upgrade to Tcl/Tk 8.5 and I doubt I'll find binaries for that.) If so...does it suffice to use the Mac Python binaries that were built to be compatible with 10.4 or must I compile my own python and explicitly add use that flag? -- Russell From rowen at cesmail.net Sat Feb 23 00:32:43 2008 From: rowen at cesmail.net (Russell E. Owen) Date: Fri, 22 Feb 2008 15:32:43 -0800 Subject: [Pythonmac-SIG] Creating binary packages on OSX References: <47BF2DD3.6060709@gmail.com> Message-ID: In article <47BF2DD3.6060709 at gmail.com>, Matthias Baas wrote: > Hi, > > I have a question about distributing binary package on OSX (I'm still > rather new to OSX but now that I have a Mac I'd like to provide an OSX > binary of an Open Source package of mine). > I was using the bdist_mpkg distutils extension to create a binary and > could turn that into a *.dmg. Testing this installer on my own machine > works fine. So generating the binary is no problem at all (thanks to all > who contributed to this distutils extension! Great work! I hope this > will make it into the official Python build eventually) > My question is rather about the requirements of the generated installer, > i.e. who can use it to install the package? Does the installer only work > with MacPython or will it work with any version of Python (provided that > the version number matches, of course)? Does the installer just copy the > files into a predefined directory that must be the same on all machines > or is it like the Windows installer and it figures out itself where > Python is installed and puts the files into the correct location? > I'm creating the binary on Tiger. Will the binary work on Leopard as > well or does this require a recompile? > > Is there anything else that needs to be considered to get a "true" OSX > binary package? (I made sure everything was compiled as a universal > binary, but that's about it) > > I'm grateful for any infos on how to properly create a binary package on > OSX. I'm sure others can speak with more authority, but I believe that your package will be compatible with any *framework* python (as long as the first two version fields match). It will not be compatible with non-framework pythons such as fink python (at least at one time). Thus if a user has installed a framework python (in /Library/Frameworks or /Users//Library/Frameworks) then your package will be installed in that python's site-packages directory. This is buried deep in the framework. If the user has not installed a framework python then your package will be installed in the built-in python's site-packages directory (which on 10.4 is /Library/Python/2.3; I have no idea where it is on 10.5). -- Russell From kw at codebykevin.com Sat Feb 23 03:26:18 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Fri, 22 Feb 2008 21:26:18 -0500 Subject: [Pythonmac-SIG] Using py2app on 10.5 to build apps that run on 10.4? In-Reply-To: References: <47AA2055.5070007@codebykevin.com> Message-ID: <47BF844A.5070305@codebykevin.com> Russell E. Owen wrote: > Thank you very much. > > So if I understand this right...as long as I install a python that was > built with the -mmacosx-version-min=10.4 flag then distutils will > automatically build python packages using the same flag. (Of course I > can also install 10.4-compatible package binaries, but I'm hoping to > upgrade to Tcl/Tk 8.5 and I doubt I'll find binaries for that.) I think that's correct. > > If so...does it suffice to use the Mac Python binaries that were built > to be compatible with 10.4 or must I compile my own python and > explicitly add use that flag? I can't speak for every package, but I am using my own build of Python that links to Tk 8.5. The stock MacPython links to 8.4 and won't work with 8.5. I built Python and Tk to support 10.4 and they seem to work fine. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From j.foster.davis at gmail.com Sun Feb 24 00:01:29 2008 From: j.foster.davis at gmail.com (Jacob Davis) Date: Sat, 23 Feb 2008 15:01:29 -0800 Subject: [Pythonmac-SIG] Using SM2DGraphView (or any graphing utility) Message-ID: <1BC6C8B0-5A21-4F92-A98A-42D0CF5FC3E1@gmail.com> Hi. I am looking for help namely with SM2DGraphView, but if you know another package/utility that is easy to do basic line graphing/ plotting with, that would also help. I am trying to get SM2DGraphView to work in an app I am making with Xcode and Interface Builder 3.0. I don't know pyobjc at all really, and I am somewhat new to Interface Builder. I have installed the framework and the palette. I have an app that will show the graph, but I can't figure out how to get data from my python script into the data of the SM2DGraph. I can't really understand SM2DGraphView's online documentation... I understand that I need to implement some classes and methods, but I am almost completely lost. This article on macresearch (http://www.macresearch.org/cocoa_for_scientists_part_xviii_graphing_data_with_sm2dgraphview ) shows how to get SM2DGraphView to work using objc... if anybody can translate this so that I can just use python, that would be great. Any help is appreciated. Any push in the right direction is helpful! Thanks in advance, Jake From justlists at gmail.com Sun Feb 24 05:19:26 2008 From: justlists at gmail.com (jane doe) Date: Sat, 23 Feb 2008 20:19:26 -0800 Subject: [Pythonmac-SIG] installing python and mysqldb Message-ID: <3b7670da0802232019mf71122bgeb48f5af3865e226@mail.gmail.com> Hello, You are hearing from one tired puppy. I have been wrestling with different directories, reading umpteen web pages, sifting through postings, re-installing, and re-locating, and resetting paths, and all that jazz. I think I'm partially insane now. After about 5 days solid, trying to slog through this, I'm asking for some help. Question: If I were to start all over again, which download site do you recommend? I would like to know, if there is anyone out there who knows which directory to be in, to be sure config files or directories or paths are correct, so that this will work. PLEASE!!!!!!!!! My machine is OS X 10.4, I have Python 2.3.5 or MacPython 2.4.4, Mysql 14.7, and I installed mysqldb 1.2.2 (but the contents look like they were 1.2.1?) 1000 humble Thanks.... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20080223/832016bd/attachment.htm From Chris.Barker at noaa.gov Mon Feb 25 18:16:17 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 25 Feb 2008 09:16:17 -0800 Subject: [Pythonmac-SIG] installing python and mysqldb In-Reply-To: <3b7670da0802232019mf71122bgeb48f5af3865e226@mail.gmail.com> References: <3b7670da0802232019mf71122bgeb48f5af3865e226@mail.gmail.com> Message-ID: <47C2F7E1.4000108@noaa.gov> jane doe wrote: > If I were to start all over again, which download site do you recommend? Did you try these?: http://pythonmac.org/packages/py24-fat/index.html > My machine is OS X 10.4, I have Python 2.3.5 or MacPython 2.4.4, Mysql > 14.7, and I installed > mysqldb 1.2.2 (but the contents look like they were 1.2.1?) I'd go with MacPython2.4 or, better yet, MacPython 2.5, if you don't need to stick with 2.4. What did you actually try? Downloading the tarball and: python setup.py build sudo python setup.py install Should work, but I haven't tried it. Tell us what happens when you try it. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From Chris.Barker at noaa.gov Mon Feb 25 18:17:59 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 25 Feb 2008 09:17:59 -0800 Subject: [Pythonmac-SIG] Using SM2DGraphView (or any graphing utility) In-Reply-To: <1BC6C8B0-5A21-4F92-A98A-42D0CF5FC3E1@gmail.com> References: <1BC6C8B0-5A21-4F92-A98A-42D0CF5FC3E1@gmail.com> Message-ID: <47C2F847.90206@noaa.gov> Jacob Davis wrote: > I am looking for help namely with SM2DGraphView, but if you know > another package/utility that is easy to do basic line graphing/ > plotting with, that would also help. Matplotlib is pretty nice, and widely used. It has a Cocoa back-0end, but I don't know how mature it is. It does work well with TK, GTK, wx and QT. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From hraban at fiee.net Mon Feb 25 20:02:04 2008 From: hraban at fiee.net (Henning Hraban Ramm) Date: Mon, 25 Feb 2008 20:02:04 +0100 Subject: [Pythonmac-SIG] Path conversions Message-ID: <1DEC1FE2-78D8-4BBF-ABBC-67474807A158@fiee.net> I guess this is a FAQ, but I couldn't find an answer that fits my needs... Normally you use unicode paths (with os.sep) with python. For appscript you need AppleScript file aliases (or how they're called). Additionally OSX' file system uses decomposed UTF-8, while most applications use composed UTF-8. Two different conversions that I struggle with all the time, and I'm very unhappy with my own "solutions". Up to Python 2.4 there was the macfile module (or was it part of appscript?) with its Alias object. Now it's gone. (Even if I don't know if it would fit my needs.) There's still the undocumented Carbon.File. (Would I use FSRef?) Or one could use PyObjC. (I'd like to avoid C syntax.) Or perhaps use the POSIX function from AS' StandardAdditions. (How do I call them with appscript?) And probably I overlooked some other possibilities. Please, are there any best practices to cope with OSX file paths? E.g.: I get a filename via sys.argv. It may contain international letters and spaces. It may even contain slashes if the volume was written with OS9. It might be a relative path. It's in the default encoding of the shell, or isn't it? * open that file - ok, should work without conversions. * open that file with some application via appscript -> convert the name to a valid "old style Mac path". (-> Absolute path, add volume name etc.) * write that filename into a file to be processed by e.g. TeX -> convert to composed UTF-8. * display that filename in some wxPython/dabo widget -> I still don't understand what encoding that needs, seems to differ by widget (label vs. tree view vs. status line). * other possibilities of output: print to stdout (encoding?), growl, database... Maybe I overlooked some basics of Python's Unicode handling, but my main problem at the moment are those Mac paths for appscript. Please help? Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From robcander at mac.com Wed Feb 27 19:51:09 2008 From: robcander at mac.com (Robert Anderson) Date: Wed, 27 Feb 2008 18:51:09 +0000 Subject: [Pythonmac-SIG] Python module installation on Leopard runs but doesn't install Message-ID: <4DD64DA5-B034-4FB0-B567-96EDADB9E799@mac.com> I am a new user to Python on Mac (Leopard) and am having a problem installing modules. I have seen various mails about directory problems with Python Leopard and I am not sure if they relate to my particular problem. I am running a factory installation of Leopard and command line Python appears to run OK. However, when I attempted to install a downloaded package, PYTZ for example, the installation failed with a message "... requires System Python to install...". From the Python website I found the following link concerned with installing additional items, in particular IDLE: http://wiki.python.org/moin/MacPython/Leopard I followed the instructions and command line Python still works, IDLE works and the installations now appear to work, however, nothing appears to have been installed and the downloaded(?) modules cannot be imported. Can anyone provide any suggestions on what I should try next? Thanks in advance Robert Anderson From Chris.Barker at noaa.gov Wed Feb 27 20:43:48 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 27 Feb 2008 11:43:48 -0800 Subject: [Pythonmac-SIG] Python module installation on Leopard runs but doesn't install In-Reply-To: <4DD64DA5-B034-4FB0-B567-96EDADB9E799@mac.com> References: <4DD64DA5-B034-4FB0-B567-96EDADB9E799@mac.com> Message-ID: <47C5BD74.90505@noaa.gov> Robert Anderson wrote: > I am running a factory installation of Leopard and command line Python > appears to run OK. However, when I attempted to install a downloaded > package, PYTZ for example, where are you downloading it from, and in what form? If it's a .mpgk, or .pkg, then it was built for a particular python install, probably MacPython, not Apple's. So you need to either find a package built for Leopard's python, or download a tarball and install it with distutils (python setup.py install). if there are eggs available, they MIGHT work, too. > From the Python website I found the following link concerned with > installing additional items, in particular IDLE: > > http://wiki.python.org/moin/MacPython/Leopard That hack should work for any other package built for MacPython2.5 -- you'll have to give us more details as to exactly what you did, and what happened. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From nad at acm.org Wed Feb 27 21:57:13 2008 From: nad at acm.org (Ned Deily) Date: Wed, 27 Feb 2008 12:57:13 -0800 Subject: [Pythonmac-SIG] Path conversions References: <1DEC1FE2-78D8-4BBF-ABBC-67474807A158@fiee.net> Message-ID: In article <1DEC1FE2-78D8-4BBF-ABBC-67474807A158 at fiee.net>, Henning Hraban Ramm wrote: > Maybe I overlooked some basics of Python's Unicode handling, but my > main problem at the moment are those Mac paths for appscript. The macfile module of py-appscript was renamed to mactypes. So, with the lastest versions of py-appscript, you'll need to change macfile.Alias() to mactypes.Alias(). See the doc files included with the py-appscript source download: . -- Ned Deily, nad at acm.org From rowen at cesmail.net Wed Feb 27 21:57:42 2008 From: rowen at cesmail.net (Russell E. Owen) Date: Wed, 27 Feb 2008 12:57:42 -0800 Subject: [Pythonmac-SIG] Python module installation on Leopard runs but doesn't install References: <4DD64DA5-B034-4FB0-B567-96EDADB9E799@mac.com> <47C5BD74.90505@noaa.gov> Message-ID: In article <47C5BD74.90505 at noaa.gov>, Christopher Barker wrote: > Robert Anderson wrote: > > I am running a factory installation of Leopard and command line Python > > appears to run OK. However, when I attempted to install a downloaded > > package, PYTZ for example, > > where are you downloading it from, and in what form? > > If it's a .mpgk, or .pkg, then it was built for a particular python > install, probably MacPython, not Apple's. Weird. I thought the binaries at pythonmac.org would install fine in either system python or add-on MacPython as long they were built for the right major version of Python (2.5 for Leopard). Maybe I'm wrong. If so...you could always install MacPython and then things should "just work". I realize that's not the current recommendation for Leopard (for one thing the built in Python does have at least one useful feature not found in MacPython) but it does have some advantages. For one thing if you distribute a bundled Python application built with py2app (and that uses 3rd party compiled packages) then using your own MacPython may be necessary to make an application that can be used on 1.4 and 1.3.9. If I understand correctly py2app only includes python in the application bundle if you were using MacPython (as opposed to the built-in python) and you'll want python included if you distribute extensions so they can run with the right python. -- Russell From airdrummer at wheel.org Wed Feb 27 23:49:35 2008 From: airdrummer at wheel.org (tom wible) Date: Wed, 27 Feb 2008 17:49:35 -0500 Subject: [Pythonmac-SIG] py-appscript problem in crontab In-Reply-To: <8A304CBB-57F1-4CE5-AB6D-B3863C56017A@virgin.net> References: <8A304CBB-57F1-4CE5-AB6D-B3863C56017A@virgin.net> Message-ID: <47C5E8FF.2060502@wheel.org> just wrote a script to kill live eyetv: #! /usr/bin/env python from appscript import * app(u'/Applications/EyeTV.app').window[its.name.startswith('EyeTV')].close() and it works great fom the cli, but not in crontab: Subject: Cron /DVR/scripts/noLiveEyeTV.py X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: Date: Wed, 27 Feb 2008 01:01:02 -0500 (EST) Traceback (most recent call last): File "/DVR/scripts/noLiveEyeTV.py", line 3, in ? app(u'/Applications/EyeTV.app').window[its.name.startswith('EyeTV')].close() File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/aeosa/appscript/reference.py", line 523, in __getitem__ return Reference(self.AS_appdata, self.AS_aemreference.byfilter( File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/aeosa/appscript/genericreference.py", line 63, in AS_resolve ref = getattr(ref, args) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/aeosa/appscript/reference.py", line 511, in __getattr__ raise AttributeError, "Unknown property, element or command: %r" % name AttributeError: Unknown property, element or command: 'startswith' obviously a path problem: wiblesdvr:~ dvr$ ls -l `which python` lrwxr-xr-x 1 root admin 9 Jun 9 2007 /Library/Frameworks/Python.framework/Versions/Current/bin/python -> python2.5 wiblesdvr:~ dvr$ echo $PATH /Library/Frameworks/Python.framework/Versions/Current/bin:/bin:/sbin:/usr/bin:/usr/sbin and crontab's python: wiblesdvr:~ dvr$ export PATH=/usr/bin:/bin wiblesdvr:~ dvr$ ls -l `which python` lrwxr-xr-x 1 root wheel 9 Jul 24 2006 /usr/bin/python -> python2.3 wiblesdvr:~ dvr$ ls -l /usr/bin/py* -rwxr-xr-x 1 root wheel 44 Jan 13 2006 /usr/bin/pydoc lrwxr-xr-x 1 root wheel 9 Jul 24 2006 /usr/bin/python -> python2.3 lrwxr-xr-x 1 root wheel 72 Jul 24 2006 /usr/bin/python2.3 -> ../../System/Library/Frameworks/Python.framework/Versions/2.3/bin/python lrwxr-xr-x 1 root wheel 10 Jul 24 2006 /usr/bin/pythonw -> pythonw2.3 -rwxr-xr-x 1 root wheel 34216 Jan 13 2006 /usr/bin/pythonw2.3 so how come /System/Library/Frameworks/Python.framework/Versions/Current is different from /Library/Frameworks/Python.framework/Versions/Current? should i fix that, or will that break other stuff? tia From vip at avatar.com.au Thu Feb 28 06:05:39 2008 From: vip at avatar.com.au (DavidW) Date: Thu, 28 Feb 2008 16:05:39 +1100 Subject: [Pythonmac-SIG] compiling PIL on OSX10.5 Message-ID: <075C55A0-8DED-4829-A74C-17E60AFCA3EE@avatar.com.au> Hello all, I'm trying to compile the image library PIL 1.1.6, using their setup.py (python 2.4 on OX10.5) and gcc (i686-apple-darwin9-gcc-4.0.1) loader is throwing a build error: ----------- building '_imagingtk' extension gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g - bundle -undefined dynamic_lookup build/temp.macosx-10.5-fat-2.4/ _imagingtk.o build/temp.macosx-10.5-fat-2.4/Tk/tkImaging.o -L/opt/ local/lib -L/usr/local/lib -L/Library/Frameworks/Python.framework/ Versions/2.4/lib -L/usr/lib -o PIL/_imagingtk.so -framework Tcl - framework Tk ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libcrypto. 0.9.7.dylib, file is not of required architecture for architecture i386 collect2: ld returned 1 exit status ----------- which is fair enough, but- why is setup.py looking for /Developer/SDKs/ MacOSX10.4u.sdk? even though MacOSX10.5.sdk is also at Developer/SDKs/ Is there any reason to keep MacOSX10.4.sdk hanging around? I moved it out of the way and setup.py puts this together for compilation: ----------- building '_imagingmath' extension gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd - fno-common -dynamic -DNDEBUG -g -I/System/Library/Frameworks/ Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/ Headers -IlibImaging -I/opt/local/include -I/Library/Frameworks/ Python.framework/Versions/2.4/include -I/usr/local/include -I/usr/ include -I/Library/Frameworks/Python.framework/Versions/2.4/include/ python2.4 -c _imagingmath.c -o build/temp.macosx-10.5-fat-2.4/ _imagingmath.o ----------- i.e it still want to reference /Developer/SDKs/MacOSX10.4u.sdk Any clues? (golly, I hope this is the right list for this ! :-) thanks, David ________________________________________________ David Worrall. - Experimental Polymedia: www.avatar.com.au - Education for Financial Independence: www.mindthemarkets.com.au Australian research affiliations: - Capital Markets Cooperative Research Centre: www.cmcrc.com - Sonic Communications Research Group: creative.canberra.edu.au/scrg From ronaldoussoren at mac.com Thu Feb 28 11:18:36 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 28 Feb 2008 11:18:36 +0100 Subject: [Pythonmac-SIG] compiling PIL on OSX10.5 In-Reply-To: <075C55A0-8DED-4829-A74C-17E60AFCA3EE@avatar.com.au> References: <075C55A0-8DED-4829-A74C-17E60AFCA3EE@avatar.com.au> Message-ID: <75D4E17B-63B1-49A7-BD9D-78C865CDCDF6@mac.com> Which version of python are you using? The Python.org installer builds extensions using the 10.4 SDK to ensure that extensions will actually run on that platform. BTW. What I don't undestand is why building PIL tries to link libcrypto. Do you have a libcrypto dylib in /usr/local/lib? If so, what is the output of the file command on that? (file /usr/local/lib/libcrypto*). It seems that the libcrypto that's linked into the extension is PPC- only, while distutils tries to build a 32-bit universal binary. Ronald On 28 Feb, 2008, at 6:05, DavidW wrote: > Hello all, > > I'm trying to compile the image library PIL 1.1.6, using their > setup.py > (python 2.4 on OX10.5) and > gcc (i686-apple-darwin9-gcc-4.0.1) loader is throwing a build error: > ----------- > building '_imagingtk' extension > gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - > g - > bundle -undefined dynamic_lookup build/temp.macosx-10.5-fat-2.4/ > _imagingtk.o build/temp.macosx-10.5-fat-2.4/Tk/tkImaging.o -L/opt/ > local/lib -L/usr/local/lib -L/Library/Frameworks/Python.framework/ > Versions/2.4/lib -L/usr/lib -o PIL/_imagingtk.so -framework Tcl - > framework Tk > ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libcrypto. > 0.9.7.dylib, file is not of required architecture for architecture > i386 > collect2: ld returned 1 exit status > ----------- > which is fair enough, but- why is setup.py looking for /Developer/ > SDKs/ > MacOSX10.4u.sdk? > even though MacOSX10.5.sdk is also at Developer/SDKs/ > > Is there any reason to keep MacOSX10.4.sdk hanging around? > I moved it out of the way and setup.py puts this together for > compilation: > ----------- > building '_imagingmath' extension > gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - > fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd - > fno-common -dynamic -DNDEBUG -g -I/System/Library/Frameworks/ > Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/ > Headers -IlibImaging -I/opt/local/include -I/Library/Frameworks/ > Python.framework/Versions/2.4/include -I/usr/local/include -I/usr/ > include -I/Library/Frameworks/Python.framework/Versions/2.4/include/ > python2.4 -c _imagingmath.c -o build/temp.macosx-10.5-fat-2.4/ > _imagingmath.o > ----------- > i.e it still want to reference /Developer/SDKs/MacOSX10.4u.sdk > > Any clues? > (golly, I hope this is the right list for this ! :-) > > thanks, > David > > ________________________________________________ > David Worrall. > - Experimental Polymedia: www.avatar.com.au > - Education for Financial Independence: www.mindthemarkets.com.au > Australian research affiliations: > - Capital Markets Cooperative Research Centre: www.cmcrc.com > - Sonic Communications Research Group: creative.canberra.edu.au/scrg > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20080228/0d40aa55/attachment-0001.bin From hengist.podd at virgin.net Thu Feb 28 12:39:50 2008 From: hengist.podd at virgin.net (has) Date: Thu, 28 Feb 2008 11:39:50 +0000 Subject: [Pythonmac-SIG] py-appscript problem in crontab In-Reply-To: <47C5E8FF.2060502@wheel.org> References: <8A304CBB-57F1-4CE5-AB6D-B3863C56017A@virgin.net> <47C5E8FF.2060502@wheel.org> Message-ID: On 27 Feb 2008, at 22:49, tom wible wrote: > just wrote a script to kill live eyetv: > > #! /usr/bin/env python > from appscript import * > app(u'/Applications/ > EyeTV.app').window[its.name.startswith('EyeTV')].close() > > and it works great fom the cli, but not in crontab: > [...] > X-Cron-Env: > [...] > raise AttributeError, "Unknown property, element or command: %r" > % name > AttributeError: Unknown property, element or command: 'startswith' Looks like you have an older version of appscript installed on the / Library Python - 'startswith' was changed to 'beginswith' a while back for consistency with AppleScript. I'd suggest installing the latest version (0.18.1) in both Pythons and updating existing scripts as necessary. HTH has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org From vip at avatar.com.au Thu Feb 28 12:49:28 2008 From: vip at avatar.com.au (DavidW) Date: Thu, 28 Feb 2008 22:49:28 +1100 Subject: [Pythonmac-SIG] compiling PIL on OSX10.5 In-Reply-To: <75D4E17B-63B1-49A7-BD9D-78C865CDCDF6@mac.com> References: <075C55A0-8DED-4829-A74C-17E60AFCA3EE@avatar.com.au> <75D4E17B-63B1-49A7-BD9D-78C865CDCDF6@mac.com> Message-ID: <8839B032-E28D-494A-8B04-69012EE5E064@avatar.com.au> Hi Ronald, Thanks for replying. On 28/02/2008, at 9:18 PM, Ronald Oussoren wrote: > Which version of python are you using? The Python.org installer > builds extensions using the 10.4 SDK to ensure that extensions will > actually run on that platform. > Python 2.4.3 (#1, Mar 30 2006, 11:02:16) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin > BTW. What I don't undestand is why building PIL tries to link > libcrypto. > > Do you have a libcrypto dylib in /usr/local/lib? If so, what is the > output of the file command on that? (file /usr/local/lib/ > libcrypto*). It seems that the libcrypto that's linked into the > extension is PPC-only, while distutils tries to build a 32-bit > universal binary. > you guessed it! Macintosh:SDKs drw$ file /usr/local/lib/libcr* /usr/local/lib/libcrypto.0.9.7.dylib: Mach-O dynamically linked shared library ppc Now I'm wondering what to do. This is an intel macbook. upgrade from OSX 10.4.11 to 10.5 was ?ok? but things got stuffed up when trying to implement the 10.5.1 upgrade. Recommendation? [aside: I've got about 30 apl/libraries in the and am reluctant to move to python 2.5 at this moment if I have to rebuild all the dylibs. If I have to then I guess I'll bite the bullet. If I just copy the python2.4/site-packages directory across is it likely to work?] ciao, David > Ronald > > On 28 Feb, 2008, at 6:05, DavidW wrote: > >> Hello all, >> >> I'm trying to compile the image library PIL 1.1.6, using their >> setup.py >> (python 2.4 on OX10.5) and >> gcc (i686-apple-darwin9-gcc-4.0.1) loader is throwing a build error: >> ----------- >> building '_imagingtk' extension >> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - >> g - >> bundle -undefined dynamic_lookup build/temp.macosx-10.5-fat-2.4/ >> _imagingtk.o build/temp.macosx-10.5-fat-2.4/Tk/tkImaging.o -L/opt/ >> local/lib -L/usr/local/lib -L/Library/Frameworks/Python.framework/ >> Versions/2.4/lib -L/usr/lib -o PIL/_imagingtk.so -framework Tcl - >> framework Tk >> ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libcrypto. >> 0.9.7.dylib, file is not of required architecture for architecture >> i386 >> collect2: ld returned 1 exit status >> ----------- >> which is fair enough, but- why is setup.py looking for /Developer/ >> SDKs/ >> MacOSX10.4u.sdk? >> even though MacOSX10.5.sdk is also at Developer/SDKs/ >> >> Is there any reason to keep MacOSX10.4.sdk hanging around? >> I moved it out of the way and setup.py puts this together for >> compilation: >> ----------- >> building '_imagingmath' extension >> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - >> fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused- >> madd - >> fno-common -dynamic -DNDEBUG -g -I/System/Library/Frameworks/ >> Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/ >> Headers -IlibImaging -I/opt/local/include -I/Library/Frameworks/ >> Python.framework/Versions/2.4/include -I/usr/local/include -I/usr/ >> include -I/Library/Frameworks/Python.framework/Versions/2.4/include/ >> python2.4 -c _imagingmath.c -o build/temp.macosx-10.5-fat-2.4/ >> _imagingmath.o >> ----------- >> i.e it still want to reference /Developer/SDKs/MacOSX10.4u.sdk >> >> Any clues? >> (golly, I hope this is the right list for this ! :-) >> >> thanks, >> David >> >> ________________________________________________ >> David Worrall. >> - Experimental Polymedia: www.avatar.com.au >> - Education for Financial Independence: www.mindthemarkets.com.au >> Australian research affiliations: >> - Capital Markets Cooperative Research Centre: www.cmcrc.com >> - Sonic Communications Research Group: creative.canberra.edu.au/scrg >> >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > From ronaldoussoren at mac.com Thu Feb 28 13:03:18 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 28 Feb 2008 13:03:18 +0100 Subject: [Pythonmac-SIG] compiling PIL on OSX10.5 In-Reply-To: <8839B032-E28D-494A-8B04-69012EE5E064@avatar.com.au> References: <075C55A0-8DED-4829-A74C-17E60AFCA3EE@avatar.com.au> <75D4E17B-63B1-49A7-BD9D-78C865CDCDF6@mac.com> <8839B032-E28D-494A-8B04-69012EE5E064@avatar.com.au> Message-ID: <6B61F125-7751-4139-BEC2-50241FF6E57B@mac.com> On 28 Feb, 2008, at 12:49, DavidW wrote: > Hi Ronald, Thanks for replying. > > > On 28/02/2008, at 9:18 PM, Ronald Oussoren wrote: > >> Which version of python are you using? The Python.org installer >> builds extensions using the 10.4 SDK to ensure that extensions will >> actually run on that platform. >> > Python 2.4.3 (#1, Mar 30 2006, 11:02:16) > [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin > >> BTW. What I don't undestand is why building PIL tries to link >> libcrypto. >> >> Do you have a libcrypto dylib in /usr/local/lib? If so, what is the >> output of the file command on that? (file /usr/local/lib/ >> libcrypto*). It seems that the libcrypto that's linked into the >> extension is PPC-only, while distutils tries to build a 32-bit >> universal binary. >> > you guessed it! > Macintosh:SDKs drw$ file /usr/local/lib/libcr* > /usr/local/lib/libcrypto.0.9.7.dylib: Mach-O dynamically linked shared > library ppc > > Now I'm wondering what to do. This is an intel macbook. upgrade from > OSX 10.4.11 to 10.5 was ?ok? but things got stuffed up when trying to > implement the 10.5.1 upgrade. Recommendation? I don't know what installed libcrypto in /usr/local/lib and hence don't know if it is save to remove. You could move it (or all of /usr/local) aside while building pil and restore it afterwards. I'd try to find out what installed /usr/local/lib/libcrypto* and reinstall it as a universal or x86 library. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20080228/98e94a95/attachment.bin From vip at avatar.com.au Thu Feb 28 15:41:26 2008 From: vip at avatar.com.au (DavidW) Date: Fri, 29 Feb 2008 01:41:26 +1100 Subject: [Pythonmac-SIG] compiling PIL on OSX10.5 In-Reply-To: <6B61F125-7751-4139-BEC2-50241FF6E57B@mac.com> References: <075C55A0-8DED-4829-A74C-17E60AFCA3EE@avatar.com.au> <75D4E17B-63B1-49A7-BD9D-78C865CDCDF6@mac.com> <8839B032-E28D-494A-8B04-69012EE5E064@avatar.com.au> <6B61F125-7751-4139-BEC2-50241FF6E57B@mac.com> Message-ID: Hey Ronald - I recon that way madness lies! I sent the last post and then realised I could run both a new and old python so I downloaded and have begun - wow - talk about speed! btw it's quite hard to work out where exactly to get the .dmg from - sometimes MacPython is called python (under a mac heading) etc (went around the loop a couple of times and eventually downloaded from http://www.python.org/download/ which instantiates as > Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) > [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > > Executable: /Library/Frameworks/Python.framework/Versions/2.5/ > Resources/Python.app/Contents/MacOS/Python > Is that the right one? Anyway PIL compiles and loads, so,sorry to bother you about this - Sometimes it's better to bite the bullet! David On 28/02/2008, at 11:03 PM, Ronald Oussoren wrote: > > On 28 Feb, 2008, at 12:49, DavidW wrote: > >> Hi Ronald, Thanks for replying. >> >> >> On 28/02/2008, at 9:18 PM, Ronald Oussoren wrote: >> >>> Which version of python are you using? The Python.org installer >>> builds extensions using the 10.4 SDK to ensure that extensions will >>> actually run on that platform. >>> >> Python 2.4.3 (#1, Mar 30 2006, 11:02:16) >> [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin >> >>> BTW. What I don't undestand is why building PIL tries to link >>> libcrypto. >>> >>> Do you have a libcrypto dylib in /usr/local/lib? If so, what is the >>> output of the file command on that? (file /usr/local/lib/ >>> libcrypto*). It seems that the libcrypto that's linked into the >>> extension is PPC-only, while distutils tries to build a 32-bit >>> universal binary. >>> >> you guessed it! >> Macintosh:SDKs drw$ file /usr/local/lib/libcr* >> /usr/local/lib/libcrypto.0.9.7.dylib: Mach-O dynamically linked >> shared >> library ppc >> >> Now I'm wondering what to do. This is an intel macbook. upgrade from >> OSX 10.4.11 to 10.5 was ?ok? but things got stuffed up when trying to >> implement the 10.5.1 upgrade. Recommendation? > > I don't know what installed libcrypto in /usr/local/lib and hence > don't know if it is save to remove. > > You could move it (or all of /usr/local) aside while building pil > and restore it afterwards. > > I'd try to find out what installed /usr/local/lib/libcrypto* and > reinstall it as a universal or x86 library. > > Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20080229/ea7a8c8d/attachment.htm From ronaldoussoren at mac.com Thu Feb 28 16:00:49 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 28 Feb 2008 16:00:49 +0100 Subject: [Pythonmac-SIG] compiling PIL on OSX10.5 In-Reply-To: References: <075C55A0-8DED-4829-A74C-17E60AFCA3EE@avatar.com.au> <75D4E17B-63B1-49A7-BD9D-78C865CDCDF6@mac.com> <8839B032-E28D-494A-8B04-69012EE5E064@avatar.com.au> <6B61F125-7751-4139-BEC2-50241FF6E57B@mac.com> Message-ID: <4A452E55-E899-4599-8E50-381D23729648@mac.com> On 28 Feb, 2008, at 15:41, DavidW wrote: > Hey Ronald - I recon that way madness lies! > I sent the last post and then realised I could run both a new and > old python > so I downloaded and have begun - wow - talk about speed! > > btw it's quite hard to work out where exactly to get the .dmg > from - sometimes MacPython is called python (under a mac heading) etc > (went around the loop a couple of times and eventually downloaded > from http://www.python.org/download/ > which instantiates as >> Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) >> [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin >> Type "help", "copyright", "credits" or "license" for more >> information. >> >> Executable: /Library/Frameworks/Python.framework/Versions/2.5/ >> Resources/Python.app/Contents/MacOS/Python >> > > Is that the right one? The correct download for Python 2.5.x is from http://www.python.org/download/ . There is a dmg on pythonmac.org as well, but AFAIK that either isn't maintained or is a copy of the python.org image. That said, OSX 10.5 ships with Python 2.5.1 as /usr/bin/python. I'd use that version unless you need the Python.org build (e.g. you're running into a bug that's fixed in 2.5.2 or you're embedding python in an application that you'll ship to OSX 10.4 users). > > Anyway PIL compiles and loads, so,sorry to bother you about this - > Sometimes it's better to bite the bullet! Did you download and compile libjpeg as well? If you don't install that somewhere PIL will happily build and install, but without JPEG support. Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20080228/5d29ab42/attachment-0001.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20080228/5d29ab42/attachment-0001.bin From Chris.Barker at noaa.gov Thu Feb 28 18:42:00 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 28 Feb 2008 09:42:00 -0800 Subject: [Pythonmac-SIG] Python module installation on Leopard runs but doesn't install In-Reply-To: References: <4DD64DA5-B034-4FB0-B567-96EDADB9E799@mac.com> <47C5BD74.90505@noaa.gov> Message-ID: <47C6F268.3040003@noaa.gov> Russell E. Owen wrote: > Weird. I thought the binaries at pythonmac.org > would install fine in either system > python or add-on MacPython as long they were built for the right major > version of Python (2.5 for Leopard). But they are in different places. Putting in symlink could take care of that, but it didn't seem to be working for the OP. I don't have 10.5, so I can't test it. Does anyone know definitively? We really should post that info somewhere. Or is pythonmac.org/packages dead anyway? I still think it's good idea, though more an more package maintainers are supporting OS-X themselves these days. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From robcander at mac.com Thu Feb 28 20:06:42 2008 From: robcander at mac.com (Robert Anderson) Date: Thu, 28 Feb 2008 19:06:42 +0000 Subject: [Pythonmac-SIG] Python module installation on Leopard runs but doesn't install In-Reply-To: <47C5BD74.90505@noaa.gov> References: <4DD64DA5-B034-4FB0-B567-96EDADB9E799@mac.com> <47C5BD74.90505@noaa.gov> Message-ID: <6A8019CF-CADA-4D8C-AD58-DCC5B84D3B79@mac.com> Chris Thanks, I have since found out that downloading the source and doing a build and install everything is OK. Next I will check if it works with any eggs available. Thanks again Robert On 27 Feb 2008, at 19:43, Christopher Barker wrote: > Robert Anderson wrote: >> I am running a factory installation of Leopard and command line >> Python appears to run OK. However, when I attempted to install a >> downloaded package, PYTZ for example, > > where are you downloading it from, and in what form? > > If it's a .mpgk, or .pkg, then it was built for a particular python > install, probably MacPython, not Apple's. > > So you need to either find a package built for Leopard's python, or > download a tarball and install it with distutils (python setup.py > install). > > if there are eggs available, they MIGHT work, too. > >> From the Python website I found the following link concerned with >> installing additional items, in particular IDLE: >> http://wiki.python.org/moin/MacPython/Leopard > > That hack should work for any other package built for MacPython2.5 > -- you'll have to give us more details as to exactly what you did, > and what happened. > > -Chris > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov From Chris.Barker at noaa.gov Fri Feb 29 02:09:16 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 28 Feb 2008 17:09:16 -0800 Subject: [Pythonmac-SIG] Who's maintaining py2app? Message-ID: <47C75B3C.5000504@noaa.gov> Who do aI report a buglet in py2app to? Anyway, here it is: I just did a svn update, and the News.txt says that the latest version is: 0.4.2 However, py2app/__init__.py has; __version__ = "0.3.6" This confused me when I was trying to see if I has successfully installed the newer vversion... -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From airdrummer at wheel.org Fri Feb 29 03:20:17 2008 From: airdrummer at wheel.org (tom wible) Date: Thu, 28 Feb 2008 21:20:17 -0500 Subject: [Pythonmac-SIG] py-appscript problem in crontab In-Reply-To: References: <8A304CBB-57F1-4CE5-AB6D-B3863C56017A@virgin.net> <47C5E8FF.2060502@wheel.org> Message-ID: <47C76BE1.20008@wheel.org> > version (0.18.1) in both Pythons so why does the python2.5 installer put it in /Lib... & not /System/Lib... anyway? will some system scripts fail if i point /system/lib/current to 2.5? From airdrummer at wheel.org Fri Feb 29 04:02:38 2008 From: airdrummer at wheel.org (tom wible) Date: Thu, 28 Feb 2008 22:02:38 -0500 Subject: [Pythonmac-SIG] py-appscript problem in crontab In-Reply-To: References: <8A304CBB-57F1-4CE5-AB6D-B3863C56017A@virgin.net> <47C5E8FF.2060502@wheel.org> Message-ID: <47C775CE.1010005@wheel.org> i give up: crontab no longer executes python:-P 33 21 * * * /usr/bin/osascript /DVR/scripts/noLiveEyeTV.scpt works fine: From dvr at wiblesdvr.localhost Thu Feb 28 21:33:02 2008 From: dvr at wiblesdvr.localhost (Cron Daemon) but 52 21 * * * /DVR/scripts/noLiveEyeTV.py doesn't...even if it failed, i would have gotten email, as i did when i 1st started...wtf? From nad at acm.org Fri Feb 29 04:55:37 2008 From: nad at acm.org (Ned Deily) Date: Thu, 28 Feb 2008 19:55:37 -0800 Subject: [Pythonmac-SIG] py-appscript problem in crontab References: <8A304CBB-57F1-4CE5-AB6D-B3863C56017A@virgin.net> <47C5E8FF.2060502@wheel.org> <47C76BE1.20008@wheel.org> Message-ID: In article <47C76BE1.20008 at wheel.org>, tom wible wrote: > > version (0.18.1) in both Pythons > > so why does the python2.5 installer put it in /Lib... & not /System/Lib... > anyway? will some system scripts fail if i point /system/lib/current to 2.5? The python installed under /System/Library is installed and updated by Apple as a part of OSX. The general rule is the file system space under /System is owned by Apple and OSX; third-parties, including users and ISVs, should not remove or rename any existing files there. That's why the MacPython 2.5.x distribution installs in /Library, the MacPorts version in /opt/local, and the Fink version in /sw. The good news is that they all co-exist with each other and with the Apple-installed python. The only "trick" is to make sure you're invoking the expected python. From a shell (terminal command line), one way to do that is by manipulating shell environment variables (e.g. PATH) to ensure the desired python is found first. The installer for MacPython 2.5.x (from python.org) has a package to do that for you. Another way to get the desired Python is to explicitly reference the python you want (see followup reply). -- Ned Deily, nad at acm.org From nad at acm.org Fri Feb 29 05:29:19 2008 From: nad at acm.org (Ned Deily) Date: Thu, 28 Feb 2008 20:29:19 -0800 Subject: [Pythonmac-SIG] py-appscript problem in crontab References: <8A304CBB-57F1-4CE5-AB6D-B3863C56017A@virgin.net> <47C5E8FF.2060502@wheel.org> <47C775CE.1010005@wheel.org> Message-ID: In article <47C775CE.1010005 at wheel.org>, tom wible wrote: > i give up: crontab no longer executes python:-P > > > 33 21 * * * /usr/bin/osascript > /DVR/scripts/noLiveEyeTV.scpt > > works fine: > > From dvr at wiblesdvr.localhost Thu Feb 28 21:33:02 2008 > From: dvr at wiblesdvr.localhost (Cron Daemon) > > but > > 52 21 * * * /DVR/scripts/noLiveEyeTV.py > > doesn't...even if it failed, i would have gotten email, as i did when i 1st > started...wtf? In your first posting, your script was written using /usr/bin/env: #! /usr/bin/env python That leaves you at the mercy of whatever PATH has been set to. Suggest you change the cron table entry to explicitly invoke the python you want, so (all on one line, of course): 52 21 [...] /Library/Frameworks/Python.framework/Versions/2.5/bin/python /DVR/scripts/noLiveEyeTV.py The MacPython installer creates symlinks in /usr/local/bin: $ ls -l /usr/local/bin/python lrwxr-xr-x 1 root wheel 68 Feb 23 15:45 /usr/local/bin/python -> ../../../Library/Frameworks/Python.framework/Versions/2.5/bin/python so the crontab line could be simplified to: [...] /usr/local/bin/python /DVR/scripts[...] -- Ned Deily, nad at acm.org From Chris.Barker at noaa.gov Fri Feb 29 05:51:36 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 28 Feb 2008 20:51:36 -0800 Subject: [Pythonmac-SIG] py-appscript problem in crontab In-Reply-To: References: <8A304CBB-57F1-4CE5-AB6D-B3863C56017A@virgin.net> <47C5E8FF.2060502@wheel.org> <47C775CE.1010005@wheel.org> Message-ID: <47C78F58.8080409@noaa.gov> Ned Deily wrote: > In your first posting, your script was written using /usr/bin/env: > > #! /usr/bin/env python > > That leaves you at the mercy of whatever PATH has been set to. > Suggest you change the cron table entry to explicitly invoke the python > you want, so (all on one line, of course): or change the #! line to the one you want: #!/usr/local/python2.5 or #!/Library/Frameworks/Python.framework/Versions/2.5/bin/python I like to do that anyway with production code, as it makes it clear which python the script was tested against. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception From santagada at gmail.com Fri Feb 29 06:06:19 2008 From: santagada at gmail.com (Leonardo Santagada) Date: Fri, 29 Feb 2008 02:06:19 -0300 Subject: [Pythonmac-SIG] py-appscript problem in crontab In-Reply-To: <47C78F58.8080409@noaa.gov> References: <8A304CBB-57F1-4CE5-AB6D-B3863C56017A@virgin.net> <47C5E8FF.2060502@wheel.org> <47C775CE.1010005@wheel.org> <47C78F58.8080409@noaa.gov> Message-ID: <17D3203A-4F48-4A01-BC48-CA1BC26B0ED8@gmail.com> On 29/02/2008, at 01:51, Christopher Barker wrote: > #!/usr/local/python2.5 > > or > > #!/Library/Frameworks/Python.framework/Versions/2.5/bin/python > > I like to do that anyway with production code, as it makes it clear > which python the script was tested against. And you also make the user know that they are not welcome to install python were he wants... Try to at least put #!/usr/bin/env python2.5 if all you want is limit the python to a specific version, but even then I think it is a really bad idea for any code you want to use in more than one machine as maybe your script will run fine in python 5.3 (made up number I know) and you are limiting it to a freaking old python (when python 5.3 come out it is the prefered language in the world, as is used to run all servers of skynet). Sorry for the rant, but I really get upset fixing smallbugs in realesed "Production" code that was hardcoded to run only on the author computer. -- Leonardo Santagada From ronaldoussoren at mac.com Fri Feb 29 08:11:08 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 29 Feb 2008 08:11:08 +0100 Subject: [Pythonmac-SIG] Who's maintaining py2app? In-Reply-To: <47C75B3C.5000504@noaa.gov> References: <47C75B3C.5000504@noaa.gov> Message-ID: <7ED9E1D5-CA91-4272-9460-14E0C7D820BA@mac.com> On 29 Feb, 2008, at 2:09, Christopher Barker wrote: > Who do aI report a buglet in py2app to? > > Anyway, here it is: > > I just did a svn update, and the News.txt says that the latest version > is: 0.4.2 > > However, py2app/__init__.py has; > > __version__ = "0.3.6" > > This confused me when I was trying to see if I has successfully > installed the newer vversion... Good catch. I've updated the value of __version__ in the repository (in revision 69), you should get the right value on the next 'svn update'. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20080229/6fbbf84a/attachment-0001.bin From airdrummer at wheel.org Fri Feb 29 11:43:03 2008 From: airdrummer at wheel.org (tom wible) Date: Fri, 29 Feb 2008 05:43:03 -0500 Subject: [Pythonmac-SIG] py-appscript problem in crontab In-Reply-To: References: <8A304CBB-57F1-4CE5-AB6D-B3863C56017A@virgin.net> <47C5E8FF.2060502@wheel.org> <47C775CE.1010005@wheel.org> Message-ID: <47C7E1B7.1030704@wheel.org> thanx, ned, conflated u with ed;-) From Chris.Barker at noaa.gov Fri Feb 29 18:21:08 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 29 Feb 2008 09:21:08 -0800 Subject: [Pythonmac-SIG] py-appscript problem in crontab In-Reply-To: <17D3203A-4F48-4A01-BC48-CA1BC26B0ED8@gmail.com> References: <8A304CBB-57F1-4CE5-AB6D-B3863C56017A@virgin.net> <47C5E8FF.2060502@wheel.org> <47C775CE.1010005@wheel.org> <47C78F58.8080409@noaa.gov> <17D3203A-4F48-4A01-BC48-CA1BC26B0ED8@gmail.com> Message-ID: <47C83F04.2080201@noaa.gov> Leonardo Santagada wrote: > And you also make the user know that they are not welcome to install > python were he wants... It all depend in who the "user" is, and who the "author" is. > Try to at least put #!/usr/bin/env python2.5 if all you want is limit > the python to a specific version, That's exactly what I usually do, but it doesn't help the OP's case -- there is Apple's Python2.5, and there may be MacPython2.5 (and fink25, and ...) each of these may have different packages installed, and thus a given script will only work with a given one. > but even then I think it is a really > bad idea for any code you want to use in more than one machine as > maybe your script will run fine in python 5.3 (made up number I know) > and you are limiting it to a freaking old python No you're not -- you're limiting it to run on only that python without the user (installer, anyway), being made aware that they are trying running it against a new version, and thus might want to test a bit. a while back, Redhat had a bunch of admin scripts, all with: #!/usr/bin/env python (or maybe just #!python) at the top. The result was that all kinds of stuff broke when someone installed a new version of python that didn't have all of RedHat's special modules in it (which hadn't been ported to a newer python) This was a big 'ol pain in the *&^*& for lots of people. Had RedHat specified a python version, there would have been no problem at all, and one would hope that they would want to test all their code against a new version when they decided to upgrade, and could change their #! lines then. I think of scripts depending on Python to be much like a binary depending on a shared library -- it's insane to link binaries against "libc" without specifying a version, and expect them to work two versions of libc later -- why is this any different? Other options: messing with global environment variables like PATH and PYTHONPATH -- now you're assuming all scripts on your system use the same python -- bad idea (see RedHat example) Having a startup script that specifies PATH and/or PYTHONPATH -- sure, that's fine, but is that any different that specifying it in the #! line (unless you use one startup script for multiple python scripts, in which case, it's a fine solution. > Sorry for the rant, but I really get upset fixing smallbugs in > realesed "Production" code that was hardcoded to run only on the > author computer. I agree -- but which bug would you rather fix -- a #! line that needs changing, or some weird bug that's the result of a different python version, or even more common, a script that won't run because a package is missing (but I have that installed! what's going on!) The very simplest python script that uses no fancy features of python and has no dependencies might well work fine with lots of python versions, but even that won't make the py3k transition (long before your mythical python5.3), and I'd still like to know what versions it was tested on (yes, I can get that from a README, but that's not really any easier than reading a #! line, and who knows where the README may be for an installed script) Personally, I'd really like to see versioning somehow built into python itself (and python packages -- eggs solve some of this), then you could distribute a script that could declare which versions of python a script was known to work with, and could automatically run with any of those, and raise a useful error with any others. OOPS! sorry -- that was a much longer rant! -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From robin at alldunn.com Fri Feb 29 18:58:17 2008 From: robin at alldunn.com (Robin Dunn) Date: Fri, 29 Feb 2008 09:58:17 -0800 Subject: [Pythonmac-SIG] /Library/Python/... path in MacPython Message-ID: <47C847B9.7000003@alldunn.com> Has there been any discussion in the past about having MacPython also having the /Library/Python/2.5/site-packages on the default sys.path like Apple's Python does? If so, were there specific reasons for not doing it? At first blush it would certainly make it easier for package authors who want to support both ApplePython and MacPython. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! From santagada at gmail.com Fri Feb 29 18:58:40 2008 From: santagada at gmail.com (Leonardo Santagada) Date: Fri, 29 Feb 2008 14:58:40 -0300 Subject: [Pythonmac-SIG] py-appscript problem in crontab In-Reply-To: <47C83F04.2080201@noaa.gov> References: <8A304CBB-57F1-4CE5-AB6D-B3863C56017A@virgin.net> <47C5E8FF.2060502@wheel.org> <47C775CE.1010005@wheel.org> <47C78F58.8080409@noaa.gov> <17D3203A-4F48-4A01-BC48-CA1BC26B0ED8@gmail.com> <47C83F04.2080201@noaa.gov> Message-ID: <697445DA-069D-4F91-BDD6-3AF8B208D220@gmail.com> On 29/02/2008, at 14:21, Christopher Barker wrote: > Personally, I'd really like to see versioning somehow built into > python > itself (and python packages -- eggs solve some of this), then you > could > distribute a script that could declare which versions of python a > script > was known to work with, and could automatically run with any of those, > and raise a useful error with any others. Amen to that... versioning like .net assemblies (at least like how they say they work, I never really used any CLI language). So you can say import PIL(>1.5) and make that part of the language... and not do horrible things like setuptools do with eggs (putting a nem path for each egg). -- Leonardo Santagada From nathan.stocks at gmail.com Fri Feb 29 19:37:40 2008 From: nathan.stocks at gmail.com (Nathan) Date: Fri, 29 Feb 2008 11:37:40 -0700 Subject: [Pythonmac-SIG] py2app not finding twisted.protocols.amp Message-ID: <96c9d6a80802291037m26fc3376ue2b6e90be4b178af@mail.gmail.com> I'm on a MacBook Pro running OS X 10.5.2 using py2app installed with the "easy" method in the py2app install docs. I'm trying to package a little pyglet+twisted (pyglet.org, twistedmatrix.com) project that I'm working on, and it _mostly_ works, except it keeps giving me the following error when I try to run the resulting app: ImportError: No module named amp Help!? I've done the following steps to try to debug the problem, with no success: * Noticed that the following imports DO work: from twisted.internet import reactor, task from twisted.internet.protocol import ClientCreator * Verified that I get the same error when running the app with the following import lines: import twisted.protocols.amp or from twisted.protocols import amp * Tried the following command-line variations without any variation in the error (although app sizes varied): python setup.py py2app --includes twisted.protocols python setup.py py2app --includes twisted.protocols.amp python setup.py py2app --use-pythonpath python setup.py py2app --use-pythonpath --include twisted.protocols.amp python setup.py py2app --use-pythonpath --include twisted.protocols.amp --graph python setup.py py2app --use-pythonpath --include twisted.protocols.amp -p twisted.protocols python setup.py py2app --use-pythonpath -p twisted.protocols python setup.py py2app --use-pythonpath -p twisted * Used the following py2applet-generated setup.py the whole time: """ This is a setup.py script generated by py2applet Usage: python setup.py py2app """ from setuptools import setup APP = ['running-man.py'] DATA_FILES = ['images'] OPTIONS = {'argv_emulation': True} setup( app=APP, data_files=DATA_FILES, options={'py2app': OPTIONS}, setup_requires=['py2app'], ) ~ Nathan