From smichr at hotmail.com Thu Apr 1 01:35:07 2004 From: smichr at hotmail.com (C Smith) Date: Thu Apr 1 01:35:47 2004 Subject: [Pythonmac-SIG] Re: path name issues In-Reply-To: <5B89FB45-8072-11D8-A69B-000393C0D100@hotmail.com> Message-ID: On Saturday, Mar 27, 2004, at 22:42 America/Chicago, C Smith wrote: > I've noticed a wrinkle in Python operations regarding path names and > some modules and am wondering how you all deal with the issue. > > EasyDialogs gives back path names with colons in them and functions in > macpath think that paths have colons (and os.sep thinks the separator > is a colon, too). I meant to say that EasyDialogs gives back forward slashes ("/"), not colons. (The original post probably made no sense at all.) I looked again at the scripts that I was running and they now appeared to be giving colons instead of slashes--then I realized that I was running the new 2.3.3 instead of the old MacPython 2.3. Here is the test code that I ran and the results: ### import EasyDialogs print EasyDialogs.AskFileForSave() # from MacPython 2.3 /Users/csmith/Desktop/mapping/untitled # from MacPython 2.3.3 Macintosh HD:Users:csmith:Desktop:mapping:untitled ### I didn't see anything in the release notes about changes in path behavior, and when I check the EasyDialog routines (in the frameworks folder and in the Macpython 2.3.3 folder), they are identical. I have no idea what is going on. I'll just get rid of 2.3. Does anyone else have this behavior? /c -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1337 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040401/a7ef459d/attachment.bin From jum at mac.com Thu Apr 1 02:06:38 2004 From: jum at mac.com (Jens Miltner) Date: Thu Apr 1 02:06:05 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: <8DB0D329-8329-11D8-96CB-000D934FF6B4@cwi.nl> References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> <2mu105i8j4.fsf@starship.python.net> <4D6FAF26-8309-11D8-8639-0003931C36B2@mac.com> <2mptati6cc.fsf@starship.python.net> <48519965-830A-11D8-8639-0003931C36B2@mac.com> <8DB0D329-8329-11D8-96CB-000D934FF6B4@cwi.nl> Message-ID: <1F17C034-83AB-11D8-AA87-0003931014D4@mac.com> Am 31.03.2004 um 17:39 schrieb Jack Jansen: > > On 31 Mar 2004, at 13:55, Jens Miltner wrote: >>>> Do you happen to know why the /usr/bin/python executable differs >>>> from >>>> the Python.app executable, when both are in the same >>>> Python.framework? >>>> I'd assume that when the framework comes with Panther, there >>>> shouldn't >>>> be two python executables...??? >>> >>> It has something to do with the executable (aka argv[0]?) being seen >>> to be in a bundle. Is your app that embeds Python a bundle? > > And actually that is the only difference. /usr/bin/python and > ...../Python.app/Contents/MacOS/Python could have the exact same bits. >> >> Yes, it's an application package. I link against the Python.framework >> (or actually, I load it dynamically - not sure whether that makes a >> difference. Maybe I should try to link against Python.framework for >> testing purposes...) > > Then it could be you're running up against a completely different > problem. Does the hosting application have its own GUI mainloop? > Because if it has (and note it could be implicit, if you use Cocoa or > CarbonEvents) then you will probably run into problems with your > mainloop and Tk's mainloop getting in each others hair. Yes, but I don't even get that far - python raises an exception that Tk is not a known symbol, even though the script imported * from Tkinter... Strangely, the python scripts run fine when launched from the commandline, but when executed using PyRun_SimpleString from within our app, I get an error "NameError: name 'Tk' is not defined" when trying to instantiate Tk(), even though the "from Tkinter import *" statement did pass successfully... -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2351 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040401/0da62490/smime.bin From jum at mac.com Thu Apr 1 02:38:32 2004 From: jum at mac.com (Jens Miltner) Date: Thu Apr 1 02:38:11 2004 Subject: [Pythonmac-SIG] associating file types and applications... In-Reply-To: <6C745946-8354-11D8-96CB-000D934FF6B4@cwi.nl> References: <6FEEB355-8342-11D8-A68D-000A95686CD8@redivi.com> <6C745946-8354-11D8-96CB-000D934FF6B4@cwi.nl> Message-ID: <93BAE26E-83AF-11D8-9031-0003931C36B2@mac.com> Am 31.03.2004 um 22:46 schrieb Jack Jansen: > > On 31 Mar 2004, at 22:11, Tom Pollard wrote: > >> >> On Mar 31, 2004, at 1:48 PM, Daniel Greenblatt wrote: >>> Thanks for the quick response Bob, I'm not sure this solves my >>> problem >>> though (looking at my original email, I see it can be taken several >>> ways)... >>> >>> My understanding that although the Info.plist file informs the OS of >>> what >>> type of files a particular application bundle knows how to handle, it >>> doesnt necessarily tell the OS that it should use that particular >>> application when a file of that type is encountered.... >> >> The default app to use when opening a document is a property of the >> Finder. Users can always reassign particular document types to the >> app of their choosing using the Info window. So, I'm not sure it >> would be considered "playing nice" to override that preference for an >> existing filetype. I imagine if you introduce a new filetype, your >> app will automatically be the default app for opening those files. >> That's just my impression of how things work - I'm not an expert. > > There *is* a way to do this, though: the various media players > (quicktime, itunes, realplayer, windows media) all offer to handle all > your mp3s and other types for you, and if you say "yes" they do it (at > least until you override again from the finder). > > I'm not sure whether they do this through AppleEvents to the Finder, > AppleEvents to something else or a completely different mechanism, > though. AFAIK, this is still done is through InternetConfig (even though that API is kind of deprecated) - you should be able to set the default "helper app" for a file type / mime type using the InternetConfig APIs... From mwh at python.net Thu Apr 1 05:34:06 2004 From: mwh at python.net (Michael Hudson) Date: Thu Apr 1 05:34:12 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: <1F17C034-83AB-11D8-AA87-0003931014D4@mac.com> (Jens Miltner's message of "Thu, 1 Apr 2004 09:06:38 +0200") References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> <2mu105i8j4.fsf@starship.python.net> <4D6FAF26-8309-11D8-8639-0003931C36B2@mac.com> <2mptati6cc.fsf@starship.python.net> <48519965-830A-11D8-8639-0003931C36B2@mac.com> <8DB0D329-8329-11D8-96CB-000D934FF6B4@cwi.nl> <1F17C034-83AB-11D8-AA87-0003931014D4@mac.com> Message-ID: <2mptasgf6p.fsf@starship.python.net> Jens Miltner writes: > Am 31.03.2004 um 17:39 schrieb Jack Jansen: > >> Then it could be you're running up against a completely different >> problem. Does the hosting application have its own GUI mainloop? >> Because if it has (and note it could be implicit, if you use Cocoa >> or CarbonEvents) then you will probably run into problems with your >> mainloop and Tk's mainloop getting in each others hair. > > Yes, but I don't even get that far - python raises an exception that > Tk is not a known symbol, even though the script imported * from > Tkinter... This is very odd, and sounds like your problem may be something entirely other than what you think it is... > Strangely, the python scripts run fine when launched from the > commandline, but when executed using PyRun_SimpleString from within > our app, I get an error "NameError: name 'Tk' is not defined" when > trying to instantiate Tk(), even though the "from Tkinter import *" > statement did pass successfully... Maybe you could chuck a 'print dir()' in somewhere? Or an 'import Tkinter' and a 'print dir(Tkinter)'. Actually, what I suspect is happening is that somewhere you're trying to import Tkinter, it fails from being unable to import _tkinter but somehow gets silenced, so when you import Tkinter again you get a half-baked module. Perhaps you could try importing _tkinter directly where your suspect Tkinter import is? That way you might get a better error message, at least. debugging-by-remote-flailing-ly y'rs, mwh -- ZAPHOD: You know what I'm thinking? FORD: No. ZAPHOD: Neither do I. Frightening isn't it? -- The Hitch-Hikers Guide to the Galaxy, Episode 11 From gherman at darwin.in-berlin.de Thu Apr 1 06:10:38 2004 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Thu Apr 1 06:05:43 2004 Subject: [Pythonmac-SIG] Py(ObjC)- plugins for iTunes? Message-ID: <3494E310-83CD-11D8-ADFC-00039345C610@darwin.in-berlin.de> Hi, very briefly: can it be done, writing an iTunes plugin? I'd assume it might be possible with AppleScript, maybe... but, well, that's not what we want. In fact, there's a neat way of using Twisted to split streams from at least Shoutcast servers into pretty clean local MP3 files and I wonder how to tie this directly into iTunes? Dinu -- Dinu C. Gherman - http://python.net/~gherman ...................................................................... "The best way to predict the future is to invent it." (Alan Kay) From Jack.Jansen at cwi.nl Thu Apr 1 06:48:03 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu Apr 1 06:48:40 2004 Subject: [Pythonmac-SIG] Re: path name issues In-Reply-To: References: Message-ID: <6F2F1170-83D2-11D8-BF8E-000A958D1666@cwi.nl> On 1-apr-04, at 8:35, C Smith wrote: > > On Saturday, Mar 27, 2004, at 22:42 America/Chicago, C Smith wrote: > >> I've noticed a wrinkle in Python operations regarding path names and >> some modules and am wondering how you all deal with the issue. >> >> EasyDialogs gives back path names with colons in them and functions >> in macpath think that paths have colons (and os.sep thinks the >> separator is a colon, too). > > I meant to say that EasyDialogs gives back forward slashes ("/"), not > colons. (The original post probably made no sense at all.) I looked > again at the scripts that I was running and they now appeared to be > giving colons instead of slashes--then I realized that I was running > the new 2.3.3 instead of the old MacPython 2.3. Here is the test code > that I ran and the results: > > ### > import EasyDialogs > print EasyDialogs.AskFileForSave() > > # from MacPython 2.3 > /Users/csmith/Desktop/mapping/untitled > > # from MacPython 2.3.3 > Macintosh HD:Users:csmith:Desktop:mapping:untitled You had me very worried for a moment here, this would be a pretty serious problem. But, luckily, for me this doesn't happen:-) My guess is that for your second test you have used MacPython-OS9 2.3.3, is that the case? Because if that is the case then this behaviour is expected: MacPython-OS9 lives in a MacOS9 world, even when running on MacOSX, so it's pathnames are colon-separated old-style Mac pathnames. MacPython (sometimes also known as MacPython-OSX, but usually just as MacPython nowadays) lives in a Unix world and uses Unix pathnames. Note that within either MacPython or MacPython-OS9 this is all consistent, i.e. open() will expect :-pathnames in MacPython-OS9 and /-pathnames in MacPython, so there isn't really any problem, as long as you don't write pathnames to file and read them back in the other Python. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From Jack.Jansen at cwi.nl Thu Apr 1 06:51:16 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu Apr 1 06:51:53 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: <1F17C034-83AB-11D8-AA87-0003931014D4@mac.com> References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> <2mu105i8j4.fsf@starship.python.net> <4D6FAF26-8309-11D8-8639-0003931C36B2@mac.com> <2mptati6cc.fsf@starship.python.net> <48519965-830A-11D8-8639-0003931C36B2@mac.com> <8DB0D329-8329-11D8-96CB-000D934FF6B4@cwi.nl> <1F17C034-83AB-11D8-AA87-0003931014D4@mac.com> Message-ID: On 1-apr-04, at 9:06, Jens Miltner wrote: >> >> Then it could be you're running up against a completely different >> problem. Does the hosting application have its own GUI mainloop? >> Because if it has (and note it could be implicit, if you use Cocoa or >> CarbonEvents) then you will probably run into problems with your >> mainloop and Tk's mainloop getting in each others hair. > > Yes, but I don't even get that far - python raises an exception that > Tk is not a known symbol, even though the script imported * from > Tkinter... > Strangely, the python scripts run fine when launched from the > commandline, but when executed using PyRun_SimpleString from within > our app, I get an error "NameError: name 'Tk' is not defined" when > trying to instantiate Tk(), even though the "from Tkinter import *" > statement did pass successfully... Ah, you are indeed running into a completely different problem. I think there's something wrong with your sys.path, or the _tkinter.so module didn't load correctly for some reason, or something like that. Try running with the environment variable PYTHONVERBOSE set, both the command line and embedded version, and see whether there are any differences in what is imported from where. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From Jack.Jansen at cwi.nl Thu Apr 1 06:52:49 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu Apr 1 06:53:31 2004 Subject: [Pythonmac-SIG] associating file types and applications... In-Reply-To: <93BAE26E-83AF-11D8-9031-0003931C36B2@mac.com> References: <6FEEB355-8342-11D8-A68D-000A95686CD8@redivi.com> <6C745946-8354-11D8-96CB-000D934FF6B4@cwi.nl> <93BAE26E-83AF-11D8-9031-0003931C36B2@mac.com> Message-ID: <1923DE6F-83D3-11D8-BF8E-000A958D1666@cwi.nl> On 1-apr-04, at 9:38, Jens Miltner wrote: >> There *is* a way to do this, though: the various media players >> (quicktime, itunes, realplayer, windows media) all offer to handle >> all your mp3s and other types for you, and if you say "yes" they do >> it (at least until you override again from the finder). >> >> I'm not sure whether they do this through AppleEvents to the Finder, >> AppleEvents to something else or a completely different mechanism, >> though. > > AFAIK, this is still done is through InternetConfig (even though that > API is kind of deprecated) - you should be able to set the default > "helper app" for a file type / mime type using the InternetConfig > APIs... I got the impression that the Internet Config APIs had only retained the stuff to read settings under OSX, not the stuff to write settings. But I may not have looked close enough... -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From Jack.Jansen at cwi.nl Thu Apr 1 07:30:14 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu Apr 1 07:30:48 2004 Subject: [Pythonmac-SIG] Script to switch between two Pythons Message-ID: <53B9DAB4-83D8-11D8-BF8E-000A958D1666@cwi.nl> I know for sure some else did this before, but I can't remember who it was and I couldn't find the script in question back anymore, so I re-created it. Attached is my script to switch between apple-python and user-python. Call without arguments to get current enabled/disabled state of both Pythons (plus information on any inconsistencies). Call with "apple" or "user" argument to enable that Python and disable the other. Please give it a try and let me know whether it works, and/or send me the other script again so we can combine the good points from either. Then I'll put it on the website or something. -------------- next part -------------- A non-text attachment was scrubbed... Name: pyswitch Type: application/octet-stream Size: 2762 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040401/90667253/pyswitch.obj -------------- next part -------------- -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From jum at mac.com Thu Apr 1 07:56:48 2004 From: jum at mac.com (Jens Miltner) Date: Thu Apr 1 07:56:22 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> <2mu105i8j4.fsf@starship.python.net> <4D6FAF26-8309-11D8-8639-0003931C36B2@mac.com> <2mptati6cc.fsf@starship.python.net> <48519965-830A-11D8-8639-0003931C36B2@mac.com> <8DB0D329-8329-11D8-96CB-000D934FF6B4@cwi.nl> <1F17C034-83AB-11D8-AA87-0003931014D4@mac.com> Message-ID: <0964A0EF-83DC-11D8-9031-0003931C36B2@mac.com> Am 01.04.2004 um 13:51 schrieb Jack Jansen: > > On 1-apr-04, at 9:06, Jens Miltner wrote: >>> >>> Then it could be you're running up against a completely different >>> problem. Does the hosting application have its own GUI mainloop? >>> Because if it has (and note it could be implicit, if you use Cocoa >>> or CarbonEvents) then you will probably run into problems with your >>> mainloop and Tk's mainloop getting in each others hair. >> >> Yes, but I don't even get that far - python raises an exception that >> Tk is not a known symbol, even though the script imported * from >> Tkinter... >> Strangely, the python scripts run fine when launched from the >> commandline, but when executed using PyRun_SimpleString from within >> our app, I get an error "NameError: name 'Tk' is not defined" when >> trying to instantiate Tk(), even though the "from Tkinter import *" >> statement did pass successfully... > > Ah, you are indeed running into a completely different problem. I > think there's something wrong with your sys.path, or the _tkinter.so > module didn't load correctly for some reason, or something like that. > > Try running with the environment variable PYTHONVERBOSE set, both the > command line and embedded version, and see whether there are any > differences in what is imported from where. Well, I don't know exactly what to look for but there's one line in the output that looks like it might be a cause: sys:1: RuntimeWarning: Python C API version mismatch for module _cvsgui: This Python has API version 1012, module _cvsgui has version 1011. Unfortunately, I know way too little about python :( Also, I don't know why I get this warning - I thought I'd be linking against the Python.framework from the system, so I'd expect the API version to match that of the installed base...? I'm not sure whether that _is_ the problem, but apart from that, the other info looks at least similar: Here's what I get when I run python from commandline, importing Tkinter: > # installing zipimport hook > import zipimport # builtin > # installed zipimport hook > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site.py > import site # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/os.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/os.py > import os # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/os.pyc > import posix # builtin > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/posixpath.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/posixpath.py > import posixpath # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/posixpath.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/stat.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/stat.py > import stat # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/stat.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/UserDict.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/UserDict.py > import UserDict # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/UserDict.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/copy_reg.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/copy_reg.py > import copy_reg # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/copy_reg.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/types.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/types.py > import types # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/types.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/warnings.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/warnings.py > import warnings # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/warnings.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/linecache.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/linecache.py > import linecache # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/linecache.pyc > Python 2.3 (#1, Sep 13 2003, 00:49:11) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import Tkinter > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/lib-tk/Tkinter.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/lib-tk/Tkinter.py > import Tkinter # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/lib-tk/Tkinter.pyc > import _tkinter # dynamically loaded from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site-packages/_tkinter.so > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/lib-tk/Tkconstants.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/lib-tk/Tkconstants.py > import Tkconstants # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/lib-tk/Tkconstants.pyc > import MacOS # dynamically loaded from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/lib-dynload/MacOS.so and here's what I get from within our app (there are some additional modules being included by some base scripts, but I tried to include those in the commandline as well, and this didn't make any difference): > # installing zipimport hook > import zipimport # builtin > # installed zipimport hook > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site.py > import site # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/os.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/os.py > import os # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/os.pyc > import posix # builtin > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/posixpath.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/posixpath.py > import posixpath # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/posixpath.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/stat.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/stat.py > import stat # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/stat.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/UserDict.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/UserDict.py > import UserDict # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/UserDict.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/copy_reg.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/copy_reg.py > import copy_reg # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/copy_reg.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/types.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/types.py > import types # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/types.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/warnings.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/warnings.py > import warnings # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/warnings.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/linecache.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/linecache.py > import linecache # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/linecache.pyc > sys:1: RuntimeWarning: Python C API version mismatch for module > _cvsgui: This Python has API version 1012, module _cvsgui has version > 1011. > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/string.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/string.py > import string # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/string.pyc > import strop # dynamically loaded from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/lib-dynload/strop.so > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/keyword.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/keyword.py > import keyword # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/keyword.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/code.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/code.py > import code # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/code.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/traceback.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/traceback.py > import traceback # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/traceback.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/codeop.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/codeop.py > import codeop # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/codeop.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/__future__.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/__future__.py > import __future__ # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/__future__.pyc > import cvsgui # directory /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui > # /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/__init__.pyc matches > /Developer/Applications/3rd Party/MacCvs/PythonLib/cvsgui/__init__.py > import cvsgui # precompiled from /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/__init__.pyc > # /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/MacroRegistry.pyc matches > /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/MacroRegistry.py > import cvsgui.MacroRegistry # precompiled from > /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/MacroRegistry.pyc > # /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/MenuMgr.pyc matches > /Developer/Applications/3rd Party/MacCvs/PythonLib/cvsgui/MenuMgr.py > import cvsgui.MenuMgr # precompiled from /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/MenuMgr.pyc > # /Developer/Applications/3rd Party/MacCvs/PythonLib/cvsgui/Macro.pyc > matches /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/Macro.py > import cvsgui.Macro # precompiled from /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/Macro.pyc > # /Developer/Applications/3rd Party/MacCvs/PythonLib/cvsgui/App.pyc > matches /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/App.py > import cvsgui.App # precompiled from /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/App.pyc > # /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/CvsEntry.pyc matches > /Developer/Applications/3rd Party/MacCvs/PythonLib/cvsgui/CvsEntry.py > import cvsgui.CvsEntry # precompiled from /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/CvsEntry.pyc > # /Developer/Applications/3rd Party/MacCvs/PythonLib/cvsgui/CmdUI.pyc > matches /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/CmdUI.py > import cvsgui.CmdUI # precompiled from /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/CmdUI.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/getopt.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/getopt.py > import getopt # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/getopt.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/compileall.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/compileall.py > import compileall # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/compileall.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/py_compile.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/py_compile.py > import py_compile # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/py_compile.pyc > import imp # builtin > import marshal # builtin > # /Developer/Applications/3rd Party/MacCvs/PythonLib/cvsgui/Cvs.pyc > matches /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/Cvs.py > import cvsgui.Cvs # precompiled from /Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/Cvs.pyc > # > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/lib-tk/Tkinter.pyc matches > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/lib-tk/Tkinter.py > import Tkinter # precompiled from > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/lib-tk/Tkinter.pyc > Error loading /Developer/Applications/3rd > Party/MacCvs/Macros/TestMacro.py: > Traceback (most recent call last): > File "/Developer/Applications/3rd > Party/MacCvs/PythonLib/cvsgui/MacroRegistry.py", line 152, in > LoadMacrosRecurs > execfile(filename, self.m_globals) > File "/Developer/Applications/3rd Party/MacCvs/Macros/TestMacro.py", > line 4, in ? > from Tkinter import * > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/lib-tk/Tkinter.py", line 38, in ? > import _tkinter # If this fails your Python may not be configured > for Tk > ImportError: No module named _tkinter > From bob at redivi.com Thu Apr 1 10:01:12 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Apr 1 09:57:07 2004 Subject: [Pythonmac-SIG] Py(ObjC)- plugins for iTunes? In-Reply-To: <3494E310-83CD-11D8-ADFC-00039345C610@darwin.in-berlin.de> References: <3494E310-83CD-11D8-ADFC-00039345C610@darwin.in-berlin.de> Message-ID: <6A700E61-83ED-11D8-8201-000A95686CD8@redivi.com> On Apr 1, 2004, at 6:10 AM, Dinu Gherman wrote: > very briefly: can it be done, writing an iTunes plugin? I'd assume > it might be possible with AppleScript, maybe... but, well, that's > not what we want. In fact, there's a neat way of using Twisted to > split streams from at least Shoutcast servers into pretty clean > local MP3 files and I wonder how to tie this directly into iTunes? iTunes is a Carbon application, so mucking about with iTunes beyond the published plugin API and apple events is *really hard*, especially because (at least with the newest gdb and iTunes combination) gdb and/or iTunes crashes when you try and debug it. This is presumably to "protect" their already reverse engineered DRM algorithms. I assume you're talking about saving mp3 files while listening to internet radio. I would simply do this with a proxy. You connect to http://localhost:1234/recordstream?http://actual/host/ which forwards the given stream to iTunes and records it at the same time. If you stop listening with iTunes it will stop recording (or use another control mechanism, if you don't like that). Perhaps it would also automatically add the mp3 files to a particular playlist in your library or something as well, which can be done with apple events. -bob From bob at redivi.com Thu Apr 1 10:05:50 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Apr 1 10:01:44 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> Message-ID: <103D4257-83EE-11D8-8201-000A95686CD8@redivi.com> On Mar 31, 2004, at 2:46 AM, Jens Miltner wrote: > What exactly (at the code level) is the difference between pythonw and > python? > The reason I'm asking is that I'm trying to get Tkinter work with an > application that links against Python.framework and uses python as > it's scripting language (MacCvsX). > I do have problems with Tk not being recognized as a valid symbol name > in the python scripts (despite the fact that those scripts do have a > "from Tkinter import *" statement and they do work when executed from > a shell), so I thought this might be related to the pythonw vs. python > problem... > > Anybody knows what the exact difference between the two is? You have multiple versions of Python installed. It's highly likely that your application and any extensions you have built are linking against /Library/Frameworks/Python.framework (or a homedir version) but you are running a python interpreter linked to /System/Library/Frameworks/Python.framework (if you are using OS X 10.3). If that is not the exact case, then it's something very much like that case. -bob From gherman at darwin.in-berlin.de Thu Apr 1 10:09:50 2004 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Thu Apr 1 10:04:54 2004 Subject: [Pythonmac-SIG] Py(ObjC)- plugins for iTunes? In-Reply-To: <6A700E61-83ED-11D8-8201-000A95686CD8@redivi.com> Message-ID: <9F0FB468-83EE-11D8-ADFC-00039345C610@darwin.in-berlin.de> Bob Ippolito: > I assume you're talking about saving mp3 files while listening to > internet radio. I would simply do this with a proxy. You connect to > http://localhost:1234/recordstream?http://actual/host/ which forwards > the given stream to iTunes and records it at the same time. If you > stop listening with iTunes it will stop recording (or use another > control mechanism, if you don't like that). Perhaps it would also > automatically add the mp3 files to a particular playlist in your > library or something as well, which can be done with apple events. As I said, I can save it already using Itamar's chopshop script: http://www.itamarst.org/software/chopshop.py (at least for Shout- cast), but I wanted to make that more "attractive" by calling it from iTunes, somehow, although such a plugin-ability might be too much to expect, I don't know. Thanks, Dinu From bob at redivi.com Thu Apr 1 10:15:31 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Apr 1 10:11:23 2004 Subject: [Pythonmac-SIG] Py(ObjC)- plugins for iTunes? In-Reply-To: <9F0FB468-83EE-11D8-ADFC-00039345C610@darwin.in-berlin.de> References: <9F0FB468-83EE-11D8-ADFC-00039345C610@darwin.in-berlin.de> Message-ID: <6AC6585D-83EF-11D8-8201-000A95686CD8@redivi.com> On Apr 1, 2004, at 10:09 AM, Dinu Gherman wrote: > Bob Ippolito: > >> I assume you're talking about saving mp3 files while listening to >> internet radio. I would simply do this with a proxy. You connect to >> http://localhost:1234/recordstream?http://actual/host/ which forwards >> the given stream to iTunes and records it at the same time. If you >> stop listening with iTunes it will stop recording (or use another >> control mechanism, if you don't like that). Perhaps it would also >> automatically add the mp3 files to a particular playlist in your >> library or something as well, which can be done with apple events. > > As I said, I can save it already using Itamar's chopshop script: > http://www.itamarst.org/software/chopshop.py (at least for Shout- > cast), but I wanted to make that more "attractive" by calling it > from iTunes, somehow, although such a plugin-ability might be too > much to expect, I don't know. You can get information about the currently selected radio station using apple events.. you can have an application respond to a hotkey that instead plays that station through your saving-stuff-software (also using apple events)? -bob From mlpollard at earthlink.net Thu Apr 1 12:43:12 2004 From: mlpollard at earthlink.net (Tom Pollard) Date: Thu Apr 1 12:41:39 2004 Subject: [Pythonmac-SIG] associating file types and applications... In-Reply-To: <93BAE26E-83AF-11D8-9031-0003931C36B2@mac.com> References: <6FEEB355-8342-11D8-A68D-000A95686CD8@redivi.com> <6C745946-8354-11D8-96CB-000D934FF6B4@cwi.nl> <93BAE26E-83AF-11D8-9031-0003931C36B2@mac.com> Message-ID: <0C3821BF-8404-11D8-8C01-000A959B24A6@earthlink.net> On Apr 1, 2004, at 2:38 AM, Jens Miltner wrote: >>> The default app to use when opening a document is a property of the >>> Finder. Users can always reassign particular document types to the >>> app of their choosing using the Info window. So, I'm not sure it >>> would be considered "playing nice" to override that preference for >>> an existing filetype. I imagine if you introduce a new filetype, >>> your app will automatically be the default app for opening those >>> files. That's just my impression of how things work - I'm not an >>> expert. >> >> There *is* a way to do this, though: the various media players >> (quicktime, itunes, realplayer, windows media) all offer to handle >> all your mp3s and other types for you, and if you say "yes" they do >> it (at least until you override again from the finder). >> >> I'm not sure whether they do this through AppleEvents to the Finder, >> AppleEvents to something else or a completely different mechanism, >> though. > > AFAIK, this is still done is through InternetConfig (even though that > API is kind of deprecated) - you should be able to set the default > "helper app" for a file type / mime type using the InternetConfig > APIs... I don't know how to change the filetype/application association from the command line, but I did find that this information is kept in the LaunchServices property list (~/Library/Preferences/com.apple.LaunchServices.plist). You can browse this file by opening it in with the Property List Editor. It's just an XML file, so you can open it in a text editor, too. You can dump its contents to the terminal in more readble form by saying % defaults read com.apple.LaunchServices For simpler plists, the 'defaults' command would also let you change property values from the command line, but in this case that doesn't work, because 'defaults' only acts on top-level properties. LaunchServices has only a single top-level property, "LSPrefsBindings", a dictionary that associates filetypes with application bundles. Also, application bundles are identified using more that just a path to the application, but a small dictionary of information, including a binary "LSBundleLocator" that may be an alias, or something like that. There are some command-line apps included with the LaunchServices framework, in /System/Library/Frameworks/ApplicationServices.framework/Frameworks/ LaunchServices.framework/Versions/Current but none of these looks like a tool for changing filetype/application associations. I imagine poking around the Developer documentation on the ADC site would reveal a programmatic way of interacting with LaunchServices to change the associations... Cheers, Tom From bob at redivi.com Thu Apr 1 12:53:00 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Apr 1 12:48:55 2004 Subject: [Pythonmac-SIG] associating file types and applications... In-Reply-To: <0C3821BF-8404-11D8-8C01-000A959B24A6@earthlink.net> References: <6FEEB355-8342-11D8-A68D-000A95686CD8@redivi.com> <6C745946-8354-11D8-96CB-000D934FF6B4@cwi.nl> <93BAE26E-83AF-11D8-9031-0003931C36B2@mac.com> <0C3821BF-8404-11D8-8C01-000A959B24A6@earthlink.net> Message-ID: <6AD8F782-8405-11D8-8B4D-000A95686CD8@redivi.com> On Apr 1, 2004, at 12:43 PM, Tom Pollard wrote: > On Apr 1, 2004, at 2:38 AM, Jens Miltner wrote: >>>> The default app to use when opening a document is a property of the >>>> Finder. Users can always reassign particular document types to the >>>> app of their choosing using the Info window. So, I'm not sure it >>>> would be considered "playing nice" to override that preference for >>>> an existing filetype. I imagine if you introduce a new filetype, >>>> your app will automatically be the default app for opening those >>>> files. That's just my impression of how things work - I'm not an >>>> expert. >>> >>> There *is* a way to do this, though: the various media players >>> (quicktime, itunes, realplayer, windows media) all offer to handle >>> all your mp3s and other types for you, and if you say "yes" they do >>> it (at least until you override again from the finder). >>> >>> I'm not sure whether they do this through AppleEvents to the Finder, >>> AppleEvents to something else or a completely different mechanism, >>> though. >> >> AFAIK, this is still done is through InternetConfig (even though that >> API is kind of deprecated) - you should be able to set the default >> "helper app" for a file type / mime type using the InternetConfig >> APIs... > > I don't know how to change the filetype/application association from > the command line, but I did find that this information is kept in the > LaunchServices property list > (~/Library/Preferences/com.apple.LaunchServices.plist). You can > browse this file by opening it in with the Property List Editor. It's > just an XML file, so you can open it in a text editor, too. You can > dump its contents to the terminal in more readble form by saying > > % defaults read com.apple.LaunchServices > > For simpler plists, the 'defaults' command would also let you change > property values from the command line, but in this case that doesn't > work, because 'defaults' only acts on top-level properties. > LaunchServices has only a single top-level property, > "LSPrefsBindings", a dictionary that associates filetypes with > application bundles. Also, application bundles are identified using > more that just a path to the application, but a small dictionary of > information, including a binary "LSBundleLocator" that may be an > alias, or something like that. > > There are some command-line apps included with the LaunchServices > framework, in > > > /System/Library/Frameworks/ApplicationServices.framework/Frameworks/ > LaunchServices.framework/Versions/Current > > but none of these looks like a tool for changing filetype/application > associations. > > I imagine poking around the Developer documentation on the ADC site > would reveal a programmatic way of interacting with LaunchServices to > change the associations... From what I remember, I'm pretty sure LaunchServices does NOT offer that functionality to the developer. If it does, it's new with 10.3. The LaunchServices database is mostly a black box. -bob From leknarf at pacbell.net Thu Apr 1 13:01:37 2004 From: leknarf at pacbell.net (Scott Frankel) Date: Thu Apr 1 13:01:51 2004 Subject: AE for iTunes [Was: Re: [Pythonmac-SIG] Py(ObjC)- plugins for iTunes? ] In-Reply-To: <6A700E61-83ED-11D8-8201-000A95686CD8@redivi.com> References: <3494E310-83CD-11D8-ADFC-00039345C610@darwin.in-berlin.de> <6A700E61-83ED-11D8-8201-000A95686CD8@redivi.com> Message-ID: <9E88D976-8406-11D8-A374-000A95A7B782@pacbell.net> Where can I get more information about AppleEvents for iTunes? I would like to be able to use python scripts to create playlists programmatically. Thanks Scott On Apr 1, 2004, at 7:01 AM, Bob Ippolito wrote: > On Apr 1, 2004, at 6:10 AM, Dinu Gherman wrote: > >> very briefly: can it be done, writing an iTunes plugin? I'd assume >> it might be possible with AppleScript, maybe... but, well, that's >> not what we want. In fact, there's a neat way of using Twisted to >> split streams from at least Shoutcast servers into pretty clean >> local MP3 files and I wonder how to tie this directly into iTunes? > > iTunes is a Carbon application, so mucking about with iTunes beyond > the published plugin API and apple events is *really hard*, especially > because (at least with the newest gdb and iTunes combination) gdb > and/or iTunes crashes when you try and debug it. This is presumably > to "protect" their already reverse engineered DRM algorithms. > > I assume you're talking about saving mp3 files while listening to > internet radio. I would simply do this with a proxy. You connect to > http://localhost:1234/recordstream?http://actual/host/ which forwards > the given stream to iTunes and records it at the same time. If you > stop listening with iTunes it will stop recording (or use another > control mechanism, if you don't like that). Perhaps it would also > automatically add the mp3 files to a particular playlist in your > library or something as well, which can be done with apple events. > > -bob > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From jum at mac.com Thu Apr 1 13:43:46 2004 From: jum at mac.com (Jens Miltner) Date: Thu Apr 1 13:43:18 2004 Subject: AE for iTunes [Was: Re: [Pythonmac-SIG] Py(ObjC)- plugins for iTunes? ] In-Reply-To: <9E88D976-8406-11D8-A374-000A95A7B782@pacbell.net> References: <3494E310-83CD-11D8-ADFC-00039345C610@darwin.in-berlin.de> <6A700E61-83ED-11D8-8201-000A95686CD8@redivi.com> <9E88D976-8406-11D8-A374-000A95A7B782@pacbell.net> Message-ID: <8286EBDF-840C-11D8-AA87-0003931014D4@mac.com> Am 01.04.2004 um 20:01 schrieb Scott Frankel: > > Where can I get more information about AppleEvents for iTunes? I > would like > to be able to use python scripts to create playlists programmatically. Take a look at iTunes' scripting dictionary (e.g. drop it onto Script Editor). The AE interface is published there... > > Thanks > Scott > > > On Apr 1, 2004, at 7:01 AM, Bob Ippolito wrote: > >> On Apr 1, 2004, at 6:10 AM, Dinu Gherman wrote: >> >>> very briefly: can it be done, writing an iTunes plugin? I'd assume >>> it might be possible with AppleScript, maybe... but, well, that's >>> not what we want. In fact, there's a neat way of using Twisted to >>> split streams from at least Shoutcast servers into pretty clean >>> local MP3 files and I wonder how to tie this directly into iTunes? >> >> iTunes is a Carbon application, so mucking about with iTunes beyond >> the published plugin API and apple events is *really hard*, >> especially because (at least with the newest gdb and iTunes >> combination) gdb and/or iTunes crashes when you try and debug it. >> This is presumably to "protect" their already reverse engineered DRM >> algorithms. >> >> I assume you're talking about saving mp3 files while listening to >> internet radio. I would simply do this with a proxy. You connect to >> http://localhost:1234/recordstream?http://actual/host/ which forwards >> the given stream to iTunes and records it at the same time. If you >> stop listening with iTunes it will stop recording (or use another >> control mechanism, if you don't like that). Perhaps it would also >> automatically add the mp3 files to a particular playlist in your >> library or something as well, which can be done with apple events. >> >> -bob >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG@python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@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: 2351 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040401/f5d56796/smime.bin From Jack.Jansen at cwi.nl Thu Apr 1 15:32:38 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu Apr 1 15:32:39 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: <103D4257-83EE-11D8-8201-000A95686CD8@redivi.com> References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> <103D4257-83EE-11D8-8201-000A95686CD8@redivi.com> Message-ID: On 1 Apr 2004, at 17:05, Bob Ippolito wrote: > On Mar 31, 2004, at 2:46 AM, Jens Miltner wrote: > >> What exactly (at the code level) is the difference between pythonw >> and python? >> The reason I'm asking is that I'm trying to get Tkinter work with an >> application that links against Python.framework and uses python as >> it's scripting language (MacCvsX). >> I do have problems with Tk not being recognized as a valid symbol >> name in the python scripts (despite the fact that those scripts do >> have a "from Tkinter import *" statement and they do work when >> executed from a shell), so I thought this might be related to the >> pythonw vs. python problem... >> >> Anybody knows what the exact difference between the two is? > > You have multiple versions of Python installed. It's highly likely > that your application and any extensions you have built are linking > against /Library/Frameworks/Python.framework (or a homedir version) > but you are running a python interpreter linked to > /System/Library/Frameworks/Python.framework (if you are using OS X > 10.3). If that is not the exact case, then it's something very much > like that case. Bob is right, probably. You are apparently using Alexandre Parenteau's MacCVS stuff in your application (I might be giving Alexandre too much credits here, I haven't a clue how many people are involved with MacCVS/WinCVS/cvsGUI, but he was always the main contact point back when I used it a lot). My guess is that this is linked against an older Python framework, probably MacPython 2.2. The warning message about _cvsgui is in a funny place, though, but I assume this is because the warning goes to stderr and the other messages to stdout or something. Then something happens that I don't fully understand, but it is probably caused by the problem above: _tkinter.so fails to load (or cannot be found), this is the last line. From here on everything is understandable again: if you do another "import Tkinter" you will get the incomplete Tkinter module that failed to import _tkinter, and hence it misses all the interesting bits. I think you will be able to reproduce this problem with command-line Python by doing "import cvsgui" before you import Tkinter. You may have to add /Developer/Applications/3rd Party/MacCvs/PythonLib to sys.path before importing cvsgui. If you manage to reproduce the problem with the commandline: try again, but now run with "pythonw -vv". This will make python *very* verbose on imports, also telling you about the failed attempts. Hopefully this will tell you more, or otherwise send the transcript here again and we'll have a look. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From aparente at adobe.com Thu Apr 1 17:43:23 2004 From: aparente at adobe.com (Alexandre Parenteau) Date: Thu Apr 1 17:43:12 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> <103D4257-83EE-11D8-8201-000A95686CD8@redivi.com> Message-ID: <6.0.0.22.2.20040401143731.02fb3008@mailsj.corp.adobe.com> Hi, Jens is the new maintainer of MacCvsX. I have the same symptom using 10.3. Which probably means Apple doesn't provide Tkinter with 10.3. In fact MacCvsX uses Python.framework but doesn't link against it. It is using (last time I checked) the DYLIB loader. I don't know if having Jack's latest 10.3 (which installs on /Library) or Jack's add-on (on top of /System) will work (assuming you install Tkinter as well, which is an additional step I believe). I suspect the former might not, but the later should. So In fact I don't know... alex. At 12:32 PM 4/1/2004, Jack Jansen wrote: >On 1 Apr 2004, at 17:05, Bob Ippolito wrote: > >>On Mar 31, 2004, at 2:46 AM, Jens Miltner wrote: >> >>>What exactly (at the code level) is the difference between pythonw and >>>python? >>>The reason I'm asking is that I'm trying to get Tkinter work with an >>>application that links against Python.framework and uses python as it's >>>scripting language (MacCvsX). >>>I do have problems with Tk not being recognized as a valid symbol name >>>in the python scripts (despite the fact that those scripts do have a >>>"from Tkinter import *" statement and they do work when executed from a >>>shell), so I thought this might be related to the pythonw vs. python problem... >>> >>>Anybody knows what the exact difference between the two is? >> >>You have multiple versions of Python installed. It's highly likely that >>your application and any extensions you have built are linking against >>/Library/Frameworks/Python.framework (or a homedir version) but you are >>running a python interpreter linked to >>/System/Library/Frameworks/Python.framework (if you are using OS X >>10.3). If that is not the exact case, then it's something very much like >>that case. > >Bob is right, probably. You are apparently using Alexandre Parenteau's >MacCVS stuff in your application (I might be giving Alexandre too much >credits here, I haven't a clue how many people are involved with >MacCVS/WinCVS/cvsGUI, but he was always the main contact point back when I >used it a lot). My guess is that this is linked against an older Python >framework, probably MacPython 2.2. The warning message about _cvsgui is in >a funny place, though, but I assume this is because the warning goes to >stderr and the other messages to stdout or something. > >Then something happens that I don't fully understand, but it is probably >caused by the problem above: _tkinter.so fails to load (or cannot be >found), this is the last line. > > From here on everything is understandable again: if you do another > "import Tkinter" you will get the incomplete Tkinter module that failed > to import _tkinter, and hence it misses all the interesting bits. > >I think you will be able to reproduce this problem with command-line >Python by doing "import cvsgui" before you import Tkinter. You may have to >add /Developer/Applications/3rd Party/MacCvs/PythonLib to sys.path before >importing cvsgui. > >If you manage to reproduce the problem with the commandline: try again, >but now run with "pythonw -vv". This will make python *very* verbose on >imports, also telling you about the failed attempts. Hopefully this will >tell you more, or otherwise send the transcript here again and we'll have >a look. >-- >Jack Jansen, , http://www.cwi.nl/~jack >If I can't dance I don't want to be part of your revolution -- Emma Goldman > > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG@python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig From hengist.podd at virgin.net Thu Apr 1 18:43:38 2004 From: hengist.podd at virgin.net (has) Date: Thu Apr 1 18:44:02 2004 Subject: [Pythonmac-SIG] Re: AE for iTunes In-Reply-To: <9E88D976-8406-11D8-A374-000A95A7B782@pacbell.net> References: <3494E310-83CD-11D8-ADFC-00039345C610@darwin.in-berlin.de> <6A700E61-83ED-11D8-8201-000A95686CD8@redivi.com> <9E88D976-8406-11D8-A374-000A95A7B782@pacbell.net> Message-ID: Scott Frankel wrote: >Where can I get more information about AppleEvents for iTunes? I would like >to be able to use python scripts to create playlists programmatically. See . Any questions, fire away. HTH has -- http://freespace.virgin.net/hamish.sanderson/ From smichr at hotmail.com Thu Apr 1 18:44:47 2004 From: smichr at hotmail.com (C Smith) Date: Thu Apr 1 18:45:24 2004 Subject: [Pythonmac-SIG] Re: path name issues Message-ID: <8F93FEA5-8436-11D8-BE6F-000393C0D100@hotmail.com> On Thursday, Apr 1, 2004, at 06:11 Jack Jansen wrote: >> [posting regarding getting '/' or ':' as separators, depending on the >> version of macPython being used] > You had me very worried for a moment here, this would be a pretty > serious problem. But, luckily, for me this doesn't happen:-) > > My guess is that for your second test you have used MacPython-OS9 > 2.3.3, is that the case? > Yes, it was as you said. (From what I've seen on the MacPython site, there isn't a 2.3.3 yet for OS X, right?) > Because if that is the case then this behaviour is expected: > MacPython-OS9 lives in a MacOS9 world, even when running on MacOSX, so > it's pathnames are colon-separated old-style Mac pathnames. MacPython > (sometimes also known as MacPython-OSX, but usually just as MacPython > nowadays) lives in a Unix world and uses Unix pathnames. > OK, that's the kind of feedback I was hoping to get from an earlier post. I now understand the naming convention and difference between the two MacPythons. > Note that within either MacPython or MacPython-OS9 this is all > consistent, i.e. open() will expect :-pathnames in MacPython-OS9 and > /-pathnames in MacPython, so there isn't really any problem, as long > as you don't write pathnames to file and read them back in the other > Python. > Well...here's where I go back to the original post. EasyDialogs gives back unix type paths but macpath deals with colons. [break to learn what is actually getting loaded that lets os.path work properly when it is (I thought) loading macpath for me] OK, I'll spare the reader the discovery that I now realize that I have to pay attention to the fact that I am in darwin (something I ignore for the most part, pretending that I'm just working on a nice Mac system). So I really shouldn't be loading macpath because I'm not in "mac mode" when I'm running MacPython 2.3 under OS X. Instead I should just load os and use os.path (which will handle everything that I was trying to do in macpath. OK, here's a plea/suggestion: Could the modules like macpath and macurl2path (and others) that really shouldn't be loaded directly (because a master-loader like os or urllib is doing the decision of which *path should be loaded) be put/buried in a folder like 'lib_support'? This could include other files like ntpath, etc..., too. And if the directory layout is not to be changed, perhaps a note like that appearing in posixpath and macurl2path could be added to macpath: "Do not import this module directly, import os and refer to this module as os.path. etc..." If the former suggestion were taken, then maybe a general note in the directory could give the "Don't load these directly" message rather than appearing in each individual file. Such a format would help me to focus on the module that I should be using instead of the one that I thought I should be using. It would also clean up the "noise" in the directory as well (e.g. I shouldn't be worrying about ntpath on the mac, so I probably shouldn't see it in my main lib directory). Thanks for the help, Jack, in pointing out what I was missing. /c From wtbridgman at radix.net Thu Apr 1 20:28:44 2004 From: wtbridgman at radix.net (W.T. Bridgman) Date: Thu Apr 1 20:26:42 2004 Subject: [Pythonmac-SIG] Installing tkinter on Panther w/o PackageManager? Message-ID: <150EEFC0-8445-11D8-A1F4-0050E485FC7A@radix.net> I've come across some messages from last December about building Tk so that it sees the Apple-installed Tcl and then building tkinter linking to the Apple-installed Python. Has anyone 'finalized' a procedure for installing tkinter without the PackageManager or Fink? I can't find anything on the Wiki about this option. Everyone seems to be pushing PM - not always an option for some installations. Thanks, Tom From jum at mac.com Fri Apr 2 01:58:29 2004 From: jum at mac.com (Jens Miltner) Date: Fri Apr 2 01:57:20 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: <6.0.0.22.2.20040401143731.02fb3008@mailsj.corp.adobe.com> References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> <103D4257-83EE-11D8-8201-000A95686CD8@redivi.com> <6.0.0.22.2.20040401143731.02fb3008@mailsj.corp.adobe.com> Message-ID: <25A1D10C-8473-11D8-9DF0-0003931C36B2@mac.com> Am 02.04.2004 um 00:43 schrieb Alexandre Parenteau: > Hi, > > Jens is the new maintainer of MacCvsX. > > I have the same symptom using 10.3. Which probably means Apple doesn't > provide Tkinter with 10.3. > > In fact MacCvsX uses Python.framework but doesn't link against it. It > is using (last time I checked) the DYLIB loader. I don't know if > having Jack's latest 10.3 (which installs on /Library) or Jack's > add-on (on top of /System) will work (assuming you install Tkinter as > well, which is an additional step I believe). I suspect the former > might not, but the later should. Well, I installed AquaTk and also Jack's add-on on top of the system 10.3 Python installation (or the other way round - can't remember, but it was the "recommended" way to get Tkinter installed), so in theory, Tk should work (and, as I mentioned, it works fine from the commandline)... I'll try to reproduce with the commandline, but actually, I doubt that importing cvsgui from the commandline will work, since MacCvs actually implements some python objects, which I assume are exported inside cvsgui... (as I mentioned before, my knowledge of python and the python integration in MacCvs is still rather shallow, so I may not know what I'm talking about here :( ) Regarding the different Python versions: I assume it's all about which headers I include, right? I now remember that I'm probably linking against the 10.2.8 SDK, so that would make me include 10.2 Python distribution headers. I'll check this... Could this be the problem? Could Tkinter fail to load when some python module is loaded that was compiled against the old headers? Do you know of any other environment variable to enable more debug output about the loading of modules? > > So In fact I don't know... > > alex. > > At 12:32 PM 4/1/2004, Jack Jansen wrote: > >> On 1 Apr 2004, at 17:05, Bob Ippolito wrote: >> >>> On Mar 31, 2004, at 2:46 AM, Jens Miltner wrote: >>> >>>> What exactly (at the code level) is the difference between pythonw >>>> and python? >>>> The reason I'm asking is that I'm trying to get Tkinter work with >>>> an application that links against Python.framework and uses python >>>> as it's scripting language (MacCvsX). >>>> I do have problems with Tk not being recognized as a valid symbol >>>> name in the python scripts (despite the fact that those scripts do >>>> have a "from Tkinter import *" statement and they do work when >>>> executed from a shell), so I thought this might be related to the >>>> pythonw vs. python problem... >>>> >>>> Anybody knows what the exact difference between the two is? >>> >>> You have multiple versions of Python installed. It's highly likely >>> that your application and any extensions you have built are linking >>> against /Library/Frameworks/Python.framework (or a homedir version) >>> but you are running a python interpreter linked to >>> /System/Library/Frameworks/Python.framework (if you are using OS X >>> 10.3). If that is not the exact case, then it's something very much >>> like that case. >> >> Bob is right, probably. You are apparently using Alexandre >> Parenteau's MacCVS stuff in your application (I might be giving >> Alexandre too much credits here, I haven't a clue how many people are >> involved with MacCVS/WinCVS/cvsGUI, but he was always the main >> contact point back when I used it a lot). My guess is that this is >> linked against an older Python framework, probably MacPython 2.2. The >> warning message about _cvsgui is in a funny place, though, but I >> assume this is because the warning goes to stderr and the other >> messages to stdout or something. >> >> Then something happens that I don't fully understand, but it is >> probably caused by the problem above: _tkinter.so fails to load (or >> cannot be found), this is the last line. >> >> From here on everything is understandable again: if you do another >> "import Tkinter" you will get the incomplete Tkinter module that >> failed to import _tkinter, and hence it misses all the interesting >> bits. >> >> I think you will be able to reproduce this problem with command-line >> Python by doing "import cvsgui" before you import Tkinter. You may >> have to add /Developer/Applications/3rd Party/MacCvs/PythonLib to >> sys.path before importing cvsgui. >> >> If you manage to reproduce the problem with the commandline: try >> again, but now run with "pythonw -vv". This will make python *very* >> verbose on imports, also telling you about the failed attempts. >> Hopefully this will tell you more, or otherwise send the transcript >> here again and we'll have a look. >> -- >> Jack Jansen, , http://www.cwi.nl/~jack From jum at mac.com Fri Apr 2 04:06:55 2004 From: jum at mac.com (Jens Miltner) Date: Fri Apr 2 04:06:06 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> <103D4257-83EE-11D8-8201-000A95686CD8@redivi.com> Message-ID: <16F31C2E-8485-11D8-9DF0-0003931C36B2@mac.com> Am 01.04.2004 um 22:32 schrieb Jack Jansen: > > On 1 Apr 2004, at 17:05, Bob Ippolito wrote: > >> On Mar 31, 2004, at 2:46 AM, Jens Miltner wrote: >> >>> What exactly (at the code level) is the difference between pythonw >>> and python? >>> The reason I'm asking is that I'm trying to get Tkinter work with an >>> application that links against Python.framework and uses python as >>> it's scripting language (MacCvsX). >>> I do have problems with Tk not being recognized as a valid symbol >>> name in the python scripts (despite the fact that those scripts do >>> have a "from Tkinter import *" statement and they do work when >>> executed from a shell), so I thought this might be related to the >>> pythonw vs. python problem... >>> >>> Anybody knows what the exact difference between the two is? >> >> You have multiple versions of Python installed. It's highly likely >> that your application and any extensions you have built are linking >> against /Library/Frameworks/Python.framework (or a homedir version) >> but you are running a python interpreter linked to >> /System/Library/Frameworks/Python.framework (if you are using OS X >> 10.3). If that is not the exact case, then it's something very much >> like that case. > > Bob is right, probably. You are apparently using Alexandre Parenteau's > MacCVS stuff in your application (I might be giving Alexandre too much > credits here, I haven't a clue how many people are involved with > MacCVS/WinCVS/cvsGUI, but he was always the main contact point back > when I used it a lot). My guess is that this is linked against an > older Python framework, probably MacPython 2.2. The warning message > about _cvsgui is in a funny place, though, but I assume this is > because the warning goes to stderr and the other messages to stdout or > something. > > Then something happens that I don't fully understand, but it is > probably caused by the problem above: _tkinter.so fails to load (or > cannot be found), this is the last line. > > From here on everything is understandable again: if you do another > "import Tkinter" you will get the incomplete Tkinter module that > failed to import _tkinter, and hence it misses all the interesting > bits. > > I think you will be able to reproduce this problem with command-line > Python by doing "import cvsgui" before you import Tkinter. You may > have to add /Developer/Applications/3rd Party/MacCvs/PythonLib to > sys.path before importing cvsgui. > > If you manage to reproduce the problem with the commandline: try > again, but now run with "pythonw -vv". This will make python *very* > verbose on imports, also telling you about the failed attempts. > Hopefully this will tell you more, or otherwise send the transcript > here again and we'll have a look. O.k., some more info here: I tried to import cvsgui from the commandline and that worked (I assume the pure "import cvsgui" doesn't do a lot as long as I don't attempt to use the objects?) and a following from Tkinter import * root=Tk() also worked fine from the commandline. I then wrote a macro that dumps out sys.path and found the following difference: from the commandline: >>> for p in sys.path: ... print p ... /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python23.zip /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3 /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-darwin /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/lib-scriptpackages /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ lib-tk /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ lib-dynload /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages from MacCvsX's macro execution (executing the same statement as above): /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python23.zip /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-darwin /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/lib-scriptpackages /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ lib-tk /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ lib-dynload /Developer/Applications/3rd Party/MacCvs/PythonLib So the "site-packages" path is missing when running from within MacCvsX. Since I installed _tkinter using the Packagemanager, that _is_ the problem: When I added this path hardcoded for test purposes in our python initilization, importing Tkinter worked fine. Now, the remaining question is: who is adding this path? Unfortunately, now that I had Tkinter imported properly, I also had to find that I run into the exact problem you already mentioned, namely Tkinter installing it's own event loop. Is there any Tk package that won't do this (or launch an external app to run the UI)? How is this solved on other platforms? Do you know of Tk packages that don't set up a complete event loop, but use e.g. CarbonEvents to manage their widgets, so that they don't interfere with a hosting app's event handling? Any better place to ask thow Tkinter-related questions? From mwh at python.net Fri Apr 2 04:23:11 2004 From: mwh at python.net (Michael Hudson) Date: Fri Apr 2 04:23:23 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: <16F31C2E-8485-11D8-9DF0-0003931C36B2@mac.com> (Jens Miltner's message of "Fri, 2 Apr 2004 11:06:55 +0200") References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> <103D4257-83EE-11D8-8201-000A95686CD8@redivi.com> <16F31C2E-8485-11D8-9DF0-0003931C36B2@mac.com> Message-ID: <2m65cihgxs.fsf@starship.python.net> Jens Miltner writes: [site-packages] > Now, the remaining question is: who is adding this path? It's done in site.py. Could sys.prefix be messed up? Cheers, mwh -- Many of the posts you see on Usenet are actually from moths. You can tell which posters they are by their attraction to the flames. -- Internet Oracularity #1279-06 From jum at mac.com Fri Apr 2 04:29:44 2004 From: jum at mac.com (Jens Miltner) Date: Fri Apr 2 04:28:28 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: <2m65cihgxs.fsf@starship.python.net> References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> <103D4257-83EE-11D8-8201-000A95686CD8@redivi.com> <16F31C2E-8485-11D8-9DF0-0003931C36B2@mac.com> <2m65cihgxs.fsf@starship.python.net> Message-ID: <4703F8B1-8488-11D8-9DF0-0003931C36B2@mac.com> Am 02.04.2004 um 11:23 schrieb Michael Hudson: > Jens Miltner writes: > > [site-packages] > >> Now, the remaining question is: who is adding this path? > > It's done in site.py. Could sys.prefix be messed up? No, both sys.prefix'es are "/System/Library/Frameworks/Python.framework/Versions/2.3"... From Chris.Barker at noaa.gov Fri Apr 2 12:47:22 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Fri Apr 2 12:47:18 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: <16F31C2E-8485-11D8-9DF0-0003931C36B2@mac.com> References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> <103D4257-83EE-11D8-8201-000A95686CD8@redivi.com> <16F31C2E-8485-11D8-9DF0-0003931C36B2@mac.com> Message-ID: <406DA72A.4040706@noaa.gov> Jens Miltner wrote: > Unfortunately, now that I had Tkinter imported properly, I also had to > find that I run into the exact problem you already mentioned, namely > Tkinter installing it's own event loop. > Is there any Tk package that won't do this (or launch an external app > to run the UI)? > How is this solved on other platforms? > Do you know of Tk packages that don't set up a complete event loop, but > use e.g. CarbonEvents to manage their widgets, so that they don't > interfere with a hosting app's event handling? The easiest answer is "don't do that". In general, you're going ot ahve a much easier time in a python embedded project using the same GUI toolkit for C++ and python. wxWidgets+wxPython, for example. Why do you want to use TKinter? why not use the Carbon stuff from Python instead? MacCVS is not cross platform anyway. Another option is to see if you can use PyObjC and Cocoa, though I don't know how hard it is to mix Cocoa and Carbon. In the long run, your best bet would be to make a cross pl;atform app with wxWidgets or QT, or make a Mac app with Cocoa, but that may be more change than you want to deal with... There are also other efforts along these lines anyway, at least for Subversion. See: RapidSVN for a wxWidgets version: http://rapidsvn.tigris.org/ SVEN for Cocoa version: http://www.nikwest.de/Software/#SvenOverview PySVN for a wxPython cversionhttp://pysvn.tigris.org/ There are WAY to many SVN and CVS clients under development, I'd love to see more collaboration. I wouldn't put much work into a CVS client without having Subversion support in mind anyway. By the way, I think there is some relvance here to our recent discussion about X-platform toolkits. If you are writing a SVN or CVS client, you are writing "just the GUI part". The functional code is developed separately. And yet, there is a LOT of work to do to write a good GUI, and it has to be done differently for each toolkit used. It still might be true that to get the best possible Mac client, you'd want to use Cocoa, rather than wxWidgets or QT, or ..., but it's clear that there is a lot of extra work to do when you make that choice. Fortunately, there are a lot of people that want to write SVN and CVS clients, so maybe we will get really nice native clients on all platforms. -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 Chris.Barker@noaa.gov From bob at redivi.com Fri Apr 2 14:35:12 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Apr 2 14:31:09 2004 Subject: [Pythonmac-SIG] ANN: SystemConfiguration wrapper In-Reply-To: <073FD03A-0209-11D8-B59D-000A95686CD8@redivi.com> References: <073FD03A-0209-11D8-B59D-000A95686CD8@redivi.com> Message-ID: http://undefined.org/python/SystemConfiguration-0.3.tar.gz Ok, so I haven't gotten around to adding the stuff from MoreSCF... but it does have more examples. You probably want to use PyObjC from a very recent CVS (as in, today or so) to run the battery following example, because you really want the new signal handling support. It should build with Project Builder, because I left the project file as a pbproj and haven't edited it, but I have only been testing on Xcode.. so YMMV. It's probably useful even if you are not using Python, as the wrapper takes the CoreFoundation based SystemConfiguration API and gives it a nice autoreleased ObjC API. -bob On Oct 19, 2003, at 3:51 AM, Bob Ippolito wrote: > This is a source distribution, it requires PyObjC and Developer Tools. > The wrapper itself is (entirely) an ObjC framework, but it includes > everything necessary for Python wrapping. I haven't done any > documentation, real tests, especially testing of the runloop > integration.. but here it is if someone wants to play with it. The > ObjC is a little sloppy (three classes in one file), and the setup.py > is a lot sloppy (thanks to distutils being not easily extensible), but > it works.. or at least it should. > > I'll be adding stuff from MoreSCF, probably tomorrow, and writing more > tests/examples and possibly some documentation over the next couple > days. From aparente at adobe.com Fri Apr 2 15:22:57 2004 From: aparente at adobe.com (Alexandre Parenteau) Date: Fri Apr 2 15:23:55 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: <16F31C2E-8485-11D8-9DF0-0003931C36B2@mac.com> References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> <103D4257-83EE-11D8-8201-000A95686CD8@redivi.com> <16F31C2E-8485-11D8-9DF0-0003931C36B2@mac.com> Message-ID: <6.0.0.22.2.20040402121846.030b2120@mailsj.corp.adobe.com> Jens, I think I understand what is going on. There might be a code inside MacCvsX which tries to add-on to the sys.path. I think it is making a mistake to get the initial path from Py_GetPath (which doesn't include the site-packages) and then overriding the sys.path by calling Py_SetSysPath Here is a code that should work and preserve the site-packages site: #if 0 // this is not the sys.path, this is the import path path = Py_GetPath(); #else // so instead we call sys.path CPyObject m(PyImport_ImportModule("sys")); PyObject *d = PyModule_GetDict(m); PyObject *p = PyDict_GetItemString(d, "path"); if(p && PyList_Check(p)) { for(int i = 0; i < PyList_Size(p); i++) { PyObject *e = PyList_GetItem(p, i); if(e && PyString_Check(e)) { if(path.empty()) path = PyString_AsString(e); else { path += DELIM; path += PyString_AsString(e); } } } } else path = Py_GetPath(); #endif .... path += DELIM path += /cvsgui/pythonlib/path Py_SetSysPath(path) N.B.: CPyObject is a smart pointer, it will deref 'm' This code should work in WinCvs/gCVS too. Regards. alex. At 01:06 AM 4/2/2004, Jens Miltner wrote: >Am 01.04.2004 um 22:32 schrieb Jack Jansen: > >> >>On 1 Apr 2004, at 17:05, Bob Ippolito wrote: >> >>>On Mar 31, 2004, at 2:46 AM, Jens Miltner wrote: >>> >>>>What exactly (at the code level) is the difference between pythonw >>>>and python? >>>>The reason I'm asking is that I'm trying to get Tkinter work with an >>>>application that links against Python.framework and uses python as >>>>it's scripting language (MacCvsX). >>>>I do have problems with Tk not being recognized as a valid symbol >>>>name in the python scripts (despite the fact that those scripts do >>>>have a "from Tkinter import *" statement and they do work when >>>>executed from a shell), so I thought this might be related to the >>>>pythonw vs. python problem... >>>> >>>>Anybody knows what the exact difference between the two is? >>> >>>You have multiple versions of Python installed. It's highly likely >>>that your application and any extensions you have built are linking >>>against /Library/Frameworks/Python.framework (or a homedir version) >>>but you are running a python interpreter linked to >>>/System/Library/Frameworks/Python.framework (if you are using OS X >>>10.3). If that is not the exact case, then it's something very much >>>like that case. >> >>Bob is right, probably. You are apparently using Alexandre Parenteau's >>MacCVS stuff in your application (I might be giving Alexandre too much >>credits here, I haven't a clue how many people are involved with >>MacCVS/WinCVS/cvsGUI, but he was always the main contact point back >>when I used it a lot). My guess is that this is linked against an >>older Python framework, probably MacPython 2.2. The warning message >>about _cvsgui is in a funny place, though, but I assume this is >>because the warning goes to stderr and the other messages to stdout or >>something. >> >>Then something happens that I don't fully understand, but it is >>probably caused by the problem above: _tkinter.so fails to load (or >>cannot be found), this is the last line. >> >> From here on everything is understandable again: if you do another >>"import Tkinter" you will get the incomplete Tkinter module that >>failed to import _tkinter, and hence it misses all the interesting >>bits. >> >>I think you will be able to reproduce this problem with command-line >>Python by doing "import cvsgui" before you import Tkinter. You may >>have to add /Developer/Applications/3rd Party/MacCvs/PythonLib to >>sys.path before importing cvsgui. >> >>If you manage to reproduce the problem with the commandline: try >>again, but now run with "pythonw -vv". This will make python *very* >>verbose on imports, also telling you about the failed attempts. >>Hopefully this will tell you more, or otherwise send the transcript >>here again and we'll have a look. > >O.k., some more info here: > >I tried to import cvsgui from the commandline and that worked (I assume >the pure "import cvsgui" doesn't do a lot as long as I don't attempt to >use the objects?) and a following > >from Tkinter import * >root=Tk() > >also worked fine from the commandline. > > >I then wrote a macro that dumps out sys.path and found the following >difference: > >from the commandline: > >>> for p in sys.path: >... print p >... > >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python23.zip >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3 >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ >plat-darwin >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ >plat-mac >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ >plat-mac/lib-scriptpackages >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ lib-tk >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ >lib-dynload >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ >site-packages > > >from MacCvsX's macro execution (executing the same statement as above): > >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python23.zip >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ >plat-darwin >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ >plat-mac >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ >plat-mac/lib-scriptpackages >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ lib-tk >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ >lib-dynload >/Developer/Applications/3rd Party/MacCvs/PythonLib > > >So the "site-packages" path is missing when running from within >MacCvsX. Since I installed _tkinter using the Packagemanager, that _is_ >the problem: >When I added this path hardcoded for test purposes in our python >initilization, importing Tkinter worked fine. > >Now, the remaining question is: who is adding this path? > >Unfortunately, now that I had Tkinter imported properly, I also had to >find that I run into the exact problem you already mentioned, namely >Tkinter installing it's own event loop. >Is there any Tk package that won't do this (or launch an external app >to run the UI)? >How is this solved on other platforms? >Do you know of Tk packages that don't set up a complete event loop, but >use e.g. CarbonEvents to manage their widgets, so that they don't >interfere with a hosting app's event handling? >Any better place to ask thow Tkinter-related questions? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20040402/6e858f66/attachment.html From Jack.Jansen at cwi.nl Fri Apr 2 15:58:59 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri Apr 2 15:59:03 2004 Subject: [Pythonmac-SIG] Re: path name issues In-Reply-To: <8F93FEA5-8436-11D8-BE6F-000393C0D100@hotmail.com> References: <8F93FEA5-8436-11D8-BE6F-000393C0D100@hotmail.com> Message-ID: <901B4292-84E8-11D8-8873-000D934FF6B4@cwi.nl> On 2 Apr 2004, at 01:44, C Smith wrote: > Well...here's where I go back to the original post. EasyDialogs gives > back unix type paths but macpath deals with colons. > > [break to learn what is actually getting loaded that lets os.path work > properly when it is (I thought) loading macpath for me] > > OK, I'll spare the reader the discovery that I now realize that I have > to pay attention to the fact that I am in darwin (something I ignore > for the most part, pretending that I'm just working on a nice Mac > system). So I really shouldn't be loading macpath because I'm not in > "mac mode" when I'm running MacPython 2.3 under OS X. Instead I > should just load os and use os.path (which will handle everything that > I was trying to do in macpath. Aha, now I see the confusion. ntpath/posixpath/macpath have been in Python since before 1.0, and it has never really been a problem since people knew they were on nt, posix or a mac. Only now is it starting to be a problem because people who have a Macintosh have the absolutely silly idea that they're on a mac:-) > OK, here's a plea/suggestion: > > Could the modules like macpath and macurl2path (and others) that > really shouldn't be loaded directly (because a master-loader like os > or urllib is doing the decision of which *path should be loaded) be > put/buried in a folder like 'lib_support'? This could include other > files like ntpath, etc..., too. I don't think this is an option, because lots of software that is out there that uses those modules directly does so explicitly to do cross-platform pathname things. What you could do is check that this isn't mentioned in the documentation (assuming you haven't read that already:-), and if it isn't or if you feel it merits better treatment add a sourceforge bug report to that effect. I'll add a quick note to the FAQ, in the mean time. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From Jack.Jansen at cwi.nl Fri Apr 2 16:14:11 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri Apr 2 16:14:16 2004 Subject: [Pythonmac-SIG] Installing tkinter on Panther w/o PackageManager? In-Reply-To: <150EEFC0-8445-11D8-A1F4-0050E485FC7A@radix.net> References: <150EEFC0-8445-11D8-A1F4-0050E485FC7A@radix.net> Message-ID: On 2 Apr 2004, at 03:28, W.T. Bridgman wrote: > Has anyone 'finalized' a procedure for installing tkinter without the > PackageManager or Fink? I can't find anything on the Wiki about this > option. Everyone seems to be pushing PM - not always an option for > some installations. In the case of _tkinter (and I think readline, and possibly one or two others) this is a bit of a problem, because I've built the binary installers in an ad-hoc way: I built the modules from source during a normal Python build and then manually stuffed them into a tarfile. But of course you could simply grab the tarfile and extract it in the right place. I think if you're in / when you unpack the tarfile everything will work fine. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From bob at redivi.com Fri Apr 2 16:26:06 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Apr 2 16:22:05 2004 Subject: [Pythonmac-SIG] Installing tkinter on Panther w/o PackageManager? In-Reply-To: References: <150EEFC0-8445-11D8-A1F4-0050E485FC7A@radix.net> Message-ID: <5A46D1B9-84EC-11D8-8B4D-000A95686CD8@redivi.com> On Apr 2, 2004, at 4:14 PM, Jack Jansen wrote: > > On 2 Apr 2004, at 03:28, W.T. Bridgman wrote: >> Has anyone 'finalized' a procedure for installing tkinter without the >> PackageManager or Fink? I can't find anything on the Wiki about this >> option. Everyone seems to be pushing PM - not always an option for >> some installations. > > In the case of _tkinter (and I think readline, and possibly one or two > others) this is a bit of a problem, because I've built the binary > installers in an ad-hoc way: I built the modules from source during a > normal Python build and then manually stuffed them into a tarfile. > > But of course you could simply grab the tarfile and extract it in the > right place. I think if you're in / when you unpack the tarfile > everything will work fine. Make sure to grab the right one (use the jaguar database if you are installing for a /Library/Frameworks python, and the panther database for /System/Library/Frameworks) because otherwise it won't work. Why exactly is PM "not always an option", anyways? It is possible to download+install a package from the command line, and as Jack says, the tarballs are easy enough to dink around with if you have to. -bob From claird at lairds.com Fri Apr 2 16:47:50 2004 From: claird at lairds.com (Cameron Laird) Date: Fri Apr 2 16:48:50 2004 Subject: [Pythonmac-SIG] possible OT: os.chdir on OSX In-Reply-To: Message-ID: > From Jack.Jansen@cwi.nl Wed Mar 31 16:53:22 2004 > . > . > . > > ... absolutely true, and one of the classic FAQ > > disappointments to many administrators and developers. > > HOWEVER, what they *really* want is often just enough > > different from "change the parent" that a programmatic > > solution *is* possible: ... > > [I was going to present the answer here, > > but I'm being called away. I'll return > > to the question later.] > That's what Fermat said too:-) > (see the second hit on Google if you've never heard of Fermat) > . > . > . You have no idea how much I have to say on these subjects. For now, let me try to get quick help to Scott: instead of looking for % pwd SOMEWHERE % python pwd_changer.py % pwd SOMEWHERE ELSE do this % pwd SOMEWHERE % eval "cd `python pwd_changer.py`" % pwd SOMEWHERE ELSE Do you see my point? I can abbreviate the "eval ..." line even more, if that'll help. From cpr at emsoftware.com Fri Apr 2 19:00:44 2004 From: cpr at emsoftware.com (Chris Ryland) Date: Fri Apr 2 18:59:41 2004 Subject: [Pythonmac-SIG] anyone seen F-script? Message-ID: Wow, now *that's* what we need for an IDE--a completely integrated class browser & interactive interpreter (easy) and graphical object inspector. F-script is the perfect dynamic Cocoa language, thanks to its Smalltalk roots--too bad we can't "warp" the Python syntax somehow to make selector usage more pleasant. Has anyone played with F-script to assess its strengths and weaknesses? Cheers! --Chris Ryland / Em Software, Inc. / www.emsoftware.com From cpr at emsoftware.com Fri Apr 2 19:10:20 2004 From: cpr at emsoftware.com (Chris Ryland) Date: Fri Apr 2 19:09:16 2004 Subject: [Pythonmac-SIG] anyone seen F-script? In-Reply-To: Message-ID: <4BA32508-8503-11D8-8B81-000393DC534A@emsoftware.com> Sorry, forgot the URL: . On Friday, April 2, 2004, at 07:00 PM, Chris Ryland wrote: > Wow, now *that's* what we need for an IDE--a completely integrated > class browser & interactive interpreter (easy) and graphical object > inspector. > > F-script is the perfect dynamic Cocoa language, thanks to its > Smalltalk roots--too bad we can't "warp" the Python syntax somehow to > make selector usage more pleasant. > > Has anyone played with F-script to assess its strengths and weaknesses? Cheers! --Chris Ryland / Em Software, Inc. / www.emsoftware.com From wtbridgman at radix.net Fri Apr 2 22:20:31 2004 From: wtbridgman at radix.net (W.T. Bridgman) Date: Fri Apr 2 22:20:36 2004 Subject: [Pythonmac-SIG] Installing tkinter on Panther w/o PackageManager? In-Reply-To: <5A46D1B9-84EC-11D8-8B4D-000A95686CD8@redivi.com> Message-ID: On Friday, April 2, 2004, at 04:26 PM, Bob Ippolito wrote: > > On Apr 2, 2004, at 4:14 PM, Jack Jansen wrote: > >> >> On 2 Apr 2004, at 03:28, W.T. Bridgman wrote: >>> Has anyone 'finalized' a procedure for installing tkinter without >>> the PackageManager or Fink? I can't find anything on the Wiki about >>> this option. Everyone seems to be pushing PM - not always an option >>> for some installations. >> >> In the case of _tkinter (and I think readline, and possibly one or >> two others) this is a bit of a problem, because I've built the binary >> installers in an ad-hoc way: I built the modules from source during a >> normal Python build and then manually stuffed them into a tarfile. >> >> But of course you could simply grab the tarfile and extract it in the >> right place. I think if you're in / when you unpack the tarfile >> everything will work fine. > > Make sure to grab the right one (use the jaguar database if you are > installing for a /Library/Frameworks python, and the panther database > for /System/Library/Frameworks) because otherwise it won't work. > > Why exactly is PM "not always an option", anyways? It is possible to > download+install a package from the command line, and as Jack says, > the tarballs are easy enough to dink around with if you have to. > > -bob I often use my fast connection at work to download packages to install on my home system (where I'm lucky if I can get 28.8Kb via dial-in). While tkinter isn't that large, larger modules are a problem in this case. I have another system located where a sneaker-net USB flash drive/CD-R is a fastest method for file transfer. Configuring a new system or performing a clean reinstall where it's easier and faster to first transfer all the installers to a working directory via flash drive or cross-over cable than installing via modem. Philosophical: I like to see the source trees of what I'm installing? Do I need any more reasons? Tom From bob at redivi.com Fri Apr 2 22:42:35 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Apr 2 22:38:34 2004 Subject: [Pythonmac-SIG] Installing tkinter on Panther w/o PackageManager? In-Reply-To: References: Message-ID: On Apr 2, 2004, at 10:20 PM, W.T. Bridgman wrote: > > On Friday, April 2, 2004, at 04:26 PM, Bob Ippolito wrote: > >> >> On Apr 2, 2004, at 4:14 PM, Jack Jansen wrote: >> >>> >>> On 2 Apr 2004, at 03:28, W.T. Bridgman wrote: >>>> Has anyone 'finalized' a procedure for installing tkinter without >>>> the PackageManager or Fink? I can't find anything on the Wiki >>>> about this option. Everyone seems to be pushing PM - not always an >>>> option for some installations. >>> >>> In the case of _tkinter (and I think readline, and possibly one or >>> two others) this is a bit of a problem, because I've built the >>> binary installers in an ad-hoc way: I built the modules from source >>> during a normal Python build and then manually stuffed them into a >>> tarfile. >>> >>> But of course you could simply grab the tarfile and extract it in >>> the right place. I think if you're in / when you unpack the tarfile >>> everything will work fine. >> >> Make sure to grab the right one (use the jaguar database if you are >> installing for a /Library/Frameworks python, and the panther database >> for /System/Library/Frameworks) because otherwise it won't work. >> >> Why exactly is PM "not always an option", anyways? It is possible to >> download+install a package from the command line, and as Jack says, >> the tarballs are easy enough to dink around with if you have to. > > I often use my fast connection at work to download packages to install > on my home system (where I'm lucky if I can get 28.8Kb via dial-in). > While tkinter isn't that large, larger modules are a problem in this > case. > > I have another system located where a sneaker-net USB flash drive/CD-R > is a fastest method for file transfer. > > Configuring a new system or performing a clean reinstall where it's > easier and faster to first transfer all the installers to a working > directory via flash drive or cross-over cable than installing via > modem. > > Philosophical: I like to see the source trees of what I'm installing? > > Do I need any more reasons? As said, you can download the tarballs referenced in the plist and just tar zxf them yourself. It's not (always) source code, but it's an option if you're using sneakernet. If you install a package with PackageManager on a particular machine, the tarball should be cached in /tmp and will be deleted the next time you reboot.. which can be more convenient than using the plist. -bob From leknarf at pacbell.net Sat Apr 3 00:30:14 2004 From: leknarf at pacbell.net (Scott Frankel) Date: Sat Apr 3 00:31:21 2004 Subject: [Pythonmac-SIG] possible OT: os.chdir on OSX In-Reply-To: References: Message-ID: Great! I'll give this a go ... Scott On Apr 2, 2004, at 1:47 PM, Cameron Laird wrote: >> From Jack.Jansen@cwi.nl Wed Mar 31 16:53:22 2004 >> . >> . >> . >>> ... absolutely true, and one of the classic FAQ >>> disappointments to many administrators and developers. >>> HOWEVER, what they *really* want is often just enough >>> different from "change the parent" that a programmatic >>> solution *is* possible: ... >>> [I was going to present the answer here, >>> but I'm being called away. I'll return >>> to the question later.] > >> That's what Fermat said too:-) > >> (see the second hit on Google if you've never heard of Fermat) >> . >> . >> . > You have no idea how much I have to say on these subjects. > For now, let me try to get quick help to Scott: instead of > looking for > > % pwd > SOMEWHERE > % python pwd_changer.py > % pwd > SOMEWHERE ELSE > > do this > > % pwd > SOMEWHERE > % eval "cd `python pwd_changer.py`" > % pwd > SOMEWHERE ELSE > > Do you see my point? I can abbreviate the "eval ..." line > even more, if that'll help. > From lanceboyle at myrealbox.com Sat Apr 3 06:16:25 2004 From: lanceboyle at myrealbox.com (Lance Boyle) Date: Sat Apr 3 06:16:26 2004 Subject: [Pythonmac-SIG] associating file types and applications... In-Reply-To: <0C3821BF-8404-11D8-8C01-000A959B24A6@earthlink.net> References: <6FEEB355-8342-11D8-A68D-000A95686CD8@redivi.com> <6C745946-8354-11D8-96CB-000D934FF6B4@cwi.nl> <93BAE26E-83AF-11D8-9031-0003931C36B2@mac.com> <0C3821BF-8404-11D8-8C01-000A959B24A6@earthlink.net> Message-ID: <58747EEA-8560-11D8-A6D5-003065F93FF0@myrealbox.com> On Apr 1, 2004, at 10:43 AM, Tom Pollard wrote: > > On Apr 1, 2004, at 2:38 AM, Jens Miltner wrote: >>>> The default app to use when opening a document is a property of the >>>> Finder. Users can always reassign particular document types to the >>>> app of their choosing using the Info window. So, I'm not sure it >>>> would be considered "playing nice" to override that preference for >>>> an existing filetype. I imagine if you introduce a new filetype, >>>> your app will automatically be the default app for opening those >>>> files. That's just my impression of how things work - I'm not an >>>> expert. >>> >>> There *is* a way to do this, though: the various media players >>> (quicktime, itunes, realplayer, windows media) all offer to handle >>> all your mp3s and other types for you, and if you say "yes" they do >>> it (at least until you override again from the finder). >>> >>> I'm not sure whether they do this through AppleEvents to the Finder, >>> AppleEvents to something else or a completely different mechanism, >>> though. >> >> AFAIK, this is still done is through InternetConfig (even though that >> API is kind of deprecated) - you should be able to set the default >> "helper app" for a file type / mime type using the InternetConfig >> APIs... > > I don't know how to change the filetype/application association from > the command line, but I did find that this information is kept in the > LaunchServices property list > (~/Library/Preferences/com.apple.LaunchServices.plist). You can > browse this file by opening it in with the Property List Editor. It's > just an XML file, so you can open it in a text editor, too. You can > dump its contents to the terminal in more readble form by saying > > % defaults read com.apple.LaunchServices > > For simpler plists, the 'defaults' command would also let you change > property values from the command line, but in this case that doesn't > work, because 'defaults' only acts on top-level properties. > LaunchServices has only a single top-level property, > "LSPrefsBindings", a dictionary that associates filetypes with > application bundles. Also, application bundles are identified using > more that just a path to the application, but a small dictionary of > information, including a binary "LSBundleLocator" that may be an > alias, or something like that. > > There are some command-line apps included with the LaunchServices > framework, in > > > /System/Library/Frameworks/ApplicationServices.framework/Frameworks/ > LaunchServices.framework/Versions/Current > > but none of these looks like a tool for changing filetype/application > associations. > > I imagine poking around the Developer documentation on the ADC site > would reveal a programmatic way of interacting with LaunchServices to > change the associations... > This discussion is a bit obscure to me, but could this utility be useful? http://www.clauss-net.de/misfox/misfox.html Jerry From rafferty29 at mchsi.com Sun Apr 4 22:54:13 2004 From: rafferty29 at mchsi.com (Rob Bedford) Date: Sun Apr 4 22:54:24 2004 Subject: [Pythonmac-SIG] cgiwrap and appscript Message-ID: <8547D243-86AC-11D8-B5BC-00039374C97A@mchsi.com> I am trying use cgiwrap and appscript to control some X-10 equipment from the web. The script works fine if the Applescript portion is commented out. The expected path information looks correct as does the html. If I add the Applescript back in and use the run from terminal command in BBEdit everything goes fine also. However when the Applescript is included I get server errors if I change to cgiwrapd the error is: Output of script follows: ===================================================== Fatal Python error: Interpreter not initialized (version mismatch?) The top line is #!/usr/bin/env /usr/bin/pythonw although I have tried other combinations that also fail. Also if I comment out the "app('Text..." line I get the same results. The code is: #!/usr/bin/env /usr/bin/pythonw import appscript import sys # send the html print "Content-type: text/html" print print '' print '' print 'Random Picture' print '' print '' print '
' print sys.path print "

" print "

" + '' + 'Next Picture' print '
' print "" app('TextEdit.app').activate() Any ideas? Thanks Rob From bob at redivi.com Sun Apr 4 23:26:02 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Apr 4 23:21:54 2004 Subject: [Pythonmac-SIG] cgiwrap and appscript In-Reply-To: <8547D243-86AC-11D8-B5BC-00039374C97A@mchsi.com> References: <8547D243-86AC-11D8-B5BC-00039374C97A@mchsi.com> Message-ID: On Apr 4, 2004, at 10:54 PM, Rob Bedford wrote: > Fatal Python error: Interpreter not initialized (version mismatch?) You have multiple versions of Python installed. You are loading an extension module built for one interpreter from another, which causes both interpreters to be loaded at the same time but only one is initialized so things blow up. This is a common problem and is unavoidable on OS X 10.2, but will be fixed with the next Python release. The workaround is to simply.. not do that. Try pointing your script to the exact same Python interpreter that you have been testing with, and/or remove any unnecessary Python installations from your system. For more information, please read http://pythonmac.org/wiki/FAQ -bob From bob at redivi.com Mon Apr 5 00:24:34 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Apr 5 00:20:35 2004 Subject: [Pythonmac-SIG] MacPython AIM channel is deprecated, moved to IRC Message-ID: <243C4072-86B9-11D8-B16A-000A95686CD8@redivi.com> Due to the immense amount of problems with the AIM network and iChat, especially with regard to chat rooms, we've decided to move the to the #macpython channel on the irc.freenode.net IRC network. This is primarily for pythonmac-sig and pyobjc-dev related discussions, but any MacPython related discussion is welcome. For slightly more information, check the wiki: http://pythonmac.org/wiki/MacPythonChannel If you do not currently have an IRC client, or are looking for a nice Cocoa client, try Colloquy: http://colloquy.info/ -bob From rafferty29 at mchsi.com Mon Apr 5 00:30:39 2004 From: rafferty29 at mchsi.com (Rob Bedford) Date: Mon Apr 5 00:30:45 2004 Subject: [Pythonmac-SIG] cgiwrap and appscript In-Reply-To: References: <8547D243-86AC-11D8-B5BC-00039374C97A@mchsi.com> Message-ID: Thanks I was on 10.3.3 and had a version in /Library/Frameworks and in /System strange they both were labeled 2.3. However as you said when I removed the one in /Library in works and launches fine. Now that I am past the setup I can write the real code :-) Thanks again for the fast response, Rob On Apr 4, 2004, at 10:26 PM, Bob Ippolito wrote: > On Apr 4, 2004, at 10:54 PM, Rob Bedford wrote: > >> Fatal Python error: Interpreter not initialized (version mismatch?) > > You have multiple versions of Python installed. You are loading an > extension module built for one interpreter from another, which causes > both interpreters to be loaded at the same time but only one is > initialized so things blow up. This is a common problem and is > unavoidable on OS X 10.2, but will be fixed with the next Python > release. The workaround is to simply.. not do that. Try pointing > your script to the exact same Python interpreter that you have been > testing with, and/or remove any unnecessary Python installations from > your system. > > For more information, please read http://pythonmac.org/wiki/FAQ > > -bob > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From bob at redivi.com Mon Apr 5 00:39:12 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Apr 5 00:35:17 2004 Subject: [Pythonmac-SIG] cgiwrap and appscript In-Reply-To: References: <8547D243-86AC-11D8-B5BC-00039374C97A@mchsi.com> Message-ID: <2F7ED4BB-86BB-11D8-B16A-000A95686CD8@redivi.com> The one in /Library is the result of installing a MacPython for Jaguar package at some point. Perhaps prior to upgrading to 10.3. On Apr 5, 2004, at 12:30 AM, Rob Bedford wrote: > Thanks I was on 10.3.3 and had a version in /Library/Frameworks and in > /System strange they both were labeled 2.3. However as you said > when I removed the one in /Library in works and launches fine. Now > that I am past the setup I can write the real code :-) > > Thanks again for the fast response, > Rob > > On Apr 4, 2004, at 10:26 PM, Bob Ippolito wrote: > >> On Apr 4, 2004, at 10:54 PM, Rob Bedford wrote: >> >>> Fatal Python error: Interpreter not initialized (version mismatch?) >> >> You have multiple versions of Python installed. You are loading an >> extension module built for one interpreter from another, which causes >> both interpreters to be loaded at the same time but only one is >> initialized so things blow up. This is a common problem and is >> unavoidable on OS X 10.2, but will be fixed with the next Python >> release. The workaround is to simply.. not do that. Try pointing >> your script to the exact same Python interpreter that you have been >> testing with, and/or remove any unnecessary Python installations from >> your system. >> >> For more information, please read http://pythonmac.org/wiki/FAQ From jum at mac.com Mon Apr 5 04:18:24 2004 From: jum at mac.com (Jens Miltner) Date: Mon Apr 5 04:15:06 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: <406DA72A.4040706@noaa.gov> References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> <103D4257-83EE-11D8-8201-000A95686CD8@redivi.com> <16F31C2E-8485-11D8-9DF0-0003931C36B2@mac.com> <406DA72A.4040706@noaa.gov> Message-ID: Am 02.04.2004 um 19:47 schrieb Chris Barker: > Jens Miltner wrote: > >> Unfortunately, now that I had Tkinter imported properly, I also had >> to find that I run into the exact problem you already mentioned, >> namely Tkinter installing it's own event loop. >> Is there any Tk package that won't do this (or launch an external app >> to run the UI)? >> How is this solved on other platforms? >> Do you know of Tk packages that don't set up a complete event loop, >> but use e.g. CarbonEvents to manage their widgets, so that they >> don't interfere with a hosting app's event handling? > > The easiest answer is "don't do that". In general, you're going ot > ahve a much easier time in a python embedded project using the same > GUI toolkit for C++ and python. wxWidgets+wxPython, for example. > > Why do you want to use TKinter? why not use the Carbon stuff from > Python instead? MacCVS is not cross platform anyway. Another option is > to see if you can use PyObjC and Cocoa, though I don't know how hard > it is to mix Cocoa and Carbon. I agree and personally, I have to desire to write code that uses Tk, but unfortunately, quite a few of the cross-platform macros that are provided for MacCvs/WinCvs/gCvs are using Tkinter, so I'd like to support those if possible at all. I'd really hate to have to tell people: "Well, you can't use those, because we can't get Tkinter to work properly on Mac OS" (that's what I had to tell people often enough in the Mac OS 9 days :( ) From Benjamin.Schollnick at usa.xerox.com Mon Apr 5 09:58:19 2004 From: Benjamin.Schollnick at usa.xerox.com (Schollnick, Benjamin) Date: Mon Apr 5 10:02:38 2004 Subject: [Pythonmac-SIG] Installing tkinter on Panther w/o PackageMana ger? Message-ID: <51B62EFFBC83D6118ADA00096BB030A107CADE7A@usamcms7.mc.usa.xerox.com> > > Configuring a new system or performing a clean reinstall where it's > > easier and faster to first transfer all the installers to a working > > directory via flash drive or cross-over cable than installing via > > modem. > > > > Philosophical: I like to see the source trees of what I'm > installing? > > > As said, you can download the tarballs referenced in the > plist and just > tar zxf them yourself. It's not (always) source code, but it's an > option if you're using sneakernet. If you install a package with > PackageManager on a particular machine, the tarball should be > cached in > /tmp and will be deleted the next time you reboot.. which can be more > convenient than using the plist. Why not take a lesson from Apple here? Why not offer a menu option, or a contexual menu option, to save the "installer" to a different location? Basically stealing the idea that the software update engine uses. Well, actually: 1) If it is already downloaded and in the cache directory, just copy the file to the new location. 2) If you don't have it in cache, download to cache, and save a copy in the new location. 3) A option to compare a previously saved file to the signature on the PM server. 4) A option to force install from a previously installed update file, that is not in the cache directory. (Copy it to the cache directory, and install from there). - Benjamin From jason at smileproject.com Mon Apr 5 10:21:01 2004 From: jason at smileproject.com (Jason Van Anden) Date: Mon Apr 5 10:21:25 2004 Subject: [Pythonmac-SIG] Stranger in a Strange Land Message-ID: <7736BC7E-870C-11D8-8B63-0003930488EC@smileproject.com> Confession: ----------------- I am a very experienced Windows developer who is dipping his toes into the water outside of Microsoft's programming IDE's. System: ----------- I have both a Linux PC and a Mac with OS 10.3, and a desire to create apps with a GUI using Python. Problem: ------------ When I went to run my first Python app using Tkinter on the Mac from the terminal window, I got the following message: Error Message: --------------------- Traceback (most recent call last): File "tut1.py", line 3, in ? from Tkinter import * File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/lib-tk/Tkinter.py", line 38, in ? import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named _tkinter Here is the code: ----------------------- # File: tut1.py from Tkinter import * root = Tk() w = Label(root, text="Hello World!") w.pack root.mainloop() The info I find online when I Google for this is sketchy at best, and at worst filled with all sorts of intimidating jargon. I would greatly appreciate some help sorting this out. J From jum at mac.com Mon Apr 5 11:13:10 2004 From: jum at mac.com (Jens Miltner) Date: Mon Apr 5 11:09:21 2004 Subject: [Pythonmac-SIG] Stranger in a Strange Land In-Reply-To: <7736BC7E-870C-11D8-8B63-0003930488EC@smileproject.com> References: <7736BC7E-870C-11D8-8B63-0003930488EC@smileproject.com> Message-ID: Am 05.04.2004 um 16:21 schrieb Jason Van Anden: > Confession: > ----------------- > I am a very experienced Windows developer who is dipping his toes into > the water outside of Microsoft's programming IDE's. > > System: > ----------- > I have both a Linux PC and a Mac with OS 10.3, and a desire to create > apps with a GUI using Python. > > Problem: > ------------ > When I went to run my first Python app using Tkinter on the Mac from > the terminal window, I got the following message: > > Error Message: > --------------------- > Traceback (most recent call last): > File "tut1.py", line 3, in ? > from Tkinter import * > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/lib-tk/Tkinter.py", line 38, in ? > import _tkinter # If this fails your Python may not be configured > for Tk > ImportError: No module named _tkinter > > Here is the code: > ----------------------- > # File: tut1.py > > from Tkinter import * > > root = Tk() > > w = Label(root, text="Hello World!") > w.pack > > root.mainloop() > > > > The info I find online when I Google for this is sketchy at best, and > at worst filled with all sorts of intimidating jargon. > > I would greatly appreciate some help sorting this out. You'll need to install the Tkinter module. I installed _tkinter via the Python Package Manager (you may need to install the MacPython addons to get this on Mac OS X 10.3) and the TkAqua installation from . From bob at redivi.com Mon Apr 5 11:30:33 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Apr 5 11:26:25 2004 Subject: [Pythonmac-SIG] Stranger in a Strange Land In-Reply-To: References: <7736BC7E-870C-11D8-8B63-0003930488EC@smileproject.com> Message-ID: <2DFFE194-8716-11D8-B16A-000A95686CD8@redivi.com> On Apr 5, 2004, at 11:13 AM, Jens Miltner wrote: > > Am 05.04.2004 um 16:21 schrieb Jason Van Anden: > >> ImportError: No module named _tkinter > > You'll need to install the Tkinter module. I installed _tkinter via > the Python Package Manager (you may need to install the MacPython > addons to get this on Mac OS X 10.3) and the TkAqua installation from > . But you need to do that in the opposite order.. _tkinter won't install unless you already have TclTkAqua. The MacPython addons for Panther package is at: http://homepages.cwi.nl/~jack/macpython/index.html> A good place to look for more information is: http://pythonmac.org/wiki/FAQ -bob From Chris.Barker at noaa.gov Mon Apr 5 12:54:53 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Mon Apr 5 12:56:10 2004 Subject: [Pythonmac-SIG] Stranger in a Strange Land In-Reply-To: <2DFFE194-8716-11D8-B16A-000A95686CD8@redivi.com> References: <7736BC7E-870C-11D8-8B63-0003930488EC@smileproject.com> <2DFFE194-8716-11D8-B16A-000A95686CD8@redivi.com> Message-ID: <40718F5D.8070905@noaa.gov> >> Am 05.04.2004 um 16:21 schrieb Jason Van Anden: >> >>> ImportError: No module named _tkinter >> >> >> You'll need to install the Tkinter module. After doing that, and you're not workling with an existing TK_inter code base, you might want to consider using wxPython instad of TKinter. At the moment, I think it's a more robust (and more flexible) solution, particularly if you want to support OS-X and Linux and/or Windows. It will probably feel more familiar to you as well, if you've used MFC. A recent Quotation from Guido: """ wxPython is the best and most mature cross-platform GUI toolkit, given a number of constraints. The only reason wxPython isn't the standard Python GUI toolkit is that Tkinter was there first. """ -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 Chris.Barker@noaa.gov From jed at philtered.net Mon Apr 5 13:09:12 2004 From: jed at philtered.net (Jed Haile) Date: Mon Apr 5 13:09:31 2004 Subject: [Pythonmac-SIG] bundlebuilder2 and pango Message-ID: Hello, I am trying to build an application using bundlebuilder2. The application uses X11, gtk 2.0, vtk and python2.3 on panther. I have gotten the bundle to the point where it will run, but I found that pango is still using the fonts out of /sw. If I run it on a system that does not have all the gtk/pango stuff installed, the application comes up but there are no fonts! It looks like pango is trying to use the fonts out of /sw. Does anybody know how to make pango use the fonts that I have placed inside of the bundle? Thanks, Jed Haile From jason at smileproject.com Mon Apr 5 14:36:23 2004 From: jason at smileproject.com (Jason Van Anden) Date: Mon Apr 5 14:37:21 2004 Subject: [Pythonmac-SIG] Stranger in a Strange Land In-Reply-To: <2DFFE194-8716-11D8-B16A-000A95686CD8@redivi.com> References: <7736BC7E-870C-11D8-8B63-0003930488EC@smileproject.com> <2DFFE194-8716-11D8-B16A-000A95686CD8@redivi.com> Message-ID: <23776794-8730-11D8-996A-0003930488EC@smileproject.com> On Apr 5, 2004, at 11:30 AM, Bob Ippolito wrote: > > On Apr 5, 2004, at 11:13 AM, Jens Miltner wrote: > >> >> Am 05.04.2004 um 16:21 schrieb Jason Van Anden: >> >>> ImportError: No module named _tkinter >> >> You'll need to install the Tkinter module. I installed _tkinter via >> the Python Package Manager (you may need to install the MacPython >> addons to get this on Mac OS X 10.3) and the TkAqua installation from >> . > > But you need to do that in the opposite order.. _tkinter won't > install unless you already have TclTkAqua. > The MacPython addons for Panther package is at: > http://homepages.cwi.nl/~jack/macpython/index.html> > A good place to look for more information is: > http://pythonmac.org/wiki/FAQ > > -bob > > > Thanks for the advice -- after doing so tho, I am still getting the same error message. -J From bob at redivi.com Mon Apr 5 15:02:23 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Apr 5 14:58:15 2004 Subject: [Pythonmac-SIG] Stranger in a Strange Land In-Reply-To: <23776794-8730-11D8-996A-0003930488EC@smileproject.com> References: <7736BC7E-870C-11D8-8B63-0003930488EC@smileproject.com> <2DFFE194-8716-11D8-B16A-000A95686CD8@redivi.com> <23776794-8730-11D8-996A-0003930488EC@smileproject.com> Message-ID: On Apr 5, 2004, at 2:36 PM, Jason Van Anden wrote: > > On Apr 5, 2004, at 11:30 AM, Bob Ippolito wrote: > >> >> On Apr 5, 2004, at 11:13 AM, Jens Miltner wrote: >> >>> >>> Am 05.04.2004 um 16:21 schrieb Jason Van Anden: >>> >>>> ImportError: No module named _tkinter >>> >>> You'll need to install the Tkinter module. I installed _tkinter via >>> the Python Package Manager (you may need to install the MacPython >>> addons to get this on Mac OS X 10.3) and the TkAqua installation >>> from . >> >> But you need to do that in the opposite order.. _tkinter won't >> install unless you already have TclTkAqua. >> The MacPython addons for Panther package is at: >> http://homepages.cwi.nl/~jack/macpython/index.html> >> A good place to look for more information is: >> http://pythonmac.org/wiki/FAQ >> > Thanks for the advice -- after doing so tho, I am still getting the > same error message. That error very specifically means that Tkinter is not completely installed, no more no less. You will not get that error if you followed the directions exactly: (a) install TclTkAqua (b) install the MacPython Addons for Panther (c) install the Tkinter package from the PackageManager application that came with the MacPython Addons (d) running your python script(s) with the correct interpreter, /usr/bin/pythonw -bob From rowen at cesmail.net Mon Apr 5 15:10:36 2004 From: rowen at cesmail.net (Russell E. Owen) Date: Mon Apr 5 15:10:50 2004 Subject: [Pythonmac-SIG] Re: Stranger in a Strange Land References: <7736BC7E-870C-11D8-8B63-0003930488EC@smileproject.com> <2DFFE194-8716-11D8-B16A-000A95686CD8@redivi.com> <23776794-8730-11D8-996A-0003930488EC@smileproject.com> Message-ID: In article <23776794-8730-11D8-996A-0003930488EC@smileproject.com>, Jason Van Anden asked about installing Tkinter on MacOS X... Try the installation instructions here: http://www.astro.washington.edu/owen/PythonOnMacOSX.html The first short section (Aqua Tkinter) is probably what you are looking for because it gives "native look and feel". There is also a longer section on installing Tkinter for X11, but since you're coming from a Windows background I suspect that will not be of interest. Be warned that Aqua Tk does have some cosmetic bugs. Two that can be easily worked around are wrapped labels for checkbuttons and possible truncated text in menubuttons. Avoid these by a proper choice of font (including a large enough font size). -- Russell From Jack.Jansen at cwi.nl Mon Apr 5 18:00:17 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon Apr 5 18:00:28 2004 Subject: [Pythonmac-SIG] Installing tkinter on Panther w/o PackageMana ger? In-Reply-To: <51B62EFFBC83D6118ADA00096BB030A107CADE7A@usamcms7.mc.usa.xerox.com> References: <51B62EFFBC83D6118ADA00096BB030A107CADE7A@usamcms7.mc.usa.xerox.com> Message-ID: <9F768B05-874C-11D8-BE2B-000D934FF6B4@cwi.nl> On 5 Apr 2004, at 15:58, Schollnick, Benjamin wrote: > 1) If it is already downloaded and in the cache directory, just copy > the file to the new location. > 2) If you don't have it in cache, download to cache, and save a copy > in the new location. > > 3) A option to compare a previously saved file to the signature on > the > PM server. > > 4) A option to force install from a previously installed update > file, that > is not in the cache directory. (Copy it to the cache > directory, and > install from there). This is almost what is implemented, but the PackageManager GUI misses a few bells and whistles to make this useful (notice that it's still below-1.0:-). The idea is that you should eventually be able to set both the download directory and the build directory. This is the bit that is missing, currently both are set to "/tmp". But both download and build directories are not cleaned out by PackMan, and checksums are checked, etc. This doesn't need any forcing or whatever: checksums are checked and that should be good enough. The only thing that is missing is a way to set the directories, and some way to clean them out (either ask after installing, or a preference to set the amount of MB you're willing to use, or something like that). In the mean time you can find your downloaded installers and corresponding build directories in /tmp, until the next time you reboot. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From Jack.Jansen at cwi.nl Mon Apr 5 18:06:37 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon Apr 5 18:06:36 2004 Subject: [Pythonmac-SIG] bundlebuilder2 and pango In-Reply-To: References: Message-ID: <827DBD92-874D-11D8-BE2B-000D934FF6B4@cwi.nl> On 5 Apr 2004, at 19:09, Jed Haile wrote: > Hello, > > I am trying to build an application using bundlebuilder2. The > application uses X11, gtk 2.0, vtk and python2.3 on panther. I have > gotten the bundle to the point where it will run, but I found that > pango is still using the fonts out of /sw. If I run it on a system > that does not have all the gtk/pango stuff installed, the application > comes up but there are no fonts! It looks like pango is trying to use > the fonts out of /sw. > > Does anybody know how to make pango use the fonts that I have placed > inside of the bundle? Are you by any chance also looking at the soulseek client? I spent a grueling week or so trying to get it to work, and when I had it all working I was planning to make it available, but I got stuck at about the same place you are now... -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From Jack.Jansen at cwi.nl Mon Apr 5 18:14:15 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon Apr 5 18:14:13 2004 Subject: [Pythonmac-SIG] Stranger in a Strange Land In-Reply-To: <7736BC7E-870C-11D8-8B63-0003930488EC@smileproject.com> References: <7736BC7E-870C-11D8-8B63-0003930488EC@smileproject.com> Message-ID: <9375BDFF-874E-11D8-BE2B-000D934FF6B4@cwi.nl> > Error Message: > --------------------- > Traceback (most recent call last): > File "tut1.py", line 3, in ? > from Tkinter import * > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/lib-tk/Tkinter.py", line 38, in ? > import _tkinter # If this fails your Python may not be configured > for Tk > ImportError: No module named _tkinter [...] > The info I find online when I Google for this is sketchy at best, and > at worst filled with all sorts of intimidating jargon. Jason, practically you should follow Bob's 4-point recipe and you should be up-and-running. If not: report back, please. (or you should follow the advise to try wxPython in stead of Tkinter, but that's a whole different discussion). But what I'm interested in with an eye to the future is what you googled for when you ran into this problem, because if we can make google return the right information (which boils down to (a) Tkinter is not included in the standard Python install but easily available through Package Manager, and (b) all GUI programs on OSX should be run with "pythonw" in stead of "python") that should be a great help to the next Python professional who dips into OSX. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From bill at janssen.org Mon Apr 5 18:39:12 2004 From: bill at janssen.org (Bill Janssen) Date: Mon Apr 5 18:39:44 2004 Subject: [Pythonmac-SIG] Stranger in a Strange Land In-Reply-To: Your message of "Mon, 05 Apr 2004 15:14:15 PDT." <9375BDFF-874E-11D8-BE2B-000D934FF6B4@cwi.nl> Message-ID: <04Apr5.153920pdt."58611"@synergy1.parc.xerox.com> > (b) all GUI programs on OSX should be run > with "pythonw" in stead of "python") that should be a great help to the > next Python professional who dips into OSX. Does that include PyGTK programs? Bill From bob at redivi.com Mon Apr 5 18:49:53 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Apr 5 18:45:49 2004 Subject: [Pythonmac-SIG] Stranger in a Strange Land In-Reply-To: <04Apr5.153920pdt."58611"@synergy1.parc.xerox.com> References: <04Apr5.153920pdt."58611"@synergy1.parc.xerox.com> Message-ID: <8DBD1981-8753-11D8-B3FA-000A95686CD8@redivi.com> On Apr 5, 2004, at 6:39 PM, Bill Janssen wrote: >> (b) all GUI programs on OSX should be run >> with "pythonw" in stead of "python") that should be a great help to >> the >> next Python professional who dips into OSX. > > Does that include PyGTK programs? "GUI program", in this context, means something that directly communicates with WindowServer. Applications that talk to X11 do not count. It's possible in theory to have a PyGTK that is linked with an Aqua (X11 free) build of GTK, so I won't say "no" straight off the bat :) -bob From jason at smileproject.com Mon Apr 5 21:53:18 2004 From: jason at smileproject.com (Jason Van Anden) Date: Mon Apr 5 21:54:14 2004 Subject: [Pythonmac-SIG] Stranger in a Strange Land In-Reply-To: References: <7736BC7E-870C-11D8-8B63-0003930488EC@smileproject.com> <2DFFE194-8716-11D8-B16A-000A95686CD8@redivi.com> <23776794-8730-11D8-996A-0003930488EC@smileproject.com> Message-ID: <2CF95F4E-876D-11D8-AC1D-0003930488EC@smileproject.com> On Apr 5, 2004, at 3:02 PM, Bob Ippolito wrote: > > On Apr 5, 2004, at 2:36 PM, Jason Van Anden wrote: > >> >> On Apr 5, 2004, at 11:30 AM, Bob Ippolito wrote: >> >>> >>> On Apr 5, 2004, at 11:13 AM, Jens Miltner wrote: >>> >>>> >>>> Am 05.04.2004 um 16:21 schrieb Jason Van Anden: >>>> >>>>> ImportError: No module named _tkinter >>>> >>>> You'll need to install the Tkinter module. I installed _tkinter via >>>> the Python Package Manager (you may need to install the MacPython >>>> addons to get this on Mac OS X 10.3) and the TkAqua installation >>>> from . >>> >>> But you need to do that in the opposite order.. _tkinter won't >>> install unless you already have TclTkAqua. >>> The MacPython addons for Panther package is at: >>> http://homepages.cwi.nl/~jack/macpython/index.html> >>> A good place to look for more information is: >>> http://pythonmac.org/wiki/FAQ >>> >> Thanks for the advice -- after doing so tho, I am still getting the >> same error message. > > That error very specifically means that Tkinter is not completely > installed, no more no less. You will not get that error if you > followed the directions exactly: > (a) install TclTkAqua > (b) install the MacPython Addons for Panther > (c) install the Tkinter package from the PackageManager application > that came with the MacPython Addons > (d) running your python script(s) with the correct interpreter, > /usr/bin/pythonw > > -bob > > > Thank you for all of the help. I will not get a chance to try this until tomorrow. Do I need to remove what I have done up to this point before following following these directions? From bob at redivi.com Mon Apr 5 22:22:01 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Apr 5 22:18:02 2004 Subject: [Pythonmac-SIG] Stranger in a Strange Land In-Reply-To: <2CF95F4E-876D-11D8-AC1D-0003930488EC@smileproject.com> References: <7736BC7E-870C-11D8-8B63-0003930488EC@smileproject.com> <2DFFE194-8716-11D8-B16A-000A95686CD8@redivi.com> <23776794-8730-11D8-996A-0003930488EC@smileproject.com> <2CF95F4E-876D-11D8-AC1D-0003930488EC@smileproject.com> Message-ID: <304E43EF-8771-11D8-84F3-000A95686CD8@redivi.com> On Apr 5, 2004, at 9:53 PM, Jason Van Anden wrote: > > On Apr 5, 2004, at 3:02 PM, Bob Ippolito wrote: > >> >> On Apr 5, 2004, at 2:36 PM, Jason Van Anden wrote: >> >>> >>> On Apr 5, 2004, at 11:30 AM, Bob Ippolito wrote: >>> >>>> >>>> On Apr 5, 2004, at 11:13 AM, Jens Miltner wrote: >>>> >>>>> >>>>> Am 05.04.2004 um 16:21 schrieb Jason Van Anden: >>>>> >>>>>> ImportError: No module named _tkinter >>>>> >>>>> You'll need to install the Tkinter module. I installed _tkinter >>>>> via the Python Package Manager (you may need to install the >>>>> MacPython addons to get this on Mac OS X 10.3) and the TkAqua >>>>> installation from >>>>> . >>>> >>>> But you need to do that in the opposite order.. _tkinter won't >>>> install unless you already have TclTkAqua. >>>> The MacPython addons for Panther package is at: >>>> http://homepages.cwi.nl/~jack/macpython/index.html> >>>> A good place to look for more information is: >>>> http://pythonmac.org/wiki/FAQ >>>> >>> Thanks for the advice -- after doing so tho, I am still getting the >>> same error message. >> >> That error very specifically means that Tkinter is not completely >> installed, no more no less. You will not get that error if you >> followed the directions exactly: >> (a) install TclTkAqua >> (b) install the MacPython Addons for Panther >> (c) install the Tkinter package from the PackageManager application >> that came with the MacPython Addons >> (d) running your python script(s) with the correct interpreter, >> /usr/bin/pythonw >> > Thank you for all of the help. I will not get a chance to try this > until tomorrow. Do I need to remove what I have done up to this point > before following following these directions? If you have installed a Jaguar Python at some point (telltale sign will be the path /Library/Frameworks/Python.framework), then you should remove it. Instructions to do so are linked from the FAQ. If this is the case, you should also re-install the MacPython Addons for Panther, to be certain that /Applications/MacPython-2.3 contains the application stubs that point to the vendor provided python interpreter. Other than that, I can't think of anything that would really get in your way. Unless you've done bad things that you've yet to tell us about, of course :) -bob From dwillcox at prairienet.org Mon Apr 5 23:13:23 2004 From: dwillcox at prairienet.org (David Willcox) Date: Mon Apr 5 23:14:40 2004 Subject: [Pythonmac-SIG] ctb module in MacPython 2.2.3 or 2.3.3 Message-ID: Please suffer a question from a semi-novice... I've been using Python off and on for a while for some very simple things, but recently I had occasion to do something that requires access to the Mac serial port. The MacPython documentation refers to a ctb module, but I can't find it anywhere in either MacPython 2.2.3 or 2.3.3. I'm running OS 9.1 (that's as far as this dinosaur will go), so I don't have an option of a newer MacPython. I found an article from Apr 01 from someone who couldn't find this module in 2.1b2, but couldn't find anything that said the issue had been resolved. Or anything about more recent versions. Am I out of luck, or am I missing something really obvious? Should I be using the classic instead of Carbon version? Thanks, David Willcox From bob at redivi.com Mon Apr 5 23:30:35 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Apr 5 23:26:31 2004 Subject: [Pythonmac-SIG] ctb module in MacPython 2.2.3 or 2.3.3 In-Reply-To: References: Message-ID: On Apr 5, 2004, at 11:13 PM, David Willcox wrote: > Please suffer a question from a semi-novice... > > I've been using Python off and on for a while for some very simple > things, but recently I had occasion to do something that requires > access to the Mac serial port. The MacPython documentation refers to > a ctb module, but I can't find it anywhere in either MacPython 2.2.3 > or 2.3.3. I'm running OS 9.1 (that's as far as this dinosaur will > go), so I don't have an option of a newer MacPython. > > I found an article from Apr 01 from someone who couldn't find this > module in 2.1b2, but couldn't find anything that said the issue had > been resolved. Or anything about more recent versions. > > Am I out of luck, or am I missing something really obvious? > > Should I be using the classic instead of Carbon version? Well, I don't know anything about serial ports on OS9, but I can tell you that the standard UNIX serial stuff works in OS X. I've personally used pySerial to communicate with various devices over a keyspan USB serial adapter. Additionally, I've gotten pySerial work under Jython via JavaComm on OS X, which may possibly be an option under OS9. -bob From dwillcox at prairienet.org Tue Apr 6 00:00:27 2004 From: dwillcox at prairienet.org (David Willcox) Date: Mon Apr 5 23:59:40 2004 Subject: [Pythonmac-SIG] ctb module in MacPython 2.2.3 or 2.3.3 In-Reply-To: References: Message-ID: At 11:30 PM -0400 4/5/04, Bob Ippolito wrote: >On Apr 5, 2004, at 11:13 PM, David Willcox wrote: > >>Please suffer a question from a semi-novice... >> >>I've been using Python off and on for a while for some very simple >>things, but recently I had occasion to do something that requires >>access to the Mac serial port. The MacPython documentation refers >>to a ctb module, but I can't find it anywhere in either MacPython >>2.2.3 or 2.3.3. I'm running OS 9.1 (that's as far as this dinosaur >>will go), so I don't have an option of a newer MacPython. >> >>I found an article from Apr 01 from someone who couldn't find this >>module in 2.1b2, but couldn't find anything that said the issue had >>been resolved. Or anything about more recent versions. >> >>Am I out of luck, or am I missing something really obvious? >> >>Should I be using the classic instead of Carbon version? > >Well, I don't know anything about serial ports on OS9, but I can >tell you that the standard UNIX serial stuff works in OS X. I've >personally used pySerial to communicate with various devices over a >keyspan USB serial adapter. Additionally, I've gotten pySerial work >under Jython via JavaComm on OS X, which may possibly be an option >under OS9. > >-bob Thanks for the reply, but OS9 and OSX are pretty substantially different beasts. There doesn't seem to be a pySerial with the OS9 version of MacPython, and I doubt that anything from the OSX version of Python would work on OS9. I may have to break down and use my Linux worstation at work. Not as convenient, though. Thanks, David From francisga at fastmail.us Tue Apr 6 01:15:59 2004 From: francisga at fastmail.us (Francis Avila) Date: Tue Apr 6 01:16:09 2004 Subject: [Pythonmac-SIG] ctb module in MacPython 2.2.3 or 2.3.3 In-Reply-To: References: Message-ID: <7D83FECD-8789-11D8-958D-000D934FF6B6@fastmail.us> On Apr 6, 2004, at 12:00 AM, David Willcox wrote: > Thanks for the reply, but OS9 and OSX are pretty substantially > different beasts. There doesn't seem to be a pySerial with the OS9 > version of MacPython, and I doubt that anything from the OSX version > of Python would work on OS9. I see mentions of a mactty module in OS9's MacPython. You may want to check that out. However, it seems to be undocumented. -- Francis Avila From jason at smileproject.com Tue Apr 6 05:50:38 2004 From: jason at smileproject.com (Jason Van Anden) Date: Tue Apr 6 05:51:06 2004 Subject: [Pythonmac-SIG] Stranger in a Strange Land In-Reply-To: <304E43EF-8771-11D8-84F3-000A95686CD8@redivi.com> References: <7736BC7E-870C-11D8-8B63-0003930488EC@smileproject.com> <2DFFE194-8716-11D8-B16A-000A95686CD8@redivi.com> <23776794-8730-11D8-996A-0003930488EC@smileproject.com> <2CF95F4E-876D-11D8-AC1D-0003930488EC@smileproject.com> <304E43EF-8771-11D8-84F3-000A95686CD8@redivi.com> Message-ID: On Apr 5, 2004, at 10:22 PM, Bob Ippolito wrote: > > On Apr 5, 2004, at 9:53 PM, Jason Van Anden wrote: > >> >> On Apr 5, 2004, at 3:02 PM, Bob Ippolito wrote: >> >>> >>> On Apr 5, 2004, at 2:36 PM, Jason Van Anden wrote: >>> >>>> >>>> On Apr 5, 2004, at 11:30 AM, Bob Ippolito wrote: >>>> >>>>> >>>>> On Apr 5, 2004, at 11:13 AM, Jens Miltner wrote: >>>>> >>>>>> >>>>>> Am 05.04.2004 um 16:21 schrieb Jason Van Anden: >>>>>> >>>>>>> ImportError: No module named _tkinter >>>>>> >>>>>> You'll need to install the Tkinter module. I installed _tkinter >>>>>> via the Python Package Manager (you may need to install the >>>>>> MacPython addons to get this on Mac OS X 10.3) and the TkAqua >>>>>> installation from >>>>>> . >>>>> >>>>> But you need to do that in the opposite order.. _tkinter won't >>>>> install unless you already have TclTkAqua. >>>>> The MacPython addons for Panther package is at: >>>>> http://homepages.cwi.nl/~jack/macpython/index.html> >>>>> A good place to look for more information is: >>>>> http://pythonmac.org/wiki/FAQ >>>>> >>>> Thanks for the advice -- after doing so tho, I am still getting the >>>> same error message. >>> >>> That error very specifically means that Tkinter is not completely >>> installed, no more no less. You will not get that error if you >>> followed the directions exactly: >>> (a) install TclTkAqua >>> (b) install the MacPython Addons for Panther >>> (c) install the Tkinter package from the PackageManager application >>> that came with the MacPython Addons >>> (d) running your python script(s) with the correct interpreter, >>> /usr/bin/pythonw >>> >> Thank you for all of the help. I will not get a chance to try this >> until tomorrow. Do I need to remove what I have done up to this >> point before following following these directions? > > If you have installed a Jaguar Python at some point (telltale sign > will be the path /Library/Frameworks/Python.framework), then you > should remove it. Instructions to do so are linked from the FAQ. If > this is the case, you should also re-install the MacPython Addons for > Panther, to be certain that /Applications/MacPython-2.3 contains the > application stubs that point to the vendor provided python > interpreter. > > Other than that, I can't think of anything that would really get in > your way. Unless you've done bad things that you've yet to tell us > about, of course :) > > -bob > > Thanks to everyone for all of their help. The feedback has been super. Unfortunately, I am not going to get a chance to give this a whirl until Wednesday night -- I will report back then. -jason From Chris.Barker at noaa.gov Tue Apr 6 12:48:31 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Tue Apr 6 11:49:50 2004 Subject: [Pythonmac-SIG] Difference between pythonw and python? In-Reply-To: References: <8650A265-82E7-11D8-8639-0003931C36B2@mac.com> <103D4257-83EE-11D8-8201-000A95686CD8@redivi.com> <16F31C2E-8485-11D8-9DF0-0003931C36B2@mac.com> <406DA72A.4040706@noaa.gov> Message-ID: <4072DF5F.90808@noaa.gov> Jens Miltner wrote: > unfortunately, quite a few of the cross-platform macros that are > provided for MacCvs/WinCvs/gCvs are using Tkinter, so I'd like to > support those if possible at all. Interesting. I'm assuming that WinCvs/gcvs are not written using TK, so they should have the same event loop intertwing problems there. If you can figure out how they've solved it on those platforms, maybe some of that knowledge will be transferable to OS-X. You know, this is the first use I have heard of that makes the anygui project make sense to me! anygui would be a great way to provide cross platfrom gui scripting to an app with different GUI front ends. -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 Chris.Barker@noaa.gov From jed at philtered.net Tue Apr 6 13:14:22 2004 From: jed at philtered.net (Jed Haile) Date: Tue Apr 6 13:14:34 2004 Subject: [Pythonmac-SIG] bundlebuilder2 and pango In-Reply-To: <827DBD92-874D-11D8-BE2B-000D934FF6B4@cwi.nl> References: <827DBD92-874D-11D8-BE2B-000D934FF6B4@cwi.nl> Message-ID: I'm not working on soulseek, but I did figure it out. You need to set up a pangorc, and you need to point gtk at it via an environment variable. In the startup script for my bundle I put: os.environ["PANGO_RC_FILE"] = resdir + "/pangorc" The pangorc needs to have these lines (this assumes you put etc/pango in the Resources directory of the bundle): [Pango] ModuleFiles=./etc/pango/pango.modules [PangoX] AliasFiles=./etc/pango/pangox.aliases Next you set up pango.modules to point to the correct location of the modules: ../Frameworks/pango-arabic-ft2.so ArabicScriptEngineFt2 PangoEngineShape PangoRenderFT2 1548-17 85:* The ordinary pangox.aliases out of /sw/etc/pango should be fine. Then just add the modules to your build script so that they get put into your Frameworks folder. It's working well for me. Jed Haile On Apr 5, 2004, at 4:06 PM, Jack Jansen wrote: > > On 5 Apr 2004, at 19:09, Jed Haile wrote: > >> Hello, >> >> I am trying to build an application using bundlebuilder2. The >> application uses X11, gtk 2.0, vtk and python2.3 on panther. I have >> gotten the bundle to the point where it will run, but I found that >> pango is still using the fonts out of /sw. If I run it on a system >> that does not have all the gtk/pango stuff installed, the application >> comes up but there are no fonts! It looks like pango is trying to use >> the fonts out of /sw. >> >> Does anybody know how to make pango use the fonts that I have placed >> inside of the bundle? > > Are you by any chance also looking at the soulseek client? > > I spent a grueling week or so trying to get it to work, and when I had > it all working I was planning to make it available, but I got stuck at > about the same place you are now... > -- > Jack Jansen, , http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma > Goldman > From dwillcox at prairienet.org Tue Apr 6 22:40:24 2004 From: dwillcox at prairienet.org (David Willcox) Date: Tue Apr 6 22:40:03 2004 Subject: [Pythonmac-SIG] ctb module in MacPython 2.2.3 or 2.3.3 In-Reply-To: <7D83FECD-8789-11D8-958D-000D934FF6B6@fastmail.us> References: <7D83FECD-8789-11D8-958D-000D934FF6B6@fastmail.us> Message-ID: At 1:15 AM -0400 4/6/04, Francis Avila wrote: >On Apr 6, 2004, at 12:00 AM, David Willcox wrote: > >>Thanks for the reply, but OS9 and OSX are pretty substantially >>different beasts. There doesn't seem to be a pySerial with the OS9 >>version of MacPython, and I doubt that anything from the OSX >>version of Python would work on OS9. > >I see mentions of a mactty module in OS9's MacPython. You may want >to check that out. However, it seems to be undocumented. >-- >Francis Avila mactty looks like it might be useful, but it is just a wrapper for ctb. It presents an easier interface, but depends on ctb for the actual I/O. But I've at least partially answered my original question. I discovered that ctb is present in the Classic version of 2.2.3 but not the Carbon version. There is no 2.3.3 Classic version. Apparently the communication tool box doesn't exist in Carbon. I wonder if has been replaced by something else. David Willcox From njriley at uiuc.edu Tue Apr 6 23:42:27 2004 From: njriley at uiuc.edu (Nicholas Riley) Date: Tue Apr 6 23:42:37 2004 Subject: [Pythonmac-SIG] Apple Python using Fink Python's path? Message-ID: <20040407034227.GB82525@uiuc.edu> I'd prefer not to have multiple Python versions installed, but I installed Fink Python 2.3.3 yesterday because some KDE packages require it. Today, I tried to use ipython, and Python claimed not to be able to find the package. Any executable Python script I run now uses the Fink Python's sys.path, regardless of having #!/usr/bin/python or #!/System/Library/Frameworks/Python.framework/Versions/2.3/bin/python as the first line. But if I run /usr/bin/python or the other one directly, sys.path is correctly set. How can I stop this from happening? % echo "#\!/usr/bin/python\n\nimport sys;print sys.version;print sys.path" > foo; chmod +x foo % ./foo 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] ['/Users/nicholas', '/sw/lib/python23.zip', '/sw/lib/python2.3', '/sw/lib/python2.3/plat-darwin', '/sw/lib/python2.3/plat-mac', '/sw/lib/python2.3/plat-mac/lib-scriptpackages', '/sw/lib/python2.3/lib-tk', '/sw/lib/python2.3/lib-dynload', '/sw/lib/python2.3/site-packages'] % /usr/bin/python -c 'import sys;print sys.version;print sys.path' 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] ['/Users/nicholas', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python23.zip', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/Numeric', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/PIL', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/PyObjC', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/foop'] % echo "#\!/sw/bin/python\n\nimport sys;print sys.version;print sys.path" > bar; chmod +x bar % ./bar 2.3.3 (#1, Mar 12 2004, 23:21:41) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] ['/Users/nicholas', '/sw/lib/python23.zip', '/sw/lib/python2.3', '/sw/lib/python2.3/plat-darwin', '/sw/lib/python2.3/plat-mac', '/sw/lib/python2.3/plat-mac/lib-scriptpackages', '/sw/lib/python2.3/lib-tk', '/sw/lib/python2.3/lib-dynload', '/sw/lib/python2.3/site-packages'] -- =Nicholas Riley | From brian_l at mac.com Wed Apr 7 00:20:26 2004 From: brian_l at mac.com (Brian Lenihan) Date: Wed Apr 7 00:20:35 2004 Subject: [Pythonmac-SIG] Apple Python using Fink Python's path? In-Reply-To: <20040407034227.GB82525@uiuc.edu> References: <20040407034227.GB82525@uiuc.edu> Message-ID: On Apr 6, 2004, at 8:42 PM, Nicholas Riley wrote: > I'd prefer not to have multiple Python versions installed, but I > installed Fink Python 2.3.3 yesterday because some KDE packages > require it. > > Today, I tried to use ipython, and Python claimed not to be able to > find the package. Any executable Python script I run now uses the > Fink Python's sys.path, regardless of having #!/usr/bin/python or > #!/System/Library/Frameworks/Python.framework/Versions/2.3/bin/python > as the first line. But if I run /usr/bin/python or the other one > directly, sys.path is correctly set. How can I stop this from > happening? This little C snippet illustrates the problem: #include int main(int argc, char** argv) { int i; for (i=0; i References: <20040407034227.GB82525@uiuc.edu> Message-ID: <20040407051546.GB83530@uiuc.edu> On Tue, Apr 06, 2004 at 09:20:26PM -0700, Brian Lenihan wrote: > OS X does not include the full path in argv[0]. I use a script to > rename /sw/bin/python* when I don't want Fink's Python to interfere > (and to move everything back when I need Fink Python). Aha, I see a workaround for this bug here: > I can send it to you if you'd like. Since it's pretty difficult for me to rebuild Apple's Python, that'd be great. Thanks. Is this documented anywhere (other than the above patch?) It seems like a good thing to add to the FAQ on pythonmac.org... (even if it's not so frequently asked yet :) -- =Nicholas Riley | From brian_l at mac.com Wed Apr 7 01:36:15 2004 From: brian_l at mac.com (Brian Lenihan) Date: Wed Apr 7 01:36:23 2004 Subject: [Pythonmac-SIG] Apple Python using Fink Python's path? In-Reply-To: <20040407051546.GB83530@uiuc.edu> References: <20040407034227.GB82525@uiuc.edu> <20040407051546.GB83530@uiuc.edu> Message-ID: <7CB6E326-8855-11D8-8DB1-000A95841920@mac.com> The script handles python2.2, 2.3 and ipython in /sw/bin. Yeah, I duplicated code, but I didn't want to spend a second longer on this than I had to. On Apr 6, 2004, at 10:15 PM, Nicholas Riley wrote: > On Tue, Apr 06, 2004 at 09:20:26PM -0700, Brian Lenihan wrote: >> OS X does not include the full path in argv[0]. I use a script to >> rename /sw/bin/python* when I don't want Fink's Python to interfere >> (and to move everything back when I need Fink Python). > > Aha, I see a workaround for this bug here: > > February/023306.html> > >> I can send it to you if you'd like. > > Since it's pretty difficult for me to rebuild Apple's Python, that'd > be great. Thanks. > > Is this documented anywhere (other than the above patch?) It seems > like a good thing to add to the FAQ on pythonmac.org... (even if it's > not so frequently asked yet :) > > -- > =Nicholas Riley | > -------------- next part -------------- A non-text attachment was scrubbed... Name: move_zig.py Type: application/text Size: 911 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040406/32e9298b/move_zig.bin -------------- next part -------------- From jum at mac.com Wed Apr 7 03:24:48 2004 From: jum at mac.com (Jens Miltner) Date: Wed Apr 7 03:19:44 2004 Subject: [Pythonmac-SIG] ctb module in MacPython 2.2.3 or 2.3.3 In-Reply-To: References: <7D83FECD-8789-11D8-958D-000D934FF6B6@fastmail.us> Message-ID: Am 07.04.2004 um 04:40 schrieb David Willcox: > At 1:15 AM -0400 4/6/04, Francis Avila wrote: >> On Apr 6, 2004, at 12:00 AM, David Willcox wrote: >> >>> Thanks for the reply, but OS9 and OSX are pretty substantially >>> different beasts. There doesn't seem to be a pySerial with the OS9 >>> version of MacPython, and I doubt that anything from the OSX version >>> of Python would work on OS9. >> >> I see mentions of a mactty module in OS9's MacPython. You may want >> to check that out. However, it seems to be undocumented. >> -- >> Francis Avila > > mactty looks like it might be useful, but it is just a wrapper for > ctb. It presents an easier interface, but depends on ctb for the > actual I/O. > > But I've at least partially answered my original question. I > discovered that ctb is present in the Classic version of 2.2.3 but not > the Carbon version. There is no 2.3.3 Classic version. > > Apparently the communication tool box doesn't exist in Carbon. I > wonder if has been replaced by something else. Did you try whether you can use the classic module with the Carbon implementation? CommToolbox has not replacement in Carbon, since any serial I/O is supposed to be done using "native" APIs at the C-level. Since Carbon apps running on classic mac OS can link & import classic symbols / libraries, the commtoolbox can be used from within Carbon apps when running on classic Mac OS. That's why I figured you might be able to use the ctb module in python 2.3.3 Carbon (when running on OS 9)... From moehl at akaflieg.extern.tu-berlin.de Wed Apr 7 07:27:01 2004 From: moehl at akaflieg.extern.tu-berlin.de (Torsten Sadowski) Date: Wed Apr 7 07:27:07 2004 Subject: [Pythonmac-SIG] ctb module in MacPython 2.2.3 or 2.3.3 In-Reply-To: References: <7D83FECD-8789-11D8-958D-000D934FF6B6@fastmail.us> Message-ID: The ctb has been replaced by OpenTransport which defines "serial endpoints". Torsten On Tue, 6 Apr 2004, David Willcox wrote: > At 1:15 AM -0400 4/6/04, Francis Avila wrote: > >On Apr 6, 2004, at 12:00 AM, David Willcox wrote: > > > >>Thanks for the reply, but OS9 and OSX are pretty substantially > >>different beasts. There doesn't seem to be a pySerial with the OS9 > >>version of MacPython, and I doubt that anything from the OSX > >>version of Python would work on OS9. > > > >I see mentions of a mactty module in OS9's MacPython. You may want > >to check that out. However, it seems to be undocumented. > >-- > >Francis Avila > > mactty looks like it might be useful, but it is just a wrapper for > ctb. It presents an easier interface, but depends on ctb for the > actual I/O. > > But I've at least partially answered my original question. I > discovered that ctb is present in the Classic version of 2.2.3 but > not the Carbon version. There is no 2.3.3 Classic version. > > Apparently the communication tool box doesn't exist in Carbon. I > wonder if has been replaced by something else. > > David Willcox > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > From smichr at hotmail.com Wed Apr 7 16:46:16 2004 From: smichr at hotmail.com (C Smith) Date: Wed Apr 7 16:47:01 2004 Subject: [Pythonmac-SIG] Re: path name issues In-Reply-To: <901B4292-84E8-11D8-8873-000D934FF6B4@cwi.nl> Message-ID: <9D8F3050-88D4-11D8-A656-000393C0D100@hotmail.com> On Friday, Apr 2, 2004, at 14:58 America/Chicago, Jack Jansen wrote: >> Could the modules like macpath and macurl2path (and others) that >> really shouldn't be loaded directly (because a master-loader like os >> or urllib is doing the decision of which *path should be loaded) be >> put/buried in a folder like 'lib_support'? This could include other >> files like ntpath, etc..., too. > > I don't think this is an option, because lots of software that is out > there that uses those modules directly does so explicitly to do > cross-platform pathname things. I'm not suggesting that the files be removed, just that they be moved to a sub-folder and then that sub folder is included in the path names that are searched when an import statement is encountered. Instead of Lib/ ... macpath ntpath os ... it would be Lib/ os nt_core/ ntpath mac_core/ macpath Some of this is already done by introducing the plat-mac directory, but the difference (I imagine) is that the plat-mac contains things that will really only work on the mac. > > What you could do is check that this isn't mentioned in the > documentation (assuming you haven't read that already:-), and if it > isn't or if you feel it merits better treatment add a sourceforge bug > report to that effect. I'll add a quick note to the FAQ, in the mean > time. > It is like you say--people (like me, at least) who are on a mac think that they are really on a mac, even if python thinks it's a posix machine. :-) So the documentation that I would go to first would be the macintosh module page. (Actually, I would most likely load the module and ask for help in the IDE to see how to use the functions--they aren't that complicated so that has usually been sufficient.) The macpath documentation does say that path operations are most portably done using os.path, so if I were to read that I might look at the os.path notes...but that module's notes just say that "useful path operations" can be done with the functions therein. In the end, I think I would just be confused then as to why there is a (seeming) duplication of functionality provided. Perhaps a note in the FAQ is enough. Unless others are in agreement and I received a "second" on the idea of expanding the docs, I may not pursue that route further. Thanks for the feedback, /c From jason at smileproject.com Wed Apr 7 19:42:37 2004 From: jason at smileproject.com (Jason Van Anden) Date: Wed Apr 7 19:43:33 2004 Subject: [Pythonmac-SIG] Stranger in a Strange Land In-Reply-To: <304E43EF-8771-11D8-84F3-000A95686CD8@redivi.com> References: <7736BC7E-870C-11D8-8B63-0003930488EC@smileproject.com> <2DFFE194-8716-11D8-B16A-000A95686CD8@redivi.com> <23776794-8730-11D8-996A-0003930488EC@smileproject.com> <2CF95F4E-876D-11D8-AC1D-0003930488EC@smileproject.com> <304E43EF-8771-11D8-84F3-000A95686CD8@redivi.com> Message-ID: <4054F4E8-88ED-11D8-8F01-0003930488EC@smileproject.com> On Apr 5, 2004, at 10:22 PM, Bob Ippolito wrote: > > On Apr 5, 2004, at 9:53 PM, Jason Van Anden wrote: > >> >> On Apr 5, 2004, at 3:02 PM, Bob Ippolito wrote: >> >>> >>> On Apr 5, 2004, at 2:36 PM, Jason Van Anden wrote: >>> >>>> >>>> On Apr 5, 2004, at 11:30 AM, Bob Ippolito wrote: >>>> >>>>> >>>>> On Apr 5, 2004, at 11:13 AM, Jens Miltner wrote: >>>>> >>>>>> >>>>>> Am 05.04.2004 um 16:21 schrieb Jason Van Anden: >>>>>> >>>>>>> ImportError: No module named _tkinter >>>>>> >>>>>> You'll need to install the Tkinter module. I installed _tkinter >>>>>> via the Python Package Manager (you may need to install the >>>>>> MacPython addons to get this on Mac OS X 10.3) and the TkAqua >>>>>> installation from >>>>>> . >>>>> >>>>> But you need to do that in the opposite order.. _tkinter won't >>>>> install unless you already have TclTkAqua. >>>>> The MacPython addons for Panther package is at: >>>>> http://homepages.cwi.nl/~jack/macpython/index.html> >>>>> A good place to look for more information is: >>>>> http://pythonmac.org/wiki/FAQ >>>>> >>>> Thanks for the advice -- after doing so tho, I am still getting the >>>> same error message. >>> >>> That error very specifically means that Tkinter is not completely >>> installed, no more no less. You will not get that error if you >>> followed the directions exactly: >>> (a) install TclTkAqua >>> (b) install the MacPython Addons for Panther >>> (c) install the Tkinter package from the PackageManager application >>> that came with the MacPython Addons >>> (d) running your python script(s) with the correct interpreter, >>> /usr/bin/pythonw >>> >> Thank you for all of the help. I will not get a chance to try this >> until tomorrow. Do I need to remove what I have done up to this >> point before following following these directions? > > If you have installed a Jaguar Python at some point (telltale sign > will be the path /Library/Frameworks/Python.framework), then you > should remove it. Instructions to do so are linked from the FAQ. If > this is the case, you should also re-install the MacPython Addons for > Panther, to be certain that /Applications/MacPython-2.3 contains the > application stubs that point to the vendor provided python > interpreter. > > Other than that, I can't think of anything that would really get in > your way. Unless you've done bad things that you've yet to tell us > about, of course :) > > -bob > > > Everything worked super - thank you all for your awesome help and support. The only hitch was the Package Manager part, but the work around directions were clear enough. I did have to point it to a different URL. For the record, this was: MacOSX 10.3 Apple-installed Python 2.3 Packman version 0.3 (experimental database by Jack). - jason From njriley at uiuc.edu Wed Apr 7 21:27:20 2004 From: njriley at uiuc.edu (Nicholas Riley) Date: Wed Apr 7 21:27:23 2004 Subject: [Pythonmac-SIG] Apple Python using Fink Python's path? In-Reply-To: <7CB6E326-8855-11D8-8DB1-000A95841920@mac.com> References: <20040407034227.GB82525@uiuc.edu> <20040407051546.GB83530@uiuc.edu> <7CB6E326-8855-11D8-8DB1-000A95841920@mac.com> Message-ID: On Apr 7, 2004, at 12:36 AM, Brian Lenihan wrote: > The script handles python2.2, 2.3 and ipython in /sw/bin. Yeah, I > duplicated code, but I didn't want to spend a second longer on this > than I had to. Thanks, works great. To anyone else who uses it - you need to run it as root, which is obvious in hindsight, but it doesn't give any error messages if you don't; it just doesn't work. -- Nicholas Riley From bob at redivi.com Wed Apr 7 21:48:58 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed Apr 7 21:44:50 2004 Subject: [Pythonmac-SIG] Apple Python using Fink Python's path? In-Reply-To: References: <20040407034227.GB82525@uiuc.edu> <20040407051546.GB83530@uiuc.edu> <7CB6E326-8855-11D8-8DB1-000A95841920@mac.com> Message-ID: On Apr 7, 2004, at 9:27 PM, Nicholas Riley wrote: > On Apr 7, 2004, at 12:36 AM, Brian Lenihan wrote: > >> The script handles python2.2, 2.3 and ipython in /sw/bin. Yeah, I >> duplicated code, but I didn't want to spend a second longer on this >> than I had to. > > Thanks, works great. To anyone else who uses it - you need to run it > as root, which is obvious in hindsight, but it doesn't give any error > messages if you don't; it just doesn't work. Another possible solution is to explicitly enable fink only when you want something from it, which may or may not be practical depending on how f**ked you are :) -bob From jason at smileproject.com Fri Apr 9 16:38:46 2004 From: jason at smileproject.com (Jason Van Anden) Date: Fri Apr 9 16:39:27 2004 Subject: [Pythonmac-SIG] Path Statement Message-ID: I wrote a bunch of toy applications on a Windows machine earlier today. When I ran them there, it found files it needed to import if they were in the same directory as the code I was running. I am not getting the same result when I try to do this on my Mac OS X machine. Is there a way to make this work the same way? Thanks, Jason Van Anden From bob at redivi.com Fri Apr 9 16:58:14 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Apr 9 16:54:11 2004 Subject: [Pythonmac-SIG] Path Statement In-Reply-To: References: Message-ID: <9E8F7402-8A68-11D8-B4C3-000A95686CD8@redivi.com> On Apr 9, 2004, at 4:38 PM, Jason Van Anden wrote: > I wrote a bunch of toy applications on a Windows machine earlier > today. When I ran them there, it found files it needed to import if > they were in the same directory as the code I was running. I am not > getting the same result when I try to do this on my Mac OS X machine. > Is there a way to make this work the same way? Python modules that are in the same directory should nearly always be able to find each other regardless of platform. You'll probably need to give us a better description of how you are running them on OS X, how they import each other, versions of OS X and Python, how Python was installed, etc. before you're going to get any specific suggestions. -bob From jason at smileproject.com Fri Apr 9 18:03:06 2004 From: jason at smileproject.com (Jason Van Anden) Date: Fri Apr 9 18:04:02 2004 Subject: [Pythonmac-SIG] Path Statement In-Reply-To: <9E8F7402-8A68-11D8-B4C3-000A95686CD8@redivi.com> References: <9E8F7402-8A68-11D8-B4C3-000A95686CD8@redivi.com> Message-ID: On Apr 9, 2004, at 4:58 PM, Bob Ippolito wrote: > > On Apr 9, 2004, at 4:38 PM, Jason Van Anden wrote: > >> I wrote a bunch of toy applications on a Windows machine earlier >> today. When I ran them there, it found files it needed to import if >> they were in the same directory as the code I was running. I am not >> getting the same result when I try to do this on my Mac OS X machine. >> Is there a way to make this work the same way? > > Python modules that are in the same directory should nearly always be > able to find each other regardless of platform. You'll probably need > to give us a better description of how you are running them on OS X, > how they import each other, versions of OS X and Python, how Python > was installed, etc. before you're going to get any specific > suggestions. > > -bob > The modules that my code was importing had # comments on the first line of he file. I deleted them and the files worked fine. I have a vague idea that the she-bang can be used in that spot, and this must have been what was throwing the interpreter off. Thank You, Jason From jason at smileproject.com Fri Apr 9 18:13:25 2004 From: jason at smileproject.com (Jason Van Anden) Date: Fri Apr 9 18:13:46 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? Message-ID: <1F568893-8A73-11D8-9D9E-0003930488EC@smileproject.com> In the land of Windows where I am from, I use TextPad for most of my coding. I have been told to use VIM for coding on OSX. I can totally appreciate the power of keystrokes over drag and drop, etc... but I am impatient with the learning curve, for now. Besides GVIM, and suggestions? Jason From bob at redivi.com Fri Apr 9 18:22:42 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Apr 9 18:18:40 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: <1F568893-8A73-11D8-9D9E-0003930488EC@smileproject.com> References: <1F568893-8A73-11D8-9D9E-0003930488EC@smileproject.com> Message-ID: <6AEAC010-8A74-11D8-B4C3-000A95686CD8@redivi.com> On Apr 9, 2004, at 6:13 PM, Jason Van Anden wrote: > In the land of Windows where I am from, I use TextPad for most of my > coding. I have been told to use VIM for coding on OSX. I can totally > appreciate the power of keystrokes over drag and drop, etc... but I > am impatient with the learning curve, for now. Besides GVIM, and > suggestions? I talked about some the different text editors and IDEs available in my PyCon talk [slides] http://www.python.org/pycon/dc2004/papers/32/macpython_pycon2004.pdf [notes taken by attendees during the talk] http://www.sauria.com/~twl/conferences/pycon2004/20040326/ 60%20Minutes%20of%20MacPython.txt -bob From n9yty at n9yty.com Fri Apr 9 23:17:10 2004 From: n9yty at n9yty.com (Steven Palm) Date: Fri Apr 9 23:17:18 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: <1F568893-8A73-11D8-9D9E-0003930488EC@smileproject.com> References: <1F568893-8A73-11D8-9D9E-0003930488EC@smileproject.com> Message-ID: <8DEABB19-8A9D-11D8-BB4C-000A95B1990C@n9yty.com> On Apr 9, 2004, at 5:13 PM, Jason Van Anden wrote: > In the land of Windows where I am from, I use TextPad for most of my > coding. I have been told to use VIM for coding on OSX. I can totally > appreciate the power of keystrokes over drag and drop, etc... but I > am impatient with the learning curve, for now. Besides GVIM, and > suggestions? I use BBEdit, but mostly as a swiss-army knife of editors. I can't say that it does anything magical for me (except syntax highlighting) for Python. It did get a mention in Bob's presentation, so it must work somewhat well. ;-) It works for me. From pijus at virketis.com Sat Apr 10 00:15:07 2004 From: pijus at virketis.com (Pijus Virketis) Date: Sat Apr 10 00:15:13 2004 Subject: [Pythonmac-SIG] where does MacPython's environment file live? Message-ID: Dear all, A script I am trying to run expects the user to set an environment variable FOO_ROOT to, say, ~/foo_root. I've edited my ~/.tcshrc to do it, and everything works like a charm if I use command line python to execute the program. However, if I fire up MacPython, FOO_ROOT is not to be found in os.environ and, unsurprisingly, nothing works ... There must be some other, "global" place where I have to set FOO_ROOT once and for all, but I have not been able to find it. Where does MacPython look for its os.environ? I am using OS X 10.3, stock python 2.3, and the "lightweight" MacPython add-ons. Thank you! Pijus From cpr at emsoftware.com Sat Apr 10 00:24:59 2004 From: cpr at emsoftware.com (Chris Ryland) Date: Sat Apr 10 00:24:23 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: <1F568893-8A73-11D8-9D9E-0003930488EC@smileproject.com> References: <1F568893-8A73-11D8-9D9E-0003930488EC@smileproject.com> Message-ID: <078A9DE2-8AA7-11D8-B541-000393DC534A@emsoftware.com> On Apr 9, 2004, at 6:13 PM, Jason Van Anden wrote: > In the land of Windows where I am from, I use TextPad for most of my > coding. I have been told to use VIM for coding on OSX. I can totally > appreciate the power of keystrokes over drag and drop, etc... but I > am impatient with the learning curve, for now. Besides GVIM, and > suggestions? Uh-oh, I hear the licking of editor flames. ;-) Gee, Emacs runs just great under OS X *and* Windows *and* Linux *and* ..., and is the most powerful editor (really, an operating system) out there. Cheers! --Chris Ryland / Em Software, Inc. / www.emsoftware.com From bob at redivi.com Sat Apr 10 03:23:10 2004 From: bob at redivi.com (Bob Ippolito) Date: Sat Apr 10 03:19:04 2004 Subject: [Pythonmac-SIG] where does MacPython's environment file live? In-Reply-To: References: Message-ID: On Apr 10, 2004, at 12:15 AM, Pijus Virketis wrote: > A script I am trying to run expects the user to set an environment > variable FOO_ROOT to, say, ~/foo_root. I've edited my ~/.tcshrc to do > it, and everything works like a charm if I use command line python to > execute the program. However, if I fire up MacPython, FOO_ROOT is not > to be found in os.environ and, unsurprisingly, nothing works ... There > must be some other, "global" place where I have to set FOO_ROOT once > and for all, but I have not been able to find it. Where does MacPython > look for its os.environ? > > I am using OS X 10.3, stock python 2.3, and the "lightweight" > MacPython add-ons. http://developer.apple.com/qa/qa2001/qa1067.html http://developer.apple.com/documentation/MacOSX/Conceptual/ BPRuntimeConfig/Concepts/EnvironmentVars.html -bob From fkauff at duke.edu Thu Apr 8 10:36:42 2004 From: fkauff at duke.edu (Frank Kauff) Date: Sat Apr 10 13:33:30 2004 Subject: [Pythonmac-SIG] METH_CLASS or METH_STATIC error when importing c module Message-ID: <1081435002.2059.39.camel@osiris.biology.duke.edu> Hi all, I wrote my first extension module in c (following pretty much the example in the Python documentation), and everything works fine under linux. Compiling and linking also goes without problems with python 2.3 in Panther and Jaguar, but when I try to import the module it gives me: ValueError: module functions cannot set METH_CLASS or METH_STATIC Any help appreciated, thanks, Frank From Jack.Jansen at cwi.nl Sat Apr 10 17:36:15 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sat Apr 10 17:36:16 2004 Subject: [Pythonmac-SIG] Apple Python using Fink Python's path? In-Reply-To: <20040407051546.GB83530@uiuc.edu> References: <20040407034227.GB82525@uiuc.edu> <20040407051546.GB83530@uiuc.edu> Message-ID: <180F3A24-8B37-11D8-8A7D-000D934FF6B4@cwi.nl> On 7 Apr 2004, at 07:15, Nicholas Riley wrote: > On Tue, Apr 06, 2004 at 09:20:26PM -0700, Brian Lenihan wrote: >> OS X does not include the full path in argv[0]. I use a script to >> rename /sw/bin/python* when I don't want Fink's Python to interfere >> (and to move everything back when I need Fink Python). > > Aha, I see a workaround for this bug here: > > February/023306.html> Yuck! That's a nasty bug... I've filed a bug report (for myself:-), I'll fix this for 2.3.4. In the mean time people should probably use #!/usr/bin/env or something to work around the issue. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From Jack.Jansen at cwi.nl Sat Apr 10 17:41:36 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sat Apr 10 17:41:36 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: <8DEABB19-8A9D-11D8-BB4C-000A95B1990C@n9yty.com> References: <1F568893-8A73-11D8-9D9E-0003930488EC@smileproject.com> <8DEABB19-8A9D-11D8-BB4C-000A95B1990C@n9yty.com> Message-ID: On 10 Apr 2004, at 05:17, Steven Palm wrote: > > On Apr 9, 2004, at 5:13 PM, Jason Van Anden wrote: >> In the land of Windows where I am from, I use TextPad for most of my >> coding. I have been told to use VIM for coding on OSX. I can >> totally appreciate the power of keystrokes over drag and drop, etc... >> but I am impatient with the learning curve, for now. Besides GVIM, >> and suggestions? > > I use BBEdit, but mostly as a swiss-army knife of editors. I can't > say that it does anything magical for me (except syntax highlighting) > for Python. It did get a mention in Bob's presentation, so it must > work somewhat well. ;-) It works for me. Same here: I use bbedit for everything. I've now even managed to set things up so that I can use it for a lot of my Linux work:-) The really good things about BBedit is that "it sucks less". There are lots more powerful editors out there (and I used to be a emacs user, so I know powerful when I see it:-), but bbedit just never ever gets in your way, with one or two minor exceptions (the diff is pretty abysmal, for instance). And bbedit does have all these nifties when you want them, like cvs integration, ftp/sftp editing, syntax highlighting (and even more bells and whistles for html and some other languages), function/class popups, etc etc etc. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From jwt at qth.ath.cx Sat Apr 10 22:51:09 2004 From: jwt at qth.ath.cx (Jim Tittsler) Date: Sat Apr 10 22:51:18 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: <1F568893-8A73-11D8-9D9E-0003930488EC@smileproject.com> References: <1F568893-8A73-11D8-9D9E-0003930488EC@smileproject.com> Message-ID: <20040411025109.GA7443@server.onjapan.net> On Fri, Apr 09, 2004 at 06:13:25PM -0400, Jason Van Anden wrote: > Besides GVIM, and suggestions? SubEthaEdit also does a good job of syntax highlighting Python... and is great if you are trying to collaborate with someone across the room or across the 'net since you can both edit a live version of the same file. (Another one of those things that may not sound useful at first encounter, but which can be surprisingly effective in the right circumstances.) Freeware. http://www.codingmonkeys.de/subethaedit/ From phil at masstransfer.net Sun Apr 11 03:28:54 2004 From: phil at masstransfer.net (Phil) Date: Sun Apr 11 03:23:53 2004 Subject: [Pythonmac-SIG] Trying to track down a bug in BitTorrent for Mac OS 9 Message-ID: I have something of an oddball question, and would be grateful if someone could help me out. I'm trying to track down a bug that shows up when I run BitTorrent for Mac OS 9, and I'm not sure whether it's a problem with BitTorrent, MacPython, or some combination of both. Basically, what happens is this: in BitTorrent, when you resume downloading after having stopped (say, to restart your computer), the client checks the portion of the file you've already downloaded. (I assume it does this to test for corruption and so forth.) Normally, under Windows or OS X, this takes just a few minutes. But for some reason, under OS 9, it takes an absurd amount of time -- something like 1 hour per 100 MB. From what I understand, "checking [the] existing file" is _not_ a computationally-intensive process, and shouldn't take anything like the length of time it takes on Mac OS 9 (using the btdownloadheadless.py client, which is the only one that works under OS 9). As it stands now, if I'm interrupted near the end of an 800MB download, I have to let my computer run overnight just to get back on! Has anyone seen this bug before? Any idea of what might cause it, or how to fix it? I've upgraded to the newest version of MacPython, and have confirmed that the bug still shows up. Alas, my expertise with Python/programming is basically nil, so I'm lost in the woods here... Thanks, Phil P.S. Does anyone know of a workaround for dealing with .torrents with long filenames under Mac OS 9? Right now, my understanding is that if the .torrent is made up of multiple files with long filenames, OS 9 users are out of luck. From jason at smileproject.com Sun Apr 11 08:53:58 2004 From: jason at smileproject.com (Jason Van Anden) Date: Sun Apr 11 08:56:17 2004 Subject: [Pythonmac-SIG] Where's the Combo-Box? Message-ID: <4C5C0DAD-8BB7-11D8-825F-0003930488EC@smileproject.com> It seems really strange to me that Tkinter does not come with a default Combo or Drop Down-Box control. In Visual Studio and in fact, on any browser interface, this control is indispensable. Am I simply missing something? Searching online did not really help. I am looking for suggestions. If possible, I would like to stick with Tkinter, and not distract myself with custom modules*. I just want to get the job done, and I have enough to learn being new to Python. * Personally, I find this a trap that one is easily seduced into with other languages like VB. All too often it seems that the programmer becomes expert at using the modules rather than becoming a better programmer - exposing himself to the whim of the add-on developer. I want to work with a refined palette - as opposed to taking on a new hobby qualifying custom modules. This is not to say that I think one should always roll their own -- it's more about finding some sort of middle ground. Jason From chris at fonnesbeck.org Sun Apr 11 13:45:07 2004 From: chris at fonnesbeck.org (Christopher Fonnesbeck) Date: Sun Apr 11 13:45:18 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: References: Message-ID: On Apr 11, 2004, at 12:00 PM, pythonmac-sig-request@python.org wrote: > > From: Jim Tittsler > Date: April 10, 2004 10:51:09 PM EDT > To: pythonmac-sig@python.org > Subject: Re: [Pythonmac-SIG] What is Your Favorite Text Editor? > > > On Fri, Apr 09, 2004 at 06:13:25PM -0400, Jason Van Anden wrote: >> Besides GVIM, and suggestions? > > SubEthaEdit also does a good job of syntax highlighting > Python... and is great if you are trying to collaborate with > someone across the room or across the 'net since you can both > edit a live version of the same file. (Another one of those > things that may not sound useful at first encounter, but which > can be surprisingly effective in the right circumstances.) > Freeware. > > http://www.codingmonkeys.de/subethaedit/ SubEthaEdit hasnt been updated in a long, long time. I'm wondering if development has ceased. I favour vim for python coding, myself. The folding feature alone makes it invaluable, and it has the best diff highlighting that I've seen. If pdb wasnt broken on emacs, I would consider it, but until then vim is my python editor of choice. C. -- Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g ) Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia "Make the pie higher!" -- George W. Bush -- Putting http://wecanstopspam.org in your email helps it pass through overzealous spam filters. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1680 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040411/66b87be5/attachment.bin From berkowit at silcom.com Sun Apr 11 13:53:19 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Sun Apr 11 13:53:26 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2117 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040411/6a2346ab/smime.bin From just at letterror.com Sun Apr 11 14:05:37 2004 From: just at letterror.com (Just van Rossum) Date: Sun Apr 11 14:05:48 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: Message-ID: Christopher Fonnesbeck wrote: > > http://www.codingmonkeys.de/subethaedit/ > > SubEthaEdit hasnt been updated in a long, long time. I'm wondering if > development has ceased. [OT] Version 1.1.5 was released last november. I know the motto "release early, release often", but to call 5 months a "long, long time" is ridiculous. Just From mlpollard at earthlink.net Sun Apr 11 14:09:29 2004 From: mlpollard at earthlink.net (Tom Pollard) Date: Sun Apr 11 14:07:43 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: References: Message-ID: <6069EF5F-8BE3-11D8-8B14-000A959B24A6@earthlink.net> I'm currently just using XCode for Python. It also has syntax highlighting and a function menu, and supports the most basic emacs keystroke commands. It's a pretty friendly environment (IMHO). Tom Pollard From chris at fonnesbeck.org Sun Apr 11 16:13:15 2004 From: chris at fonnesbeck.org (Christopher Fonnesbeck) Date: Sun Apr 11 16:13:25 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: References: Message-ID: On Apr 11, 2004, at 2:05 PM, Just van Rossum wrote: > Christopher Fonnesbeck wrote: > >>> http://www.codingmonkeys.de/subethaedit/ >> >> SubEthaEdit hasnt been updated in a long, long time. I'm wondering if >> development has ceased. > > [OT] Version 1.1.5 was released last november. I know the motto > "release > early, release often", but to call 5 months a "long, long time" is > ridiculous. > > Just Well, if you actually look at the release history, 5 versions were released between july and november, then nothing since. So, relatively speaking, zero releases in 4 months *is* a long time, if not a long, long time. C. -- Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g ) Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia "Make the pie higher!" -- George W. Bush -- Putting http://wecanstopspam.org in your email helps it pass through overzealous spam filters. From berkowit at silcom.com Sun Apr 11 16:21:52 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Sun Apr 11 16:21:58 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: Message-ID: On 4/11/04 1:13 PM, "Christopher Fonnesbeck" wrote: > > On Apr 11, 2004, at 2:05 PM, Just van Rossum wrote: > >> Christopher Fonnesbeck wrote: >> >>>> http://www.codingmonkeys.de/subethaedit/ >>> >>> SubEthaEdit hasnt been updated in a long, long time. I'm wondering if >>> development has ceased. >> >> [OT] Version 1.1.5 was released last november. I know the motto >> "release >> early, release often", but to call 5 months a "long, long time" is >> ridiculous. >> >> Just > > Well, if you actually look at the release history, 5 versions were > released between july and november, then nothing since. So, relatively > speaking, zero releases in 4 months *is* a long time, if not a long, > long time. It's not unusual for several version updates of a product to appear to fix bugs and sometimes to implement initial user feature requests (and then fix their bugs). If there are no more bugs being reported, there will be no more minor updates. That would tend to indicate a product that's pretty solid, not one that should be shunned. In the case of freeware it may also indicate that the developer is not interested in adding more features, at least for now, but if it works well, who cares? -- Paul Berkowitz -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2117 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040411/cb4796ba/smime.bin From Jack.Jansen at cwi.nl Sun Apr 11 18:24:06 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sun Apr 11 18:24:09 2004 Subject: [Pythonmac-SIG] Trying to track down a bug in BitTorrent for Mac OS 9 In-Reply-To: References: Message-ID: On 11 Apr 2004, at 09:28, Phil wrote: > Basically, what happens is this: in BitTorrent, when you resume > downloading after having stopped (say, to restart your computer), the > client checks the portion of the file you've already downloaded. (I > assume > it does this to test for corruption and so forth.) Normally, under > Windows > or OS X, this takes just a few minutes. > > But for some reason, under OS 9, it takes an absurd amount of time -- > something like 1 hour per 100 MB. My first guess is to check whether it has something to do with the lousy virtual memory implementation on MacOS9. If the algorithm simply reads the whole file (or large chunks of it) into memory and then does some computation on it that will work reasonably well on most operating systems, but not on MacOS9. The tell-tale sign of this would be to check the memory usage of Python in the "About this macintosh" window. If that goes through the roof this may be your problem. The solution could then be to see if there's a buffer size parameter somewhere in the code that you could lower. Hmm, another telltale sign of heavy VM use would be continuous disk activity (noise from the drive, flashing lights if you have an external drive). -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From cpr at emsoftware.com Sun Apr 11 19:56:37 2004 From: cpr at emsoftware.com (Chris Ryland) Date: Sun Apr 11 19:56:04 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: <6069EF5F-8BE3-11D8-8B14-000A959B24A6@earthlink.net> References: <6069EF5F-8BE3-11D8-8B14-000A959B24A6@earthlink.net> Message-ID: On Apr 11, 2004, at 2:09 PM, Tom Pollard wrote: > I'm currently just using XCode for Python. It also has syntax > highlighting and a function menu, and supports the most basic emacs > keystroke commands. It's a pretty friendly environment (IMHO). Yes, and I suspect that the "basic emacs" stuff is just the Cocoa-level text editing, which actually has a fairly complete (if extensible in ObjC/PyObjC only) emacs-like text editing protocol. Cheers! --Chris Ryland / Em Software, Inc. / www.emsoftware.com From bobsavage at mac.com Sun Apr 11 20:10:30 2004 From: bobsavage at mac.com (Bob Savage) Date: Sun Apr 11 20:10:38 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: References: Message-ID: On Apr 11, 2004, at 12:45 PM, Christopher Fonnesbeck wrote: > I favour vim for python coding, myself. The folding feature alone > makes it invaluable, and it has the best diff highlighting that I've > seen. If pdb wasnt broken on emacs, I would consider it, but until > then vim is my python editor of choice. I also have been favorably impressed with Vim. BBedit is great (I like the shell worksheet feature in particular), but Vim has some very cool features (I like making instant macros because I can't seem to make just one mistake -- I usually have to fix the same type of thing four or five times). Plus I can ssh into my Mac at home from my PeeCee at work, where I write and test code using Vim before loading it on the production machine (MPE/ix OS, ugh!). Bob From altis at semi-retired.com Sun Apr 11 23:01:18 2004 From: altis at semi-retired.com (Kevin Altis) Date: Sun Apr 11 23:01:23 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: <1F568893-8A73-11D8-9D9E-0003930488EC@smileproject.com> References: <1F568893-8A73-11D8-9D9E-0003930488EC@smileproject.com> Message-ID: Well since every other possibility is being plugged, I guess I'll mention my own "dog food", the PythonCard codeEditor. Here's the slightly out-of-date Windows screenshots and readme.txt http://pythoncard.sourceforge.net/codeEditor.html PythonCard needed its own standalone editor environment and the first version only took 15 minutes to write, so I got in the habit of using it day to day while I tinkered with it. Since all the hard stuff is done by the Scintilla engine, the source is relatively small and it works on Windows, Linux, and Mac OS X, so as I switch back and forth between machines I don't get lost; Emacs and vim of course are quite fine, but personally I can't deal with them except in short bursts. The main thing that I couldn't live without now that I got used to it with the codeEditor is the built-in shell and the exposed editor API which allows you to write and save Python "scriptlets" or just code some up on the fly in the shell. BBEdit, SubEthaEdit, and other Mac-specific editors are fine. Frankly, which editor you use depends so much on what your past experience is, what keystroke commands are burned into your brain, whether you work on multiple platforms regularly, need a built-in debugger, etc. In the end, you just have to try various editors and IDEs and see which ones fit your brain. http://www.python.org/cgi-bin/moinmoin/PythonEditors ka On Apr 9, 2004, at 3:13 PM, Jason Van Anden wrote: > In the land of Windows where I am from, I use TextPad for most of my > coding. I have been told to use VIM for coding on OSX. I can totally > appreciate the power of keystrokes over drag and drop, etc... but I > am impatient with the learning curve, for now. Besides GVIM, and > suggestions? > > Jason From mbier at office-m.at Mon Apr 12 04:34:05 2004 From: mbier at office-m.at (Markus Biermaier) Date: Mon Apr 12 04:34:15 2004 Subject: [Pythonmac-SIG] QT-file-drag doesn't work with Finder Message-ID: <28D2413C-8C5C-11D8-A6E0-0005029F2DC3@office-m.at> Hello, I'm working on a Python-script that is based on the "dirview"-example. My problem is, that dragging files from the view to "konqueror" works on Linux, but it doesn't work, if the target is the "Finder" of MacOS X. I use MacOS 10.1.5 (I know, not Panther but all other things work fine). My question: Could someone check the "dirview1"-example script and tell me if it is true, that it - works with Linux / konqueror - fails with MacOS X / Finder The check should be: Drag a file from the view to a folder in konqueror. Drag a file from the view to a folder in Finder. As the original "dirview"-script has some bugs Phil Thompson (PyQt) provided me a better version. Please use the new version "dirview1" which you can find under the following link: http://www.office-m.at/downloads/python/dirview1.py Please put your result to the list. Many thanks Markus ---------------------------------------------------------------------- M. Biermaier Wiesengasse 15 3011 Untertullnerbach E-Mail: mbier AT office-m.at Austria / Europe Web Site: http://www.office-m.at From zbir at urbanape.com Mon Apr 12 08:44:46 2004 From: zbir at urbanape.com (Zachery Bir) Date: Mon Apr 12 08:45:02 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: References: Message-ID: <2E138806-8C7F-11D8-88EE-000A958650B6@urbanape.com> On Apr 11, 2004, at 1:45 PM, Christopher Fonnesbeck wrote: > If pdb wasnt broken on emacs, I would consider it, but until then vim > is my python editor of choice. ??? I use pdbtrack in xemacs daily, and have yet to see anywhere where it's broken. Care to elaborate? Zac From chris at fonnesbeck.org Mon Apr 12 09:30:52 2004 From: chris at fonnesbeck.org (Christopher Fonnesbeck) Date: Mon Apr 12 09:31:03 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? In-Reply-To: <2E138806-8C7F-11D8-88EE-000A958650B6@urbanape.com> References: <2E138806-8C7F-11D8-88EE-000A958650B6@urbanape.com> Message-ID: <9EB37B5E-8C85-11D8-B636-000A956FDAC0@fonnesbeck.org> On Apr 12, 2004, at 8:44 AM, Zachery Bir wrote: > On Apr 11, 2004, at 1:45 PM, Christopher Fonnesbeck wrote: > >> If pdb wasnt broken on emacs, I would consider it, but until then vim >> is my python editor of choice. > > ??? I use pdbtrack in xemacs daily, and have yet to see anywhere where > it's broken. Care to elaborate? > I've posted the problem in a number of places, including here, but never stumbled upon a solution. Here it is again: > When I try and run pdb.set_trace() under emacs, I get the following > error: > > > > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/pdb.py(992)set_trace()->None > -> Pdb().set_trace() > (Pdb) > Traceback (most recent call last): > File "", line 148, in ? > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/pdb.py", line 992, in set_trace > Pdb().set_trace() > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/bdb.py", line 52, in trace_dispatch > return self.dispatch_return(frame, arg) > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/bdb.py", line 80, in dispatch_return > if self.quitting: raise BdbQuit > bdb.BdbQuit > > I do not get this behaviour when using pdb *without* emacs, so I am > assuming this is a python-mode problem? However, I do not remember > this occurring under linux. Has anyone run into this? C. -- Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g ) Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia "More and more of our imports come from overseas." George W. Bush, 25 September 2000 -- Putting http://wecanstopspam.org in your email helps it pass through overzealous spam filters. From gandreas at delver.com Mon Apr 12 11:07:21 2004 From: gandreas at delver.com (Glenn Andreas) Date: Mon Apr 12 11:07:34 2004 Subject: [Pythonmac-SIG] What is Your Favorite Text Editor? Message-ID: At 8:01 PM -0700 4/11/04, Kevin Altis wrote: >Well since every other possibility is being plugged... So I of course would recommend PyOXIDE (http://projects.gandreas.com/pyoxide), though I also use a "stand alone" version of the editor (no IDE features) for writing the IDE (since madness can ensue trying to edit source for the IDE within the IDE - especially since you need to restart the IDE to test the changes, but not loose any of the editor windows, which you would if you restart the IDE). You should be able to use TextImp (a "demo" app included with the underlying IDEKit) for similar effect (and some day I may release TextOX, TextImp on steriods which is what I use). So basically, there are lots of options, all depending on what sort of workflow and UI style you are use to... -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From aab.lists at nb-a.com Mon Apr 12 11:27:34 2004 From: aab.lists at nb-a.com (Aldo Bergamini) Date: Mon Apr 12 11:37:10 2004 Subject: [Pythonmac-SIG] hi list Message-ID: <20040412152734.12847@mail.nb-a.com> Hello list, I just suscribed to the PythonMac SIG list. And I have a question on file copying... (I am sorry if this has been asked ad nauseam; I tried to look up in the archives, but I did not get to a search page) BTW: I am happy to get pointed to a do-it-yourself search page to get an answer by myself. **** Yesterday I started a small exercise in Python, on my Powerbook (OS X 10.3). The goal is to have a smart copy command that I'll use to extract files from an iBook that needs to go to service. The iBook owner did not backup on regular basis and now needs as many of his pictures as I can get out of the machine (that remains usable just for a few minutes per 'rescue session'). So I am writing (for the fun of it) a small incremental copy utility. The idea is to copy as many files as I can everytime I can get the iBook to run in firewire mode; eventually the thing will freeze. On the next run the tool will start from the last partially copied file and go on until it's done or to the next freeze. The question is how to copy Mac files from an HFS+ partition to another HFS+ partition. I was looking on the Python Essential Reference for os helper tools and modules and came across the shutil module and its file/ directory tools. The caveat in the book is that mac resource forks are not copied. OTH the macostools does the right thing, copying both forks. My question is, as Mac OS X is a Unix os, how does python behave on Mac OS X, the unix way or the Mac way? Do I have to use the copying function in shutil or the one in macostools? Do the stat functions report a res-fork comprehensive size or the size of the data fork (this is important to know that I have copied all bits and pieces of a rescued file, specially when I restart rescueing data after the iBook freezed). Thanks Aldo From bob at redivi.com Mon Apr 12 12:20:59 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Apr 12 12:16:52 2004 Subject: [Pythonmac-SIG] hi list In-Reply-To: <20040412152734.12847@mail.nb-a.com> References: <20040412152734.12847@mail.nb-a.com> Message-ID: <6248F2D8-8C9D-11D8-A35A-000A95686CD8@redivi.com> On Apr 12, 2004, at 11:27 AM, Aldo Bergamini wrote: > Do I have to use the copying function in shutil or the one in > macostools? > Do the stat functions report a res-fork comprehensive size or the size > of > the data fork (this is important to know that I have copied all bits > and > pieces of a rescued file, specially when I restart rescueing data after > the iBook freezed). shutil uses the POSIX layer only and WILL NOT preserve resource forks. The only way to access resource forks from the POSIX layer is explicitly: resfork = file(filename + '../namedfork/rsrc') macostools uses Carbon and WILL preserve resource forks. -bob From eichin at metacarta.com Mon Apr 12 14:09:30 2004 From: eichin at metacarta.com (eichin@metacarta.com) Date: Mon Apr 12 14:09:36 2004 Subject: [Pythonmac-SIG] hi list In-Reply-To: <20040412152734.12847@mail.nb-a.com> References: <20040412152734.12847@mail.nb-a.com> Message-ID: <7gu0zp6pb9.fsf@pikespeak.metacarta.com> If by "images" you mean gifs and jpgs, they won't have resource forks (at least, nothing you care about) anyway, right? (You can use the programs in /Developer/Tools to check...) http://www.vdesmedt.com/~vds2212/rsync.html has an rsync.py that might be a useful starting point (depending on whether or not you really need the forks.) From aab.lists at nb-a.com Mon Apr 12 17:01:57 2004 From: aab.lists at nb-a.com (Aldo Bergamini) Date: Tue Apr 13 03:06:12 2004 Subject: [Pythonmac-SIG] hi list In-Reply-To: <7gu0zp6pb9.fsf@pikespeak.metacarta.com> References: <7gu0zp6pb9.fsf@pikespeak.metacarta.com> Message-ID: <20040412210157.3460@mail.nb-a.com> eichin@metacarta.com is believed to have said: >If by "images" you mean gifs and jpgs, they won't have resource forks >(at least, nothing you care about) anyway, right? (You can use the >programs in /Developer/Tools to check...) Well, yes; as I am writing something that could be useful in other occasions I wanted to know the obvious limits. Thanks for the reference, Aldo From jnutting at rebisoft.com Tue Apr 13 10:55:06 2004 From: jnutting at rebisoft.com (Jack Nutting) Date: Tue Apr 13 10:54:46 2004 Subject: [Pythonmac-SIG] simple nib loading Message-ID: <8D8B549E-8D5A-11D8-9DF2-000393A6CDA6@rebisoft.com> Hi all, I'm writing a little game using pygame, primarily as a python-learning exercise. While my goal is to keep it cross-platform, I'd like to add platform-specific niceties such as a .nib file containing a proper menu etc for the Mac version. I've tried to include a .nib file using bundlebuilder by including the nib in my 'resources' (it is successfully copied) and the '--nib' command-line option, but so far no good; All I get is the bare-bones menu at the top. All I want to do with the .nib is have a menu with an 'About' panel and such (no actual integration with the python code itself), so I don't want to get too deep into PyObjC issues or anything just yet. Any ideas, anyone? (the work-in-progress is available at http://www.nuthole.com/spinvaders.zip, feedback is welcome! ) //jack From phil at masstransfer.net Tue Apr 13 16:50:09 2004 From: phil at masstransfer.net (Phil) Date: Tue Apr 13 16:45:04 2004 Subject: [Pythonmac-SIG] Trying to track down a bug in BitTorrent for Mac OS 9 In-Reply-To: Message-ID: Jack Jansen wrote: >> But for some reason, under OS 9, it takes an absurd amount of time -- >> something like 1 hour per 100 MB. >My first guess is to check whether it has something to do with the lousy >virtual memory implementation on MacOS9. [...] >The tell-tale sign of this would be to check the memory usage of Python >in the "About this macintosh" window. If that goes through the roof this >may be your problem. [...] another telltale sign of heavy VM use would be >continuous disk activity (noise from the drive, flashing lights if you >have an >external drive). Alas, neither of these signs seems to be happening -- the (internal, IDE) disk doesn't sound like it's thrashing, and the PythonInterpreter doesn't jump in memory usage at all -- it's using about 20% of a 23.2 MB memory allotment. So...what's your second guess? ;) Thanks very much for your reply! Let me know if I can supply any additional information that might be useful. Best, Phil From gherman at darwin.in-berlin.de Wed Apr 14 06:05:46 2004 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Wed Apr 14 06:00:51 2004 Subject: [Pythonmac-SIG] Converting audio files, AIFF, MP3, AAC Message-ID: <4C8E1B84-8DFB-11D8-9004-00039345C610@darwin.in-berlin.de> Hi, I'm trying to convert between AIFF and MP3 in order to edit MP3 audio files in AIFF format and want to build some Pythonic glue around that... AIFF to MP3 works great using the LAME plugin for iTunes [1]. This bundle contains a compiled lame executable that one can also use nice- ly from the command-line. Now what I'm looking for is a way for automated decoding of MP3 to AIFF. I've found MACAST MP3 Converter 1.0.1 [2], a Carbon GUI which decodes MP3 very quickly, but it seems to be doing a lot of busy waiting and a command-line tool is what I need, anyway. BTW, I see the former (?) aiff module in the standard library (now called aifc [3]) provides access to sound frames, etc (haven't really used it, though). Is there anything similar for MP3 and/or even AAC files? Thanks for any ideas, Dinu [1] http://www.blacktree.com/apps/iTunes-LAME/index.php [2] http://www.macast.com/download.shtml [3] http://www.python.org/doc/current/lib/module-aifc.html From p.oberndoerfer at urheberrecht.org Wed Apr 14 06:38:22 2004 From: p.oberndoerfer at urheberrecht.org (Pascal Oberndoerfer) Date: Wed Apr 14 06:37:57 2004 Subject: [Pythonmac-SIG] Converting audio files, AIFF, MP3, AAC In-Reply-To: <4C8E1B84-8DFB-11D8-9004-00039345C610@darwin.in-berlin.de> Message-ID: Dinu Gherman at gherman@darwin.in-berlin.de: > Hi, > > I'm trying to convert between AIFF and MP3 in order to edit MP3 audio > files in AIFF format and want to build some Pythonic glue around that... > > AIFF to MP3 works great using the LAME plugin for iTunes [1]. This > bundle contains a compiled lame executable that one can also use nice- > ly from the command-line. > > Now what I'm looking for is a way for automated decoding of MP3 to AIFF. > I've found MACAST MP3 Converter 1.0.1 [2], a Carbon GUI which decodes > MP3 very quickly, but it seems to be doing a lot of busy waiting and a > command-line tool is what I need, anyway. > > BTW, I see the former (?) aiff module in the standard library (now > called aifc [3]) provides access to sound frames, etc (haven't really > used it, though). Is there anything similar for MP3 and/or even AAC > files? > > Thanks for any ideas, > > Dinu > > [1] http://www.blacktree.com/apps/iTunes-LAME/index.php > [2] http://www.macast.com/download.shtml > [3] http://www.python.org/doc/current/lib/module-aifc.html Maybe this is of some help: Pascal From Benjamin.Schollnick at usa.xerox.com Wed Apr 14 08:19:29 2004 From: Benjamin.Schollnick at usa.xerox.com (Schollnick, Benjamin) Date: Wed Apr 14 08:19:40 2004 Subject: [Pythonmac-SIG] Trying to track down a bug in BitTorrent for Mac OS 9 Message-ID: <51B62EFFBC83D6118ADA00096BB030A107CADEA1@usamcms7.mc.usa.xerox.com> > >> But for some reason, under OS 9, it takes an absurd amount > of time -- > >> something like 1 hour per 100 MB. > > >virtual memory implementation on MacOS9. [...] > >in the "About this macintosh" window. If that goes through > the roof this > VM use would be > >continuous disk activity (noise from the drive, flashing > lights if you have an external drive). > > Alas, neither of these signs seems to be happening -- the > (internal, IDE)disk doesn't sound like it's thrashing, and the > PythonInterpreter doesn't jump in memory usage at all -- it's > using about 20% of a 23.2 MB memory allotment. > > So...what's your second guess? ;) I mimght be jumping to conclusions... Especially since I have not examined the Bittorrent code... (I keep meaning to....) But could something be blocking the IO requests? Or locking the queue that the requests are in? Since Mac OS 9 is co-operatively multitasking, something else that is running, including the OS, could be starving the OS 9 Bittorrent client for Cycles... Try opening the Bittorrent client, and quiting *everything* else, including the finder and see if there is any change. The easiest way to quit the finder, and everything else is to whip up a applescript that opens bittorrent, and then closes everything else.. The pity is that I had a applescript like that for another application, but I don't have it available now.... - Benjamin From phil at masstransfer.net Wed Apr 14 14:44:16 2004 From: phil at masstransfer.net (Phil) Date: Wed Apr 14 14:39:16 2004 Subject: [Pythonmac-SIG] Trying to track down a bug in BitTorrent for Mac OS 9 In-Reply-To: <51B62EFFBC83D6118ADA00096BB030A107CADEA1@usamcms7.mc.usa.xerox.com> Message-ID: Hi, Benjamin, and thanks for your reply! >But could something be blocking the IO requests? Or locking the queue >that the requests are in? > >Since Mac OS 9 is co-operatively multitasking, something else that is >running, including the OS, could be starving the OS 9 Bittorrent client >for Cycles... I do notice that the problem tends to get even worse when BT is running in the background (though 2.3.3 seems to have mitigated that somewhat). Actually, BT runs terribly in the background in general -- if I don't keep it in the foreground during a transfer, it loses a lot of upload/download speed and eventually drops the connection completely. >Try opening the Bittorrent client, and quiting *everything* else, including >the finder and see if there is any change. >The easiest way to quit the finder, and everything else is to whip up a >applescript that opens bittorrent, and then closes everything else.. >The pity is that I had a applescript like that for another application, >but I don't have it available now.... I actually have one around that just goes "tell application finder / quit / end tell", which comes in handy on occasion. (Specifically: for some reason, after I burn a CD, sometimes the Finder goes down under a rash of -110 errors, and I have to force-quit the finder, so sometimes I just preemptively quit and reactivate it.) But alas, this didn't help either: quitting the Finder didn't result in any appreciable increase in speed. To me, that strongly suggests that the bottleneck _isn't_ any kind of processor overload, since quitting the Finder in Mac OS 9 consistently boosts the speed in applications where the CPU is getting maxed out (Virtual PC, for instance). The hunt continues! Any other ideas? Thanks, Phil From brad.allen at omsdal.com Wed Apr 14 20:10:27 2004 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Wed Apr 14 20:11:38 2004 Subject: [Pythonmac-SIG] hi list In-Reply-To: <20040412210157.3460@mail.nb-a.com> Message-ID: "Aldo Bergamini" wrote on 04/12/2004 10:27:34 AM: > Hello list, > > I just suscribed to the PythonMac SIG list. And I have a question on file > copying... (I am sorry if this has been asked ad nauseam; I tried to look > up in the archives, but I did not get to a search page) > Hi, I'm also new to the PythonMac-SIG list. I'm a Python newbie, but I may be of some help here with the Python functions provided below. At work, we hired a pro Python developer at work to help us out with some Python scripting. One of his contributions to our toolset are some simple functions for copying Mac files and folders. These functions call the "ditto" command which is built into Mac OS X, and which has '-rsrcFork' to include resource forks. We have found this approach to be fairly robust on our Mac OS 10.2/10.3 clients, with no need to install additional libraries beyond the built-in Python 2.2 and 2.3 on Jaguar and Panther respectively. Here they are...feel free to modify as needed. import sys import os #boolean constants for True and False don't exist prior to Python 2.3 #...so we usually include this at the top of all our scripts for backward compatibility with old versions of Python try: True, False except NameError: True = 1 False = 0 ############################## theShowMustGoOn = True # flag to determine whether to continue copying an error is encountered def macCopyFile(srcFilePath, dstDirPath): if not os.path.exists(dstDirPath): os.makedirs(dstDirPath) c = os.spawnv( os.P_WAIT, '/usr/bin/ditto', ['ditto', '-V', '-rsrcFork', srcFilePath, dstDirPath] ) if c: print '\n*** error copying', srcFilePath, 'to', dstDirPath if theShowMustGoOn: pass #BUGBUG log error else: sys.exit(1) def macCopyDirContents(src, dst): 'Copy the contents of src into dst.' print 'copying', src, 'to', dst, '...' c = os.spawnv(os.P_WAIT, '/usr/bin/ditto', ['ditto', '-V', '-rsrcFork', src, dst]) print 'result =', c if c: print '\n*** error copying', src, 'to', dst if theShowMustGoOn: pass #BUGBUG log error else: sys.exit(1) print 'done copying' def macCopy(src, dstDirPath): 'Copy src into dstDirPath.' name = os.path.split(src)[1] dst = os.path.join(dstDirPath, name) macCopyDirContents(src, dst) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20040414/6060a01e/attachment.html From jreese99 at verizon.net Wed Apr 14 21:06:09 2004 From: jreese99 at verizon.net (James Reese) Date: Wed Apr 14 21:06:14 2004 Subject: [Pythonmac-SIG] Interacting with internal modem from Python Message-ID: <14BDCA7B-8E79-11D8-8793-003065C69CBE@verizon.net> What is the easiest way to interact with a Mac's internal modem from Python (OS X 10.3.3)? I want to set the modem's parameters (parity, speed, etc.) and place an outgoing call. Any pointers will be greatly appreciated. Jim Reese From bob at redivi.com Wed Apr 14 21:21:20 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed Apr 14 21:17:09 2004 Subject: [Pythonmac-SIG] Interacting with internal modem from Python In-Reply-To: <14BDCA7B-8E79-11D8-8793-003065C69CBE@verizon.net> References: <14BDCA7B-8E79-11D8-8793-003065C69CBE@verizon.net> Message-ID: <3389A7D2-8E7B-11D8-9080-000A95686CD8@redivi.com> On Apr 14, 2004, at 9:06 PM, James Reese wrote: > What is the easiest way to interact with a Mac's internal modem from > Python (OS X 10.3.3)? I want to set the modem's parameters (parity, > speed, etc.) and place an outgoing call. > > Any pointers will be greatly appreciated. Try doing it the standard unix way, the device should be /dev/cu.modem .. -bob From Jack.Jansen at cwi.nl Thu Apr 15 17:45:16 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu Apr 15 17:45:59 2004 Subject: [Pythonmac-SIG] Trying to track down a bug in BitTorrent for Mac OS 9 In-Reply-To: References: Message-ID: <2EDF238C-8F26-11D8-A986-000D934FF6B4@cwi.nl> On 13 Apr 2004, at 22:50, Phil wrote: > Alas, neither of these signs seems to be happening -- the (internal, > IDE) > disk doesn't sound like it's thrashing, and the PythonInterpreter > doesn't > jump in memory usage at all -- it's using about 20% of a 23.2 MB memory > allotment. Well, I wouldn't say "alas" here, because this one would have been difficult to fix:-) But the downside is you'll have more work to do. Examine the code, and find the bit that is responsible for testing the integrity of the bits you already have on disk. In all likelyhood it'll be some sort of a loop that reads a chunk of data and then does some processing on it. Put a print statement before and after the loop, and each time through the loop also print how much data has been processed. You will probably see one of two things: 1. The loop handles data in extremely small amounts 2. The loop slows down as it progresses Hmm, something else you could try if you have access to an OSX machine is run the program on OSX, with MacPython-OS9. Run MacPython-OS9 in native OSX mode (this is the default), not in the Classic environment. If this makes the problem go away then it probably has to do something with some lowlevel OS problem on OS9, and it's not going to be easy to fix. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From Jack.Jansen at cwi.nl Thu Apr 15 17:54:52 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu Apr 15 17:54:50 2004 Subject: [Pythonmac-SIG] Trying to track down a bug in BitTorrent for Mac OS 9 In-Reply-To: References: Message-ID: <86369E60-8F27-11D8-A986-000D934FF6B4@cwi.nl> Ah! Benjamins suggestion is a good one, threading is lousy on OS9, and more so in Python. > I do notice that the problem tends to get even worse when BT is > running in > the background (though 2.3.3 seems to have mitigated that somewhat). > Actually, BT runs terribly in the background in general -- if I don't > keep > it in the foreground during a transfer, it loses a lot of > upload/download > speed and eventually drops the connection completely. This is a known bug (or feature:-) in MacPython-OS9: in the background it becomes very "friendly" and takes only very few cycles. Unfortunately this can mean it even takes few cycles it the foreground process doesn't want the cycles anyway. Various other OS9 apps share this problem, try stuffit expander in the background, for instance:-( There's a call SchedParams in the MacOS module that you can use to influence this behaviour. > But alas, this didn't help either: quitting the Finder didn't result > in > any appreciable increase in speed. To me, that strongly suggests that > the > bottleneck _isn't_ any kind of processor overload, since quitting the > Finder in Mac OS 9 consistently boosts the speed in applications where > the > CPU is getting maxed out (Virtual PC, for instance). It could well be the other threads in Bittorrent that are the problem. The low level I/O library used by Python (GUSI) has some quirks in this area. If you can control the number of threads Bittorrent uses try fiddling with that, or seeing whether you can make the other threads do something harmless (such as time.sleep(1)) while the algorithm runs. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From dudley at cs.stanford.edu Thu Apr 15 18:39:06 2004 From: dudley at cs.stanford.edu (Dudley Carr) Date: Thu Apr 15 18:39:09 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems Message-ID: <407F0F0A.3050901@cs.stanford.edu> Hi, I have an RSS reader written in Python that's performing poorly on OS X Panther. I've managed to track it down to getaddrinfo. I tried the same code on Windows with Python 2.3.3 and the look-ups are a fraction of what they are on OS X, so I don't believe it's a problem with my network configuration. I've run the code snippet below several times on different domains with the same results. Can anyone else confirm the timings that I'm getting below? Regards, Dudley >>>import socket,time >>> def getaddrinfoTest(count): ... for i in range(count): ... start = time.time() ... socket.getaddrinfo('yahoo.com', 80) ... end = time.time() ... print 'time =', end - start ... >>> getaddrinfoTest(20) time = 0.191851854324 time = 3.05499100685 time = 5.86090803146 time = 11.3977048397 time = 0.239115953445 time = 0.263440847397 time = 0.304595947266 time = 0.296709060669 time = 0.2084441185 time = 0.248239040375 time = 0.26735496521 time = 0.137476205826 time = 0.342806100845 time = 8.5551700592 time = 1.53769421577 time = 3.022397995 time = 9.31026601791 time = 3.00104379654 time = 6.08663797379 time = 0.202562093735 From n9yty at n9yty.com Thu Apr 15 19:25:53 2004 From: n9yty at n9yty.com (Steven Palm) Date: Thu Apr 15 19:26:01 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: <407F0F0A.3050901@cs.stanford.edu> References: <407F0F0A.3050901@cs.stanford.edu> Message-ID: <3D421F85-8F34-11D8-A209-000A95B1990C@n9yty.com> On Apr 15, 2004, at 5:39 PM, Dudley Carr wrote: > I've run the code snippet below several times on different domains > with the same results. Can anyone else confirm the timings that I'm > getting below? > > >>>import socket,time > >>> def getaddrinfoTest(count): > ... for i in range(count): > ... start = time.time() > ... socket.getaddrinfo('yahoo.com', 80) > ... end = time.time() > ... print 'time =', end - start > ... > > >>> getaddrinfoTest(20) > time = 0.191851854324 > time = 3.05499100685 > time = 5.86090803146 > time = 11.3977048397 > time = 0.239115953445 > time = 0.263440847397 > time = 0.304595947266 > time = 0.296709060669 > time = 0.2084441185 > time = 0.248239040375 > time = 0.26735496521 > time = 0.137476205826 > time = 0.342806100845 > time = 8.5551700592 > time = 1.53769421577 > time = 3.022397995 > time = 9.31026601791 > time = 3.00104379654 > time = 6.08663797379 > time = 0.202562093735 Here is what I got: time = 1.26433587074 time = 0.0177340507507 time = 0.0177311897278 time = 0.0363111495972 time = 0.0191750526428 time = 0.0176680088043 time = 0.0340809822083 time = 0.0179800987244 time = 0.0177900791168 time = 0.0528509616852 time = 0.0188248157501 time = 0.0180280208588 time = 0.0378699302673 time = 0.0186338424683 time = 0.0191929340363 time = 0.0350270271301 time = 0.0176329612732 time = 0.0175850391388 time = 0.0350279808044 time = 0.0199198722839 From amundsen463 at yahoo.com Thu Apr 15 19:39:50 2004 From: amundsen463 at yahoo.com (Craig Amundsen) Date: Thu Apr 15 19:39:55 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: <3D421F85-8F34-11D8-A209-000A95B1990C@n9yty.com> References: <407F0F0A.3050901@cs.stanford.edu> <3D421F85-8F34-11D8-A209-000A95B1990C@n9yty.com> Message-ID: <302F797C-8F36-11D8-9BC9-000A959D4466@yahoo.com> On Apr 15, 2004, at 4:25 PM, Steven Palm wrote: > On Apr 15, 2004, at 5:39 PM, Dudley Carr wrote: >> I've run the code snippet below several times on different domains >> with the same results. Can anyone else confirm the timings that I'm >> getting below? >> >> >>>import socket,time >> >>> def getaddrinfoTest(count): >> ... for i in range(count): >> ... start = time.time() >> ... socket.getaddrinfo('yahoo.com', 80) >> ... end = time.time() >> ... print 'time =', end - start >> ... >> >> >>> getaddrinfoTest(20) >> time = 0.191851854324 >> time = 3.05499100685 >> time = 5.86090803146 >> time = 11.3977048397 >> time = 0.239115953445 >> time = 0.263440847397 >> time = 0.304595947266 >> time = 0.296709060669 >> time = 0.2084441185 >> time = 0.248239040375 >> time = 0.26735496521 >> time = 0.137476205826 >> time = 0.342806100845 >> time = 8.5551700592 >> time = 1.53769421577 >> time = 3.022397995 >> time = 9.31026601791 >> time = 3.00104379654 >> time = 6.08663797379 >> time = 0.202562093735 > > Here is what I got: > > time = 1.26433587074 > time = 0.0177340507507 > time = 0.0177311897278 > time = 0.0363111495972 > time = 0.0191750526428 > time = 0.0176680088043 > time = 0.0340809822083 > time = 0.0179800987244 > time = 0.0177900791168 > time = 0.0528509616852 > time = 0.0188248157501 > time = 0.0180280208588 > time = 0.0378699302673 > time = 0.0186338424683 > time = 0.0191929340363 > time = 0.0350270271301 > time = 0.0176329612732 > time = 0.0175850391388 > time = 0.0350279808044 > time = 0.0199198722839 And I got (DSL connection through a router) time = 0.874419927597 time = 0.931268930435 time = 0.870882034302 time = 0.880262851715 time = 0.853048801422 time = 0.890556812286 time = 0.930191040039 time = 0.857303142548 time = 0.868662834167 time = 0.860188961029 time = 0.873660087585 time = 0.858871936798 time = 0.935255050659 time = 0.861166000366 time = 0.851492881775 time = 0.859770059586 time = 0.851730108261 time = 0.895750045776 time = 1.60512185097 time = 0.92355799675 - Craig From bob at redivi.com Thu Apr 15 19:56:44 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Apr 15 19:52:32 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: <302F797C-8F36-11D8-9BC9-000A959D4466@yahoo.com> References: <407F0F0A.3050901@cs.stanford.edu> <3D421F85-8F34-11D8-A209-000A95B1990C@n9yty.com> <302F797C-8F36-11D8-9BC9-000A959D4466@yahoo.com> Message-ID: <8C8FB262-8F38-11D8-8EF5-000A95686CD8@redivi.com> On Apr 15, 2004, at 7:39 PM, Craig Amundsen wrote: > > On Apr 15, 2004, at 4:25 PM, Steven Palm wrote: > >> On Apr 15, 2004, at 5:39 PM, Dudley Carr wrote: >>> I've run the code snippet below several times on different domains >>> with the same results. Can anyone else confirm the timings that I'm >>> getting below? >>> >>> >>>import socket,time >>> >>> def getaddrinfoTest(count): >>> ... for i in range(count): >>> ... start = time.time() >>> ... socket.getaddrinfo('yahoo.com', 80) >>> ... end = time.time() >>> ... print 'time =', end - start Basically the fact that this call takes any real time at all means that you should definitely be doing your own DNS caching, or find another way to do it that does. In any case, your application is definitely a good candidate for rewrite in Twisted. Using Twisted will abstract away all of the lower level details of cross-platform socket programming and make your application more efficient/responsive so long as you can drink the event driven kool-aid. -bob From cpr at emsoftware.com Thu Apr 15 20:48:54 2004 From: cpr at emsoftware.com (Chris Ryland) Date: Thu Apr 15 20:48:19 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: <407F0F0A.3050901@cs.stanford.edu> References: <407F0F0A.3050901@cs.stanford.edu> Message-ID: This came up on Python-Dev a while back--you could google for it. A big discussion ensued, but it fizzled out in the end, IIRC. The bottom line is that you'd really have to do your own DNS caching. I guess some other Unix-like systems do that at the library level. On Apr 15, 2004, at 6:39 PM, Dudley Carr wrote: > Hi, > > I have an RSS reader written in Python that's performing poorly on OS > X Panther. I've managed to track it down to getaddrinfo. I tried the > same code on Windows with Python 2.3.3 and the look-ups are a fraction > of what they are on OS X, so I don't believe it's a problem with my > network configuration. > > I've run the code snippet below several times on different domains > with the same results. Can anyone else confirm the timings that I'm > getting below? > > Regards, > Dudley > > >>>import socket,time > >>> def getaddrinfoTest(count): > ... for i in range(count): > ... start = time.time() > ... socket.getaddrinfo('yahoo.com', 80) > ... end = time.time() > ... print 'time =', end - start > ... > > >>> getaddrinfoTest(20) > time = 0.191851854324 > time = 3.05499100685 > time = 5.86090803146 > time = 11.3977048397 > time = 0.239115953445 > time = 0.263440847397 > time = 0.304595947266 > time = 0.296709060669 > time = 0.2084441185 > time = 0.248239040375 > time = 0.26735496521 > time = 0.137476205826 > time = 0.342806100845 > time = 8.5551700592 > time = 1.53769421577 > time = 3.022397995 > time = 9.31026601791 > time = 3.00104379654 > time = 6.08663797379 > time = 0.202562093735 > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > Cheers! --Chris Ryland / Em Software, Inc. / www.emsoftware.com From dudley at cs.stanford.edu Thu Apr 15 23:29:37 2004 From: dudley at cs.stanford.edu (Dudley Carr) Date: Thu Apr 15 23:29:37 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: References: <407F0F0A.3050901@cs.stanford.edu> Message-ID: <407F5321.4050401@cs.stanford.edu> Chris Ryland wrote: > This came up on Python-Dev a while back--you could google for it. > > A big discussion ensued, but it fizzled out in the end, IIRC. > > The bottom line is that you'd really have to do your own DNS caching. I > guess some other Unix-like systems do that at the library level. > There's this SourceForge bug report that looks to be still open that explains some of the getaddrinfo slowness: http://sourceforge.net/tracker/index.php?func=detail&aid=774751&group_id=5470&atid=105470 DNS caching would certainly improve subsequent queries for the same domain. However, what I tried to point out with the timings is that I get these rather large spikes (17 seconds) which I don't attribute to general slowness of getaddrinfo on OS X. The example only used yahoo.com. However, when I did twenty different getaddrinfo queries for different domains, I still saw those spikes consistently happening after 10 or so queries. I have to attribute it to my network setup because the two other timings by other people didn't show the large spikes that I am seeing. Regards, Dudley From ajmorris at myrealbox.com Fri Apr 16 07:53:38 2004 From: ajmorris at myrealbox.com (Andrew Morris) Date: Fri Apr 16 07:53:51 2004 Subject: [Pythonmac-SIG] Python, Server Solutions MySQL, and MySQLdb Message-ID: Hi, I'm something of a new python user, and I've been trying to write a set of cgi scripts to enter data into a database running on my computer. Its the MySQL package, as installed by the Server Logistics prepackaged bundle, with python installed off Fink. The MySQL bundle installs into /Library/MySQL. The system is Mac OSX 10.2 (Jaguar, updated to whatever the latest minor update number is) When i try to install mySQLdb, it throws up an error saying 'ld' can't find '-lmysqlclient'. I've searched the web, and tried to interpret the stuff there, which means I've opened up setup.py and tried to fix the include and lib directories to point to '/Library/MySQL/include' and '/Library/MySQL/lib/mysql', which is where the header (.h files are headers right?) files and the .dynlib files live respectively. But it still throws up the same error, that it can't find -lmysqlclient. I've tried to fiddle around with the alias files in there using the ln command, but I can't seem to get that to work properly at all (is the link itself in the arguments first or is the actual file that you're linking to first in the arguments, it doesn't seem to work properly either way, but that's another thing I cant figure out). Any help you could give me would be very useful, otherwise I may have to junk the project, and use another way of accessing the database. Thanks in advance, Andrew From Jack.Jansen at cwi.nl Fri Apr 16 11:04:55 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri Apr 16 11:06:25 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: <407F5321.4050401@cs.stanford.edu> References: <407F0F0A.3050901@cs.stanford.edu> <407F5321.4050401@cs.stanford.edu> Message-ID: <6BC85FF2-8FB7-11D8-9533-000A958D1666@cwi.nl> On 16-apr-04, at 5:29, Dudley Carr wrote: > DNS caching would certainly improve subsequent queries for the same > domain. However, what I tried to point out with the timings is that I > get these rather large spikes (17 seconds) which I don't attribute to > general slowness of getaddrinfo on OS X. The example only used > yahoo.com. However, when I did twenty different getaddrinfo queries > for different domains, I still saw those spikes consistently happening > after 10 or so queries. I have to attribute it to my network setup > because the two other timings by other people didn't show the large > spikes that I am seeing. Is it feasible to put a sniffer on your network and see whether there's funny network traffic going on? -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From mbier at office-m.at Fri Apr 16 15:10:47 2004 From: mbier at office-m.at (Markus Biermaier) Date: Fri Apr 16 15:11:02 2004 Subject: [Pythonmac-SIG] Python, Server Solutions MySQL, and MySQLdb In-Reply-To: Message-ID: Hello Andrew, at first let me say I have a something "patchworked" system - but MySQL and Python works. Perhaps what I tell is not exact, as I had to got Python running last autumn and have forgotten some details. On the other side perhaps my info can help you: My configuration: - Mac OS X 10.1.5. - MySQL 3.23.27-beta I ran into the problem to need "libmysqlclient" and didn't want (or couldn't) change my configuration too much. I extracted libmysqlclient from a 3.23.58 archive: > dir -R .: total 0 drwxr-xr-x 3 markus staff 58 Mar 22 17:28 libmysql drwxr-xr-x 3 markus staff 58 Mar 22 17:28 . drwxrwxrwx 50 markus staff 1656 Mar 23 08:17 .. libmysql: total 0 drwxr-xr-x 8 markus staff 228 Nov 21 21:23 .libs drwxr-xr-x 3 markus staff 58 Mar 22 17:28 .. drwxr-xr-x 3 markus staff 58 Mar 22 17:28 . libmysql/.libs: total 396 -rwxr-xr-x 1 markus staff 133136 Nov 21 21:23 libmysqlclient.10.0.0.dylib -rw-r--r-- 1 markus staff 250304 Nov 21 21:23 libmysqlclient.a -rw-r--r-- 1 markus staff 784 Nov 21 21:23 libmysqlclient.lai lrwxr-xr-x 1 markus staff 20 Nov 21 21:23 libmysqlclient.la -> ../libmysqlclient.la lrwxr-xr-x 1 markus staff 27 Nov 21 21:23 libmysqlclient.dylib -> libmysqlclient.10.0.0.dylib lrwxr-xr-x 1 markus staff 27 Nov 21 21:23 libmysqlclient.10.dylib -> libmysqlclient.10.0.0.dylib drwxr-xr-x 8 markus staff 228 Nov 21 21:23 . drwxr-xr-x 3 markus staff 58 Mar 22 17:28 .. > The links are: /usr/lib/libmysqlclient.10.0.0.dylib /usr/lib/libmysqlclient.10.dylib /usr/lib/libmysqlclient.dylib /usr/local/lib/mysql/libmysqlclient.10.0.0.dylib /usr/local/lib/mysql/libmysqlclient.10.dylib /usr/local/lib/mysql/libmysqlclient.dylib Which show all at last to the extracted file "libmysqlclient.10.0.0.dylib" And I use the MySQL-DB, perl-cgi-scripts and PyQT with MySQL. ... and it works ;-) HTH Markus Am Freitag den, 16. April 2004, um 13:53, schrieb Andrew Morris: > Hi, > > I'm something of a new python user, and I've been trying to write a set > of cgi scripts to enter data into a database running on my computer. > > Its the MySQL package, as installed by the Server Logistics prepackaged > bundle, with python installed off Fink. The MySQL bundle installs into > /Library/MySQL. The system is Mac OSX 10.2 (Jaguar, updated to whatever > the latest minor update number is) > > When i try to install mySQLdb, it throws up an error saying 'ld' can't > find '-lmysqlclient'. I've searched the web, and tried to interpret the > stuff there, which means I've opened up setup.py and tried to fix the > include and lib directories to point to '/Library/MySQL/include' and > '/Library/MySQL/lib/mysql', which is where the header (.h files are > headers right?) files and the .dynlib files live respectively. > > But it still throws up the same error, that it can't find > -lmysqlclient. I've tried to fiddle around with the alias files in > there using the ln command, but I can't seem to get that to work > properly at all (is the link itself in the arguments first or is the > actual file that you're linking to first in the arguments, it doesn't > seem to work properly either way, but that's another thing I cant > figure out). > > Any help you could give me would be very useful, otherwise I may have > to junk the project, and use another way of accessing the database. > > Thanks in advance, > > Andrew > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > ---------------------------------------------------------------------- M. Biermaier Wiesengasse 15 3011 Untertullnerbach E-Mail: mbier AT office-m.at Austria / Europe Web Site: http://www.office-m.at From mbier at office-m.at Fri Apr 16 15:15:26 2004 From: mbier at office-m.at (Markus Biermaier) Date: Fri Apr 16 15:15:32 2004 Subject: [Pythonmac-SIG] Python, Server Solutions MySQL, and MySQLdb In-Reply-To: Message-ID: <6A9866F3-8FDA-11D8-925F-0005029F2DC3@office-m.at> Am Freitag den, 16. April 2004, um 13:53, schrieb Andrew Morris: > But it still throws up the same error, that it can't find > -lmysqlclient. I've tried to fiddle around with the alias files in > there using the ln command, but I can't seem to get that to work > properly at all (is the link itself in the arguments first or is the > actual file that you're linking to first in the arguments, it doesn't > seem to work properly either way, but that's another thing I cant > figure out). > ln -s: The first argument is the real file. You can ommit the second argument, then it gets the same name as the original. e.g. ln -s /foo/bar/whatever/ORIGINAL or ln -s /foo/bar/whatever/ORIGINAL LINK_TO_ORIGINAL HTH Markus ---------------------------------------------------------------------- M. Biermaier Wiesengasse 15 3011 Untertullnerbach E-Mail: mbier AT office-m.at Austria / Europe Web Site: http://www.office-m.at From dudley at cs.stanford.edu Fri Apr 16 22:31:02 2004 From: dudley at cs.stanford.edu (Dudley Carr) Date: Fri Apr 16 22:30:58 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: <6BC85FF2-8FB7-11D8-9533-000A958D1666@cwi.nl> References: <407F0F0A.3050901@cs.stanford.edu> <407F5321.4050401@cs.stanford.edu> <6BC85FF2-8FB7-11D8-9533-000A958D1666@cwi.nl> Message-ID: <408096E6.3010900@cs.stanford.edu> Jack Jansen wrote: > Is it feasible to put a sniffer on your network and see whether there's > funny network traffic going on? Jack, I did the next best thing and turned on Bind on OS X for local DNS caching. This cleared up the problem immediately. It seems that my router is rather unreliable. I hadn't noticed it since my Windows machine seems to do a DNS caching as well. Thanks to everyone for helping me get to the bottom of this problem. Regards, Dudley From kmmcdonald at wisc.edu Sat Apr 17 17:27:28 2004 From: kmmcdonald at wisc.edu (Kenneth McDonald) Date: Sat Apr 17 17:27:33 2004 Subject: [Pythonmac-SIG] Arggh! How to resolve link problems in OS X Message-ID: <06DB6B26-90B6-11D8-B923-000A956870AC@wisc.edu> Over that last week, I've run into a couple of occasions wherein a distutils install attempts to compile some C files against Tk, and fails. Using my very limited amount of link knowledge, it seems that they are not finding the Tk headers and libraries due to the fact that these reside in a Frameworks structure, rather than in the traditional UNIX file structure. Things may also be complicated by the fact that I suspect I have elements of Tk/X11 lying around as well as the AquaTclTk I am actually using with Python. My question is; what is the best way to set things up so that python compilations looking for these (or other) sources actually find them? I could probably just go in and hack away until I got things working this time, but that could get rather messy, and I would no doubt have to repeat it in the future. Do any of the pythonistas out there have favored solutions? Modify path settings? Create links in standard UNIX locations? Modify/update disutils? My preference is for as general a solution as possible, so if yours goes beyond addressing just Python/Tk link/compile problems, that's cool. Thanks, Ken From daniel at brightfire.org Sat Apr 17 22:51:40 2004 From: daniel at brightfire.org (Daniel Lord) Date: Sat Apr 17 22:51:43 2004 Subject: [Pythonmac-SIG] Problem with iCal and appscript Message-ID: <514C7D68-90E3-11D8-8EF5-000A95BADC78@brightfire.org> HAS's appscript is a great achievement and very useful but I have noticed a problem on my system with the demo program from his site: the datetime object is shifted by -12 hours when added to iCal. The demo puts the entry "First pants, then shoes" in the Calendar on the 16th at 1200 rather than on the 17th, (presumably at 0000). I tried a few different configurations of dates and all were shifted by 12 hours I am in PDT (GMT +8) so it isn't a UTC issue, otherwise the shift would be 8 not 12. I do use a 24-hour clock in my preferences and an international time/date setting and thought that may be the problem. But, setting the defaults didn't fix this. The Python datetime library seems to work correctly. This is with iCal 1.5.2. Perhaps something changed from version 1.0 that is interpreting the hour field differently? Anybody have an idea? From berkowit at silcom.com Sun Apr 18 00:38:58 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Sun Apr 18 00:39:04 2004 Subject: [Pythonmac-SIG] Problem with iCal and appscript In-Reply-To: <514C7D68-90E3-11D8-8EF5-000A95BADC78@brightfire.org> Message-ID: On 4/17/04 7:51 PM, "Daniel Lord" wrote: > HAS's appscript is a great achievement and very useful but I have > noticed a problem on my system with the demo program from his site: > > the datetime object is shifted by -12 hours when added to iCal. The > demo puts the entry "First pants, then shoes" in the Calendar on the > 16th at 1200 rather than on the 17th, (presumably at 0000). > I tried a few different configurations of dates and all were shifted by > 12 hours > > I am in PDT (GMT +8) so it isn't a UTC issue, otherwise the shift would > be 8 not 12. I do use a 24-hour clock in my preferences and an > international time/date setting and thought that may be the problem. > But, setting the defaults didn't fix this. The Python datetime library > seems to work correctly. This is with iCal 1.5.2. Perhaps something > changed from version 1.0 that is interpreting the hour field > differently? Anybody have an idea? Yes. I've been applescripting iCal and it's rife with bugs. This one may be related, although it appears not: I _have_ found the AppleScript bugs to be GMT-related. (BTW, PDT is GMT - 7, not GMT + 8; GMT is not British Summer Time. PST is GMT - 8.) First of all, you have to make sure that iCal's preferences are set to Turn On Time Zone support. In AppleScript, the problem arises for events only for All-Day Events when Time Zone support is On. When _setting_ an all day event, you have to set the start time to the time that, when converted to GMT, will be the actual time you want (always 00:00), PLUS a full extra day (!). So, in the summer months in California (PDT), you first figure out you need 5 PM on the day before the real day, then add a day to make it 5 PM on the day you want. However when you read it back (get the start date) the result is 5 PM on the day before, NOT the day of, the real start date you want. For end times, you both set and get the time that, when converted to GMT, will be the actual time you want (no extra day added). So if it's a one-day event, that's 5 PM on the day of the event, in California (instead of 00:00 on the next day). I.e, when setting (making) a new one-day, all-day event, you set both the start time and the end time to the same 5 PM on the day of the event! What a mess. Note that when _getting_ an all day event, the 5 PM -on -preceding-day for each of start time and end time is the result both if the event was made by AppleScript or in the UI. For todos, it's even weirder: when making a new todo by script, you can set the due date to the real time (always 00:00)and when you get it, it's also OK. BUT, if you get the due date of a todo made in the UI, the time returned is NOT the real date, but once again 5 PM on the day before the real day (in California summer). So you have to expect either, check the time and add 7 or 8 hours, or whatever the difference is to GMT _at the time of the todo_, not necessarily the difference from GMT on the day you run the script, IF and only IF the time of the due date is not 00:00. Furthermore you can't use whose filters (I believe has has an equivalent in Python) on due dates - they don't work. I've bugged all of these with Apple. God knows if they'll fix them for a later release. They had a similar bug for birth date in Address Book Jaguar, which I bugged, and they fixed it for Panther. The bug you're reporting doesn't sound the same. I'd be very interested to hear if you also hit these bugs: i.e. are the bugs in the AppleEvents, or just in Apple's AppleScript implementation. I suspect the latter - the iApp devs don't seem to know the first thing about AppleScript. The Cocoa APIs usually work just fine. So likely the AppleEvents do too. But maybe not. -- Paul Berkowitz From Jack.Jansen at cwi.nl Sun Apr 18 11:20:58 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sun Apr 18 11:20:48 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: <408096E6.3010900@cs.stanford.edu> References: <407F0F0A.3050901@cs.stanford.edu> <407F5321.4050401@cs.stanford.edu> <6BC85FF2-8FB7-11D8-9533-000A958D1666@cwi.nl> <408096E6.3010900@cs.stanford.edu> Message-ID: On 17 Apr 2004, at 04:31, Dudley Carr wrote: > Jack Jansen wrote: > > > Is it feasible to put a sniffer on your network and see whether > there's > > funny network traffic going on? > > Jack, > > I did the next best thing and turned on Bind on OS X for local DNS > caching. How do you do this? As this is the second time this problem has come up it would be good to have instructions available for solving the issue the next time someone experiences 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 From dudley at cs.stanford.edu Sun Apr 18 11:50:30 2004 From: dudley at cs.stanford.edu (Dudley Carr) Date: Sun Apr 18 11:50:21 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: References: <407F0F0A.3050901@cs.stanford.edu> <407F5321.4050401@cs.stanford.edu> <6BC85FF2-8FB7-11D8-9533-000A958D1666@cwi.nl> <408096E6.3010900@cs.stanford.edu> Message-ID: <4082A3C6.6020904@cs.stanford.edu> Jack Jansen wrote: > > On 17 Apr 2004, at 04:31, Dudley Carr wrote: > >> Jack Jansen wrote: >> >> > Is it feasible to put a sniffer on your network and see whether there's >> > funny network traffic going on? >> >> Jack, >> >> I did the next best thing and turned on Bind on OS X for local DNS >> caching. > > > How do you do this? As this is the second time this problem has come up > it would be good to have instructions available for solving the issue the > next time someone experiences 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 I followed the direction as outline on this page: http://www.newartisans.com/johnw/MacTips.html#sec2 The instructions are correct except for two small omissions: 1) The page instructs you to execute "rndc-confgen > rndc.conf" in the /etc directory. The rndc.conf file has two sections to it. The second half of the rndc.conf is commented out. The commented out portion at the bottom of the rndc.conf file should be inserted at the top of the named.conf file, and it has to be uncommented. 2) The network connection settings have to be changed so that all DNS queries are sent through the local BIND server. I had to go to System Preferences -> Network and add 127.0.0.1 as the only server in the DNS Servers section. 3) After making the configuration file changes, Bind has to be started or the machine has to be rebooted. Regards, Dudley From brad.allen at omsdal.com Sun Apr 18 13:44:39 2004 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Sun Apr 18 13:45:21 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: <4082A3C6.6020904@cs.stanford.edu> Message-ID: I thought OS X clients had a local DNS cache by default. Whenever we make a change to our internal DNS server at work, it usually takes about 15 minutes before the clients pick up the change. Rebooting the clients usually clears the local DNS cache and allows them to pick up the change. The guys in our network dept have asked me to find out how to flush the local DNS cache without rebooting. They say they have a DOS command to do it under Windows, but I haven't been able to find a way to do it on Mac OS X. However, from the thread I'm reading up here, you guys are implying there is no DNS cache by default, since you are discussing how to turn it on. Sorry if this is a bit off topic, but I'd be very interesting in learning how to understand this better. Thanks! pythonmac-sig-bounces@python.org wrote on 04/18/2004 10:50:30 AM: > Jack Jansen wrote: > > > > On 17 Apr 2004, at 04:31, Dudley Carr wrote: > > > >> Jack Jansen wrote: > >> > >> > Is it feasible to put a sniffer on your network and see whether there's > >> > funny network traffic going on? > >> > >> Jack, > >> > >> I did the next best thing and turned on Bind on OS X for local DNS > >> caching. > > > > > > How do you do this? As this is the second time this problem has come up > > it would be good to have instructions available for solving the issue the > > next time someone experiences 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 > > I followed the direction as outline on this page: > > http://www.newartisans.com/johnw/MacTips.html#sec2 > > The instructions are correct except for two small omissions: > > 1) The page instructs you to execute "rndc-confgen > rndc.conf" in the /etc > directory. The rndc.conf file has two sections to it. The second half of the > rndc.conf is commented out. The commented out portion at the bottom of the > rndc.conf file should be inserted at the top of the named.conf file, > and it has > to be uncommented. > > 2) The network connection settings have to be changed so that all DNS queries > are sent through the local BIND server. I had to go to > > System Preferences -> Network > > and add 127.0.0.1 as the only server in the DNS Servers section. > > 3) After making the configuration file changes, Bind has to be started or the > machine has to be rebooted. > > Regards, > Dudley > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@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/20040418/5762d053/attachment.html From hengist.podd at virgin.net Sun Apr 18 13:54:56 2004 From: hengist.podd at virgin.net (has) Date: Sun Apr 18 13:55:14 2004 Subject: [Pythonmac-SIG] Problem with iCal and appscript In-Reply-To: <514C7D68-90E3-11D8-8EF5-000A95BADC78@brightfire.org> References: <514C7D68-90E3-11D8-8EF5-000A95BADC78@brightfire.org> Message-ID: Daniel Lord wrote: >HAS's appscript is a great achievement and very useful but I have >noticed a problem on my system with the demo program from his site: > > the datetime object is shifted by -12 hours when added to iCal. Apologies, must've been asleep when implementing date packing/unpacking - used the wrong time for the Mac epoch. Fixed now: http://freespace.virgin.net/hamish.sanderson/appscript-0.4.7.tar.gz Thanks, has -- http://freespace.virgin.net/hamish.sanderson/ From berkowit at silcom.com Sun Apr 18 14:00:41 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Sun Apr 18 14:01:09 2004 Subject: [Pythonmac-SIG] Problem with iCal and appscript In-Reply-To: Message-ID: On 4/18/04 10:54 AM, "has" wrote: > Daniel Lord wrote: > >> HAS's appscript is a great achievement and very useful but I have >> noticed a problem on my system with the demo program from his site: >> >> the datetime object is shifted by -12 hours when added to iCal. > > Apologies, must've been asleep when implementing date > packing/unpacking - used the wrong time for the Mac epoch. Fixed now: > > http://freespace.virgin.net/hamish.sanderson/appscript-0.4.7.tar.gz That's good news. It means, as I expected, that all those iCal AppleScript date bugs are purely within iCal's feeble AppleScript implementation, not in the underlying AppleEvents. A great reason, on its own, for using has's appscript in Python rather than iCal AppleScript. -- Paul Berkowitz -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2117 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040418/bf8c844b/smime.bin From berkowit at silcom.com Sun Apr 18 14:12:35 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Sun Apr 18 14:12:39 2004 Subject: [Pythonmac-SIG] Problem with iCal and appscript In-Reply-To: Message-ID: On 4/18/04 11:00 AM, I wrote: > On 4/18/04 10:54 AM, "has" wrote: > >> Apologies, must've been asleep when implementing date >> packing/unpacking - used the wrong time for the Mac epoch. Fixed now: >> >> http://freespace.virgin.net/hamish.sanderson/appscript-0.4.7.tar.gz > > That's good news. It means, as I expected, that all those iCal AppleScript > date bugs are purely within iCal's feeble AppleScript implementation, not > in the underlying AppleEvents. A great reason, on its own, for using has's > appscript in Python rather than iCal AppleScript. Well, maybe someone should check setting and getting start and end dates of allday events, and getting due dates of todos made in the UI, to be sure... -- Paul Berkowitz From dudley at cs.stanford.edu Sun Apr 18 15:20:42 2004 From: dudley at cs.stanford.edu (Dudley Carr) Date: Sun Apr 18 15:20:32 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: References: Message-ID: <4082D50A.9030903@cs.stanford.edu> brad.allen@omsdal.com wrote: > However, from the thread I'm reading up here, you guys are implying > there is no DNS cache by default, since you are discussing how to turn > it on. Sorry if this is a bit off topic, but I'd be very interesting in > learning how to understand this better. Thanks! Brad, First off, I'm new to OS X so I can't say for certain whether or not OS X has built-in DNS caching. The best way to resolve this is to get a copy of ethereal running, and see what's on the network. I'm having some trouble getting ethereal to run, so I'll share my performance numbers with you. def queryTimer(host, numAttempts): timings = [] for i in range(numAttempts): start = time.time() socket.queryaddrinfo(host, 80) end = time.time() timings.append(end - start) return timings # With Bind DNS caching turned off >>> r = queryTimer('yahoo.com', 50) # My network is abnormal so I'm going to eliminate the # occasional query that takes longer than 1 second >>> r = [ timing for timing in r if timing <= 1 ] # The average query time when BIND DNS caching is turned off >>> sum(r) / len(r) 0.1006 # With BIND DNS caching turned *on* >>> x = queryTimer('yahoo.com', 50) # The average query time when BIND DNS caching is turned *on* >>> sum(x) / len(x) 0.0081 To me this is a pretty good sign that there isn't any DNS caching by default. I also took the average query time for the timings submitted by Steven Palm ( 0.024 seconds if you eliminate the very first query ) and Craig Amundsen ( 0.88 seconds ). Steven's timings are the best out of his, and Craig's, and mine. However, my BIND DNS caching timing is 3x better than Steven's timings. Regards, Dudley From paul at donovansbrain.co.uk Sun Apr 18 16:11:17 2004 From: paul at donovansbrain.co.uk (Paul Donovan) Date: Sun Apr 18 16:11:18 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: References: Message-ID: <8D198B79-9174-11D8-AD0D-000393998ACA@donovansbrain.co.uk> Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2377 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040418/abf859a0/smime.bin From n9yty at n9yty.com Sun Apr 18 16:58:52 2004 From: n9yty at n9yty.com (Steven Palm) Date: Sun Apr 18 16:58:55 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: References: Message-ID: <32B39B9A-917B-11D8-8BFA-000A95B1990C@n9yty.com> On Apr 18, 2004, at 12:44 PM, brad.allen@omsdal.com wrote: > I thought OS X clients had a local DNS cache by default. Whenever we > make a change to our internal DNS server at work, it usually takes > about 15 minutes before the clients pick up the change. Rebooting the > clients usually clears the local DNS cache and allows them to pick up > the change. > > The guys in our network dept have asked me to find out how to flush > the local DNS cache without rebooting. They say they have a DOS > command to do it under Windows, but I haven't been able to find a way > to do it on Mac OS X. I thought lookupd cached... You could always try: /usr/sbin/lookupd -flushcache From brad.allen at omsdal.com Sun Apr 18 18:58:56 2004 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Sun Apr 18 19:00:13 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: <8D198B79-9174-11D8-AD0D-000393998ACA@donovansbrain.co.uk> Message-ID: Paul Donovan wrote on 04/18/2004 03:11:17 PM: > AFAIK all name resolution is done via lookupd, which has a man page. > lookupd -flushcache ought to do what you want. Thanks! That was the tip I needed. The lookupd man page has plenty of info on how the caching works for DNS. I don't have a clue on why Duncan's (and others) results show that socket.getaddrinfo behaves as if there is no DNS caching. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20040418/57a319af/attachment-0001.html From daniel at brightfire.org Sun Apr 18 23:43:26 2004 From: daniel at brightfire.org (Daniel Lord) Date: Sun Apr 18 23:43:31 2004 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG Digest, Vol 12, Issue 23 In-Reply-To: References: Message-ID: > On 4/18/04 11:00 AM, I wrote: > >> On 4/18/04 10:54 AM, "has" wrote: >> >>> Apologies, must've been asleep when implementing date >>> packing/unpacking - used the wrong time for the Mac epoch. Fixed now: >>> >>> http://freespace.virgin.net/hamish.sanderson/appscript-0.4.7.tar.gz >> >> That's good news. It means, as I expected, that all those iCal >> AppleScript >> date bugs are purely within iCal's feeble AppleScript implementation, >> not >> in the underlying AppleEvents. A great reason, on its own, for using >> has's >> appscript in Python rather than iCal AppleScript. > > Well, maybe someone should check setting and getting start and end > dates of > allday events, and getting due dates of todos made in the UI, to be > sure... > > > -- > Paul Berkowitz Since I was the one who complained it is only fair I do it. It may take me a few days to get around to it, but I'll check it out and let Paul and HAS and anyone else interested know what I find. I've been distracted with Excel today--trying to use appscript to read and write worksheet cell and ranges...ugh! Not working, but then M$ implementation of AS has always been 'out there' anyway. DL From kmmcdonald at wisc.edu Sun Apr 18 23:40:00 2004 From: kmmcdonald at wisc.edu (Kenneth McDonald) Date: Sun Apr 18 23:49:17 2004 Subject: [Pythonmac-SIG] Questions concerning OS X, Python, Tk, libraries, fink, and maybe some other things too... Message-ID: <3C597213-91B3-11D8-B923-000A956870AC@wisc.edu> The Problem ----------------- OK, sorry for the broad scope of this question, but there are so many things I'm _possibly_ doing wrong that it's hard to narrow it down :-) I am currently trying to get two Python/Tk related things working: 1) matplotlib with TkAgg, see http://matplotlib.sourceforge.net/backends.html, and 2) Fred Lundh's Tkinter3000 After a number of days of frustration, puzzling over gcc books, etc, I have now advanced the installation of each of these packages to the point where they are theoretically installed, and when I try to run either, the following happens: # ...my command invoking matplotlib or Tkinter3000... Fatal Python error: Interpreter not initialized (version mismatch?) Abort Trust me, this is real progress over a few days ago! :-) What I've Tried -------------------- To start off, here is what I've done to try to get things installed: 1) Set up the following environment variables, so that gcc can find libraries and sources it needs: setenv CPATH /Library/Frameworks/Python.framework/Headers:/Library/Frameworks/ Tk.framework/Headers:/Library/Frameworks/Tcl.framework/Headers:/usr/ local/include setenv LD_LIBRARY_PATH /Library/Frameworks/Python.framework:/Library/Frameworks/Tk.framework:/ Library/Frameworks/Tcl.framework:/usr/local/lib setenv LIBRARY_PATH /Library/Frameworks/Python.framework:/Library/Frameworks/Tk.framework:/ Library/Frameworks/Tcl.framework:/usr/local/lib 1a) Copied libtk8.4.a from somewhere (I can't even remember from where) to the Tk Frameworks folder, so it would be on the library path. This was probably a Bad Thing, but I didn't know what else to do, and hey, things finally compiled! (Too bad they didn't work.) 2) Set up a /usr/local directory, and to it, copied a bunch of stuff from /sw/bin (which was installed using fink, and I gotta say, fink having its own special directory structure is a major PITA. Is there a way to get fink to use the standard UNIX structure?) 3) Installed a couple of other things (notably freetype2) manually. Doing the above allowed compilation and installation to complete, but as the Fatal Python error indicates, things are not quite working... Status of my System ---------------------------- Currently, I have python and Tkinter using AquaTclTk installed and running on my system. By doing 'which python', following links, etc., I believe that my one and only python is the one in the Frameworks directory. (Well, there is another in a Jython directory, but I don't believe that is interfering with anything.) I'm running the most recent OS X 10.3 Questions -------------- Aside from the obvious (how do I get it working!?), I was wondering if people would give suggestions on the following: 1) Is Fink worth using? So far, I've found that its use of a nonstandard directory structure causes more harm than good. Any suggestions for making things less painful? 2) How should I organize my libraries? Should I maintain copies in both a UNIX-style directory structure and (where applicable) in a Frameworks structure, should I hand-configure the appropriate paths to include relevant Frameworks directories, should I create links, what? 3) What the heck is a .dylib and how does it differ from a .so, _or_, should I care? 4) If I'm trying to compile things that rely on Tk, does the fact that I'm using AquaTk mean I have to take special steps? (Things like BLT obviously cause problems, but my understanding is that BLT uses some X11-specific calls that haven't yet been implemented in whatever the smart AquaTclTk people are doing.) Many thanks for any words of wisdom. I feel like I'm tantalizingly close to getting this working, and only a few more months of effort should have it! :-) Thanks, Ken McDonald From bob at redivi.com Mon Apr 19 00:13:02 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Apr 19 00:08:44 2004 Subject: [Pythonmac-SIG] Questions concerning OS X, Python, Tk, libraries, fink, and maybe some other things too... In-Reply-To: <3C597213-91B3-11D8-B923-000A956870AC@wisc.edu> References: <3C597213-91B3-11D8-B923-000A956870AC@wisc.edu> Message-ID: On Apr 18, 2004, at 11:40 PM, Kenneth McDonald wrote: > The Problem > ----------------- > > OK, sorry for the broad scope of this question, but there are so many > things > I'm _possibly_ doing wrong that it's hard to narrow it down :-) > > I am currently trying to get two Python/Tk related things working: > > 1) matplotlib with TkAgg, see > http://matplotlib.sourceforge.net/backends.html, and > 2) Fred Lundh's Tkinter3000 > > After a number of days of frustration, puzzling over gcc books, etc, I > have > now advanced the installation of each of these packages to the point > where > they are theoretically installed, and when I try to run either, the > following happens: > > # ...my command invoking matplotlib or Tkinter3000... > > Fatal Python error: Interpreter not initialized (version mismatch?) > Abort > > Trust me, this is real progress over a few days ago! :-) See http://www.pythonmac.org/wiki/FAQ, you have a non-System framework python installed, and it needs to go. > > What I've Tried > -------------------- > > To start off, here is what I've done to try to get things installed: > > 1) Set up the following environment variables, so that gcc > can find libraries and sources it needs: > > setenv CPATH > /Library/Frameworks/Python.framework/Headers:/Library/Frameworks/ > Tk.framework/Headers:/Library/Frameworks/Tcl.framework/Headers:/usr/ > local/include > setenv LD_LIBRARY_PATH > /Library/Frameworks/Python.framework:/Library/Frameworks/Tk.framework: > /Library/Frameworks/Tcl.framework:/usr/local/lib > setenv LIBRARY_PATH > /Library/Frameworks/Python.framework:/Library/Frameworks/Tk.framework: > /Library/Frameworks/Tcl.framework:/usr/local/lib > > 1a) Copied libtk8.4.a from somewhere (I can't even remember > from where) to the Tk Frameworks folder, so it would be on the > library path. This was probably a Bad Thing, but I didn't know > what else to do, and hey, things finally compiled! (Too bad they > didn't work.) > > 2) Set up a /usr/local directory, and to it, copied a bunch of stuff > from /sw/bin (which was installed using fink, and I gotta say, > fink having its own special directory structure is a major PITA. > Is there a way to get fink to use the standard UNIX structure?) > > 3) Installed a couple of other things (notably freetype2) manually. > > Doing the above allowed compilation and installation to complete, > but as the Fatal Python error indicates, things are not quite > working... > > > Status of my System > ---------------------------- > > Currently, I have python and Tkinter using AquaTclTk installed and > running on my system. By doing 'which python', following links, > etc., I believe that my one and only python is the one in the > Frameworks directory. (Well, there is another in a Jython directory, > but I don't believe that is interfering with anything.) I'm running > the most recent OS X 10.3 You have more than one Python 2.3 installed, or else you would not get a version mismatch. > Questions > -------------- > > Aside from the obvious (how do I get it working!?), I was wondering > if people would give suggestions on the following: > > 1) Is Fink worth using? So far, I've found that its use of a > nonstandard > directory structure causes more harm than good. Any suggestions > for making things less painful? I don't like using it because it installs more junk than I actually want, puts itself first in the path, and makes it difficult to distribute self-contained software (because inevitably anything you build will link against something in /sw/lib). I've heard good things about darwinports, but I have no experience with it.. I generally port the software myself if it doesn't already compile+install properly. > 2) How should I organize my libraries? Should I maintain copies in > both a UNIX-style directory structure and (where applicable) in > a Frameworks structure, should I hand-configure the appropriate > paths to include relevant Frameworks directories, should I create > links, what? It depends... I personally use frameworks whenever possible and hack the build scripts or my environment to support them if necessary. > 3) What the heck is a .dylib and how does it differ from a .so, _or_, > should I care? It's a LOT different. I have a truly marvelous explanation of the differences, which however the margin is not large enough to contain :) If you're particularly interested, here's some pointers: man dyld man ld read the Mach-O runtime architecture documentation > 4) If I'm trying to compile things that rely on Tk, does the fact that > I'm using AquaTk mean I have to take special steps? (Things like > BLT obviously cause problems, but my understanding is that BLT > uses some X11-specific calls that haven't yet been implemented > in whatever the smart AquaTclTk people are doing.) I tried compiling something against TclTkAqua once or twice and failed. I wouldn't wish it on my worst enemies. I have significant experience with the idiosyncrasies of porting *NIX software to OS X, and I know the ins and outs of Mach-O, so if I didn't get it in an hour or two then the situation is pretty bleak. -bob From lsloan-000002 at umich.edu Mon Apr 19 15:56:01 2004 From: lsloan-000002 at umich.edu (Lance E Sloan) Date: Mon Apr 19 15:56:10 2004 Subject: [Pythonmac-SIG] libpython2.3.a? Message-ID: <2147483647.1082390161@blue-four.us.itd.umich.edu> I'm using a Mac OS X 10.3.3 machine with the Apple-supplied Python 2.3 and the MacPython additions for Panther that are dated November 2003. I'm trying to build mod_python 2.7.10. I am hoping that I can build and run it with the Apple-supplied versions of Python and Apache. After I ran mod_python's configure script, then ran make, I got this error: cc: /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/conf ig/libpython2.3.a: No such file or directory I've looked around my system and sure enough, I could not find that library in any directory. Is there a way to get that library without building Python from source? -- Lance E Sloan, Systems Research Programmer III U-M WATS: Web Applications, Technologies, and Solutions Full-service web and database design, development, and hosting. http://www.itcs.umich.edu/wats/ - "Putting U on the Web" From nbastin at opnet.com Mon Apr 19 16:05:05 2004 From: nbastin at opnet.com (Nick Bastin) Date: Mon Apr 19 16:05:33 2004 Subject: [Pythonmac-SIG] libpython2.3.a? In-Reply-To: <2147483647.1082390161@blue-four.us.itd.umich.edu> References: <2147483647.1082390161@blue-four.us.itd.umich.edu> Message-ID: On Apr 19, 2004, at 3:56 PM, Lance E Sloan wrote: > I'm using a Mac OS X 10.3.3 machine with the Apple-supplied Python 2.3 > and the MacPython additions for Panther that are dated November 2003. > I'm trying to build mod_python 2.7.10. I am hoping that I can build > and run it with the Apple-supplied versions of Python and Apache. > > After I ran mod_python's configure script, then ran make, I got this > error: > > cc: > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/conf > ig/libpython2.3.a: No such file or directory > > I've looked around my system and sure enough, I could not find that > library in any directory. Is there a way to get that library without > building Python from source? I don't use mod_python on my mac, but surely there must be some way to get it to dynamically link? -- Nick From bob at redivi.com Mon Apr 19 16:11:18 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Apr 19 16:07:03 2004 Subject: [Pythonmac-SIG] libpython2.3.a? In-Reply-To: <2147483647.1082390161@blue-four.us.itd.umich.edu> References: <2147483647.1082390161@blue-four.us.itd.umich.edu> Message-ID: On Apr 19, 2004, at 3:56 PM, Lance E Sloan wrote: > I'm using a Mac OS X 10.3.3 machine with the Apple-supplied Python 2.3 > and the MacPython additions for Panther that are dated November 2003. > I'm trying to build mod_python 2.7.10. I am hoping that I can build > and run it with the Apple-supplied versions of Python and Apache. > > After I ran mod_python's configure script, then ran make, I got this > error: > > cc: > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/conf > ig/libpython2.3.a: No such file or directory > > I've looked around my system and sure enough, I could not find that > library in any directory. Is there a way to get that library without > building Python from source? Nope! mod_python for Apache 1.3.x isn't compatible with a multithreaded Python even if you could get it to compile+link. You really ought to be upgrading to Apache 2.x and the latest mod_python, which is (in theory) compatible with the Apple-supplied 2.3.0, but who knows if the build process is smart enough to use distutils instead of hardcoding the wrong compile/link options :) -bob From Jack.Jansen at cwi.nl Mon Apr 19 16:19:26 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon Apr 19 16:19:28 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: References: Message-ID: That lookupd manpage sure is interesting, and it really makes you wonder why some people see these funny timings in Python... What I'm now wondering is: could it be that somehow Python bypasses lookupd, maybe because of the way it calls getaddrinfo or something like that? And then the next question is: can we come up with an experiment to test this theory? For instance, if you add a hostname entry to the NetInfo database, would it show up if getaddrinfo somehow bypasses lookupd? I did the experiment myself (but then, I don't have the problem), and I did notice that items that come from flat files or NetInfo take only 0.001 second on average, while items that come from DNS take about 25 times longer (0.025 seconds +/- 0.005 seconds). -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From eric.nieuwland at xs4all.nl Mon Apr 19 16:26:43 2004 From: eric.nieuwland at xs4all.nl (Eric Nieuwland) Date: Mon Apr 19 16:26:54 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: References: Message-ID: Jack and all, Doesn't this imply that the Mac version of some socket methods would better use lookupd? --eric On 19-apr-04, at 22:19, Jack Jansen wrote: > That lookupd manpage sure is interesting, and it really makes you > wonder why some people see these funny timings in Python... > > What I'm now wondering is: could it be that somehow Python bypasses > lookupd, maybe because of the way it calls getaddrinfo or something > like that? > And then the next question is: can we come up with an experiment to > test this theory? For instance, if you add a hostname entry to the > NetInfo database, would it show up if getaddrinfo somehow bypasses > lookupd? > > I did the experiment myself (but then, I don't have the problem), and > I did notice that items that come from flat files or NetInfo take only > 0.001 second on average, while items that come from DNS take about 25 > times longer (0.025 seconds +/- 0.005 seconds). > -- > Jack Jansen, , http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma > Goldman > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From Jack.Jansen at cwi.nl Tue Apr 20 04:26:10 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Apr 20 04:27:16 2004 Subject: [Pythonmac-SIG] libpython2.3.a? In-Reply-To: References: <2147483647.1082390161@blue-four.us.itd.umich.edu> Message-ID: <60E09B28-92A4-11D8-984D-000A958D1666@cwi.nl> On 19-apr-04, at 22:11, Bob Ippolito wrote: > You really ought to be upgrading to Apache 2.x and the latest > mod_python, which is (in theory) compatible with the Apple-supplied > 2.3.0, but who knows if the build process is smart enough to use > distutils instead of hardcoding the wrong compile/link options :) Even if it has the wrong hardcoded compile/link options: if you try it and report back here with what the problems are we should be able to help you with the correct way to link 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 From Jack.Jansen at cwi.nl Tue Apr 20 04:49:54 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Apr 20 04:51:55 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: References: Message-ID: On 19-apr-04, at 22:26, Eric Nieuwland wrote: > Jack and all, > > Doesn't this imply that the Mac version of some socket methods would > better use lookupd? This is easy to test. I did the test, but with gethostbyname(), not getaddrinfo(). I started a Python loop that did gethostbyname() and printed how much time it took. Then in another window I did "sudo killall -HUP lookupd". Interestingly enough, this was not noticeable in the timing. This probably means that that watchdog that restarts lookupd when it crashes reacts pretty fast. So next I did "sudo killall -STOP lookupd", and indeed: the loop immediately stopped running. So did the rest of the machine, a few seconds later: apparently calls using lookupd are all over the place (probably log messages and such too). -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From mwh at python.net Tue Apr 20 07:23:22 2004 From: mwh at python.net (Michael Hudson) Date: Tue Apr 20 07:23:25 2004 Subject: [Pythonmac-SIG] socket.getaddrinfo problems In-Reply-To: (Jack Jansen's message of "Mon, 19 Apr 2004 22:19:26 +0200") References: Message-ID: <2misfuyjth.fsf@starship.python.net> Jack Jansen writes: > That lookupd manpage sure is interesting, and it really makes you > wonder why some people see these funny timings in Python... > > What I'm now wondering is: could it be that somehow Python bypasses > lookupd, maybe because of the way it calls getaddrinfo or something > like that? Um. I may just be adding to the considerable pile of confusion here, but if this is the same as the 'calling bind() in a loop is really slow' problem, then, no, python isn't bypassing lookupd (on Jaguar, at least), as you can tell by watching the output of 'top -u' while you're doing it. Cheers, mwh -- 42. You can measure a programmer's perspective by noting his attitude on the continuing vitality of FORTRAN. -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html From joanca at casasin.com Tue Apr 20 12:53:49 2004 From: joanca at casasin.com (Joancarles Casasin) Date: Tue Apr 20 12:53:56 2004 Subject: [Pythonmac-SIG] NibClassBuilder.py permission problem Message-ID: Hi everybody, I suppose this question should go to the PyObjC list but I think it's too silly and basic that will be really easy to all of you. I'm trying to understand PyObjC-Cocoa stuff to leave W (sounds something to do) for doing very simple stuff. I'm not a hardcoder nor a Unix user, so, be comprehensive ;) When following the tutorials from Apple (Cocoa) and moving to the basics of PyObjC, I try to create the "CurrencyConverter" skeleton as suggested, executing in the command line: joancarl% /Library/Python/2.3/PyObjC/PyObjCTools/NibClassBuilder.py MainMenu.nib > CurrencyConverter.py But I get this: tcsh: /Library/Python/2.3/PyObjC/PyObjCTools/: Permission denied. Any idea? I've checked the file and my user can write and read this file (NibClassBuilder.py) Many thanks, Joancarles From bob at redivi.com Tue Apr 20 13:04:42 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Apr 20 13:00:36 2004 Subject: [Pythonmac-SIG] NibClassBuilder.py permission problem In-Reply-To: References: Message-ID: On Apr 20, 2004, at 12:53 PM, Joancarles Casasin wrote: > I suppose this question should go to the PyObjC list but I think it's > too > silly and basic that will be really easy to all of you. > > I'm trying to understand PyObjC-Cocoa stuff to leave W (sounds > something to > do) for doing very simple stuff. I'm not a hardcoder nor a Unix user, > so, > be comprehensive ;) > > When following the tutorials from Apple (Cocoa) and moving to the > basics of > PyObjC, I try to create the "CurrencyConverter" skeleton as suggested, > executing in the command line: > joancarl% /Library/Python/2.3/PyObjC/PyObjCTools/NibClassBuilder.py > MainMenu.nib > CurrencyConverter.py > > But I get this: > tcsh: /Library/Python/2.3/PyObjC/PyObjCTools/: Permission denied. > > Any idea? > I've checked the file and my user can write and read this file > (NibClassBuilder.py) It's probably not marked as executable... try doing this first: chmod +x /Library/Python/2.3/PyObjC/PyObjCTools/NibClassBuilder.py or do this instead: % python /Library/Python/2.3/PyObjC/PyObjCTools/NibClassBuilder.py MainMenu.nib > CurrencyConverter.py From daniel at brightfire.org Tue Apr 20 15:19:08 2004 From: daniel at brightfire.org (Daniel Lord) Date: Tue Apr 20 15:19:18 2004 Subject: [Pythonmac-SIG] Appscript and Excel In-Reply-To: References: Message-ID: <98E62C70-92FF-11D8-A2B2-000A95ACE052@brightfire.org> I used to have a Python script that read a spreadsheet for stock symbols, queried yahoo for the current price for each, and then updated the spreadsheet. I accomplished it with embedded text applescripts which was painful and slow and difficult to develop and debug. I had in mind to re-write it to use appscript but I am stuck on an effective method for writing into the spreadsheet. I can get workbook and worksheets names and I can access, via "Get()", ranges and cells in the open workbook. But I cannot figure out how to write into a spreadsheet everything fails: # this is the Applescript tell application "Microsoft Excel" set Formula of Range "R1C1" of Worksheet 1 of Workbook 1 to "Test_From_AS" end tell # Simple enough and it works flawlessy in Script Editor? # And here is a Python using appscript that I think is equivalent from appscript import * ws = app('Microsoft Excel').Workbooks[1].Worksheets[1] print "Read..." print ws.Range['R1C1'].Value.Get() print "Write..." ws.Range['R1C1'].Formula.Set('Test_From_Python_Appscript',) THE RESULT: Read... 1.0 Write... Traceback (most recent call last): File "simplerw.py", line 6, in ? ws.Range['R1C1'].Formula.Set('Test_From_Python_Appscript',) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/appscript/Specifiers.py", line 170, in __call__ return AEM.sendEvent(self.__name, directArgs, labelledArgs, self.__ref) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/appscript/AEM.py", line 273, in sendEvent raise Errors.AEReplyError(eMsg, eNum) # TO DO: rename Errors.AppError appscript.Errors.AEReplyError: Error: -1708 Generic error message: 'the AppleEvent was not handled by any handler' Failed command: app(u'/Applications/Microsoft Office X/Microsoft Excel').Workbooks[1].Worksheets[1].Range['R1C1'].Formula.Set('Test_From_ Python_Appscript',) -1708 # It must be something obvious that I just don't "get" about the syntatx, right? Or is Excel that uncooperative? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2750 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040420/1195845e/attachment.bin From lsloan at umich.edu Tue Apr 20 15:22:21 2004 From: lsloan at umich.edu (Lance E Sloan) Date: Tue Apr 20 15:22:40 2004 Subject: [Pythonmac-SIG] libpython2.3.a? In-Reply-To: <60E09B28-92A4-11D8-984D-000A958D1666@cwi.nl> References: <2147483647.1082390161@blue-four.us.itd.umich.edu> <60E09B28-92A4-11D8-984D-000A958D1666@cwi.nl> Message-ID: <2147483647.1082474541@blue-four.us.itd.umich.edu> --On Tuesday, April 20, 2004 10:26 AM +0200 Jack Jansen wrote: > On 19-apr-04, at 22:11, Bob Ippolito wrote: >> You really ought to be upgrading to Apache 2.x and the latest >> mod_python, which is (in theory) compatible with the Apple-supplied >> 2.3.0, but who knows if the build process is smart enough to use >> distutils instead of hardcoding the wrong compile/link options :) > > Even if it has the wrong hardcoded compile/link options: if you try it > and report back here with what the problems are we should be able to help > you with the correct way to link it. FYI: I got mod_python 2.7.10 to compile with the stock Python and Apache that comes with Mac OS X 10.3.3. But it doesn't *run*! :( A while after I sent my question to pythonmac-sig, I ran across something on the Web that reminded me that /System/Library/Frameworks/Python.framework/Python *is* libpython2.3.a. Basically. So I went to ...lib/python2.3/config and made a symlink to it with that name. After that, mod_python compiled without complaint and installed. When I ran it, though, following the examples in the mod_python docs, it would crash: Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000004 Thread 0 Crashed: 0 org.python.Python.framework 0x95f6d878 PyDict_GetItem + 0x28 1 org.python.Python.framework 0x95f70598 PyDict_GetItemString + 0x34 2 mod_python.so 0x002946e0 get_interpreter_data + 0x58 3 mod_python.so 0x00296b80 python_finalize + 0x28 4 httpd 0x00011bb0 run_cleanups + 0x28 If you're interested in the full CrashReporter log, let me know and I'll send it along. I'm going to try again with the latest version of Apache. I've used Fink for the first time to install a new Apache and running it's running now. I'll try to build mod_python for it soon. -- Lance E Sloan, Systems Research Programmer III U-M WATS: Web Applications, Technologies, and Solutions Full-service web and database design, development, and hosting. http://www.itcs.umich.edu/wats/ - "Putting U on the Web" From bob at redivi.com Tue Apr 20 15:32:33 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Apr 20 15:28:17 2004 Subject: [Pythonmac-SIG] libpython2.3.a? In-Reply-To: <2147483647.1082474541@blue-four.us.itd.umich.edu> References: <2147483647.1082390161@blue-four.us.itd.umich.edu> <60E09B28-92A4-11D8-984D-000A958D1666@cwi.nl> <2147483647.1082474541@blue-four.us.itd.umich.edu> Message-ID: <787B9222-9301-11D8-90CB-000A95686CD8@redivi.com> On Apr 20, 2004, at 3:22 PM, Lance E Sloan wrote: > --On Tuesday, April 20, 2004 10:26 AM +0200 Jack Jansen > wrote: >> On 19-apr-04, at 22:11, Bob Ippolito wrote: >>> You really ought to be upgrading to Apache 2.x and the latest >>> mod_python, which is (in theory) compatible with the Apple-supplied >>> 2.3.0, but who knows if the build process is smart enough to use >>> distutils instead of hardcoding the wrong compile/link options :) >> >> Even if it has the wrong hardcoded compile/link options: if you try it >> and report back here with what the problems are we should be able to >> help >> you with the correct way to link it. > > FYI: I got mod_python 2.7.10 to compile with the stock Python and > Apache that comes with Mac OS X 10.3.3. But it doesn't *run*! :( Just like I said: Nope! mod_python for Apache 1.3.x isn't compatible with a multithreaded Python even if you could get it to compile+link. The stock Python is multithreaded.. -bob From joanca at casasin.com Wed Apr 21 04:24:56 2004 From: joanca at casasin.com (Joancarles Casasin) Date: Wed Apr 21 04:25:08 2004 Subject: [Pythonmac-SIG] bundlebuilder.py, where are you? Message-ID: Hi you all, I'm following the "Creating your first PyObjC application" tutorial and each step I have some problem :( Now, I've to create the application framework with bundlebuilder.py (step 6) but I can't find this script. Well, in fact I did it in "MacPython-OS9 2.3/Lib/plat-mac/" but I suppose this is not the one I should use. I have Apple's Python 2.3 with MacPython Panther add-ons installed (at least, that's what I think). Thanks for your patience and help, Joancarles From Jack.Jansen at cwi.nl Wed Apr 21 09:00:35 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Wed Apr 21 09:01:52 2004 Subject: [Pythonmac-SIG] bundlebuilder.py, where are you? In-Reply-To: References: Message-ID: On 21-apr-04, at 10:24, Joancarles Casasin wrote: > Hi you all, > > I'm following the "Creating your first PyObjC application" tutorial and > each step I have some problem :( > Now, I've to create the application framework with bundlebuilder.py > (step > 6) but I can't find this script. Well, in fact I did it in > "MacPython-OS9 > 2.3/Lib/plat-mac/" but I suppose this is not the one I should use. > I have Apple's Python 2.3 with MacPython Panther add-ons installed (at > least, that's what I think). /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/bundlebuilder.py I'll re-read the tutorial to make sure that this (and the NibClassBuilder issue) are clarified for a next release, if that hasn't been done already. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From hengist.podd at virgin.net Wed Apr 21 07:33:18 2004 From: hengist.podd at virgin.net (has) Date: Wed Apr 21 09:33:52 2004 Subject: [Pythonmac-SIG] Appscript and Excel Message-ID: Daniel Lord wrote: >from appscript import * >ws = app('Microsoft Excel').Workbooks[1].Worksheets[1] >ws.Range['R1C1'].Formula.Set('Test_From_Python_Appscript',) > >THE RESULT: > > Error: -1708 > Generic error message: 'the AppleEvent was not handled by >any handler' Welcome to the brain-damage that is Excel scripting. The problem here is that Excel's 'Set' command (?event XCELsetd?) is different to the core 'set' command (?event coresetd?) that your AppleScript is using. (Turn on AEDebug and friends in the shell to see.) I doubt there's any good reason why Excel should define a non-standard 'Set' command in the first place, and it seems particularly stupid to do so and then not bother to install an Apple event handler to handle it. The best solution would be to fix Excel's aete resource. Start by filing a bug report on it, though I'm also assuming you don't want to wait till MS get around to releasing a formal patch. If you're feeling brave, you could hack the app directly with a ResEdit-style tool. Alternatively, there's an as-yet undocumented system for working around aete problems by exporting and compiling aete data into a Python module where it can be hacked manually. This module can then be imported into your script and passed to appscript via the app() function's 'terms' argument: from appscript import * from customterminology import Excel_10_1_0 excel = app('Microsoft Excel', terms=Excel_10_1_0.appTerminology) formulaRef = excel.Workbooks[1].Worksheets[1].Range['R1C1'].Formula print formulaRef.get() formulaRef.set('Test_From_Python_Appscript') I'm still trying to decide on the best formal policy for dealing with buggy aetes (appscript is much less forgiving of bad aetes than AppleScript), and while this particular system works I really don't like it much - it's complicated, clumsy, and hard for users to follow, why I've not been quick to publicise it or release the full resources to use it. However, I'm going to write it up for the 0.5.0 release which should be out in another week or so, with the proviso that it's being made public purely for discussion purposes and is subject to change or removal at any time. HTH has -- http://freespace.virgin.net/hamish.sanderson/ From Jack.Jansen at cwi.nl Wed Apr 21 10:23:54 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Wed Apr 21 10:25:14 2004 Subject: [Pythonmac-SIG] Appscript and Excel In-Reply-To: References: Message-ID: <84ACC6AC-939F-11D8-B4EC-000A958D1666@cwi.nl> On 21-apr-04, at 13:33, has wrote: > The problem here is that Excel's 'Set' command (?event XCELsetd?) is > different to the core 'set' command (?event coresetd?) that your > AppleScript is using. (Turn on AEDebug and friends in the shell to > see.) [...] > (appscript is much less forgiving of bad aetes than > AppleScript) When I read this the question struck me: how come AppleScript can handle this case just fine? It doesn't have any more info to work from than appscript (or does it?) but somehow it does manage to convince Excel to set the cell, if I understand the original poster correctly. And couldn't a similar method to what AppleScript does be applied to Appscripting? -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From bob at redivi.com Wed Apr 21 10:37:13 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed Apr 21 10:32:58 2004 Subject: [Pythonmac-SIG] Appscript and Excel In-Reply-To: <84ACC6AC-939F-11D8-B4EC-000A958D1666@cwi.nl> References: <84ACC6AC-939F-11D8-B4EC-000A958D1666@cwi.nl> Message-ID: <6150F1CE-93A1-11D8-90CB-000A95686CD8@redivi.com> On Apr 21, 2004, at 10:23 AM, Jack Jansen wrote: > > On 21-apr-04, at 13:33, has wrote: >> The problem here is that Excel's 'Set' command (?event XCELsetd?) is >> different to the core 'set' command (?event coresetd?) that your >> AppleScript is using. (Turn on AEDebug and friends in the shell to >> see.) > [...] >> (appscript is much less forgiving of bad aetes than >> AppleScript) > > When I read this the question struck me: how come AppleScript can > handle this case just fine? It doesn't have any more info to work from > than appscript (or does it?) but somehow it does manage to convince > Excel to set the cell, if I understand the original poster correctly. > > And couldn't a similar method to what AppleScript does be applied to > Appscripting? I think that AppleScript does a "dict.update" when it comes to new terminology. If you want to override something you have to use chevron syntax with the codes. IMHO, the correct way to handle this from Python, is to diverge from AppleScript and use namespaces.. Yes, it will make it harder for people to translate AppleScript to Python, however, that shouldn't be done by humans anyway. What we should be doing is compiling the AppleScript and translating that it into equivalent Python code. Or, just parse the "debugged" apple events and use that. -bob From berkowit at silcom.com Wed Apr 21 10:51:03 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Wed Apr 21 10:52:06 2004 Subject: [Pythonmac-SIG] Appscript and Excel In-Reply-To: Message-ID: On 4/21/04 4:33 AM, "has" wrote: > from appscript import * > from customterminology import Excel_10_1_0 > excel = app('Microsoft Excel', terms=Excel_10_1_0.appTerminology) Just out of interest, why/how does the version-with-underscores squeeze in here? This is how you've defined it? Will it work only for Microsoft Excel 10.1.0, or can it be used for other versions too if one's willing to try it? (And why haven't you done the free updates to 10.1.5?) I may be wrong, but I don't think there were any changes to the Excel aete between 10.0.0 and the latest 10.1.5. In fact, I'd be quite surprised to hear of any changes even in 10.0.0 from 9.0.0 or 8.0.0 (Excel 2001 and 98) - although there may have been a very few. The application name of many applications, such as "Microsoft Excel", has been kept the same from version to version precisely so that AppleScript will go on working from version to version without needing to be re-compiled, barring a total overhaul of the aete. Have you made a decision, has, to avoid all possible ambiguities by requiring the version to be included in the app's name, or was this just a convenience here, to be safe? In other words, if someone is using v10.1.5 or 10.0.0 and knows that the aete is the same as 10.1.0, can they - as it would appear - use your Excel_10_1_0 library at their own risk? It looks like it, but I'm just checking. -- Paul Berkowitz -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2117 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040421/51d0ff95/smime.bin From lsloan at umich.edu Wed Apr 21 11:33:25 2004 From: lsloan at umich.edu (Lance E Sloan) Date: Wed Apr 21 11:33:32 2004 Subject: [Pythonmac-SIG] mod_python works (was: Re: libpython2.3.a?) In-Reply-To: <787B9222-9301-11D8-90CB-000A95686CD8@redivi.com> References: <2147483647.1082390161@blue-four.us.itd.umich.edu> <60E09B28-92A4-11D8-984D-000A958D1666@cwi.nl> <2147483647.1082474541@blue-four.us.itd.umich.edu> <787B9222-9301-11D8-90CB-000A95686CD8@redivi.com> Message-ID: <2147483647.1082547204@[192.168.2.201]> --On Tuesday, April 20, 2004 3:32 PM -0400 Bob Ippolito wrote: > Just like I said: > Nope! mod_python for Apache 1.3.x isn't compatible with a multithreaded > Python even if you could get it to compile+link. And it's not that I doubted you, but I just wanted to see for myself. I was in the neighborhood (mod_python was built), so I couldn't think of any reason not to try. Besides, if I understood Jack's question, he wanted to know what would happen anyway. So yesterday I used Fink (for the first time) to install apache2, apache2-dev, and a couple other apache2-* packages. I got Apache 2 running on a different port and it didn't interfere with the Apache 1 supplied by Apple. I had some trouble getting mod_python 3.1.3 to build at first, though. My computer didn't have apr-config. I found that Fink had an apr package I needed, then I was on my way. mod_python compiled fine and works. Now I just have to learn a bit about how to configure it for my needs. -- Lance E Sloan, Systems Research Programmer III U-M WATS: Web Applications, Technologies, and Solutions Full-service web and database design, development, and hosting. http://www.itcs.umich.edu/wats/ - "Putting U on the Web" From hengist.podd at virgin.net Wed Apr 21 13:24:19 2004 From: hengist.podd at virgin.net (has) Date: Wed Apr 21 13:52:37 2004 Subject: [Pythonmac-SIG] Appscript and Excel In-Reply-To: <84ACC6AC-939F-11D8-B4EC-000A958D1666@cwi.nl> References: <84ACC6AC-939F-11D8-B4EC-000A958D1666@cwi.nl> Message-ID: Jack Jansen wrote: >>The problem here is that Excel's 'Set' command (?event XCELsetd?) is >>different to the core 'set' command (?event coresetd?) that your >>AppleScript is using. (Turn on AEDebug and friends in the shell to >>see.) >[...] >> (appscript is much less forgiving of bad aetes than >>AppleScript) > >When I read this the question struck me: how come AppleScript can >handle this case just fine? Short answer: AppleScript can sometimes mask buggy terminology, but appscript never does. Longer version: AppleScript defines its own versions of the core 'get' and 'set' commands. The AppleScript compiler is mostly case-insensitive, so even if you write 'Get' and 'Set...To' (XCEL) in your source code they'll end up being converted to 'get' and 'set...to' (core) when the script is compiled. The Python compiler is always case-sensitive, however, so 'Get' and 'Set' will always be interpreted differently to 'get' and 'set'. Also, while appscript also defines default 'get' and 'set' commands, it only includes then if the app's aete doesn't already provide them. Currently it ignores the suite code when checking for this, hence it defers to the Excel Suite definitions. (I could have it check suite code as well, but I'm not sure this would be the right thing to do. The lack of official guidelines from Apple means I'm having to wing it in places, and this is one of them.) >And couldn't a similar method to what AppleScript does be applied to >Appscripting? Sure. But the whole reason I switched to Python and created appscript was to get away from AppleScript's numerous design and policy flaws in the first place. And I've no intention of bodging things now; I've enough to do tightening my code and beating out my own bugs to be covering up for other developers' stupidity as well. (Yes, I'm aware of the "be liberal in what you accept" argument, but don't believe it was ever intended to include covering up for incompetence and corruption at your own expense. And if it was then whoever coined it was themselves a fool.) Now I do realise these sorts of problems can reflect badly on appscript from the punter's point of view - "It worked on AppleScript, so appscript must be broken" - but the solution to that is educating users that the fault lies with the application developer, and that the proper solution is to file a bug report with that developer. Don't forget that terminology bugs are just one of many classes of problems currently afflicting Mac IAC. Appscript is designed to eliminate some of these and to expose others which, in the long term, means that MacPython will actually be superior to AppleScript for Mac IAC. And while some short-term discomfort is inevitable, with any luck it'll give users the kick in the pants they need to go hassle application developers to fix these bugs for good. Anyway, we can discuss appscript policy further once 0.5.0 is out. Just wanted you to know I am aware of these issues and have spent a fair bit of time on them already. Hey, nothing worth doing is ever easy...;) HTH has -- http://freespace.virgin.net/hamish.sanderson/ From hengist.podd at virgin.net Wed Apr 21 13:53:04 2004 From: hengist.podd at virgin.net (has) Date: Wed Apr 21 13:54:34 2004 Subject: [Pythonmac-SIG] Appscript and Excel In-Reply-To: References: Message-ID: Paul Berkowitz wrote: > > from appscript import * >> from customterminology import Excel_10_1_0 > >> excel = app('Microsoft Excel', terms=Excel_10_1_0.appTerminology) > >Just out of interest, why/how does the version-with-underscores squeeze in >here? The module name indicates the application from which the terminology was exported, in this case Excel 10.1.0. Using terminology from one application version with another is completely unsafe. Terminology modules are specific to the application from which they were exported. Somebody running Excel 10.2.5 should export and use the terminology from that version, 'cos while the Excel 10.1.0 terminology _may_ be the same as that in 10.2.5 there's _no guarantee_ that it is. As you can imagine, managing modified aete terminology as standalone Python modules will be a logistical nightmare for users, which is one of the reasons I'd much rather they hack such fixes directly into the application itself. Course, this is easier said than done, which is why I'm having to consider alternatives such as this; in short, trying to decide which will be the lesser of several rather nasty evils. HTH has -- http://freespace.virgin.net/hamish.sanderson/ From Jack.Jansen at cwi.nl Wed Apr 21 15:29:41 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Wed Apr 21 15:29:56 2004 Subject: [Pythonmac-SIG] Appscript and Excel In-Reply-To: References: <84ACC6AC-939F-11D8-B4EC-000A958D1666@cwi.nl> Message-ID: <3C87C1FC-93CA-11D8-A493-000D934FF6B4@cwi.nl> On 21 Apr 2004, at 19:24, has wrote: > Sure. But the whole reason I switched to Python and created appscript > was to get away from AppleScript's numerous design and policy flaws > in the first place. And I've no intention of bodging things now; I've > enough to do tightening my code and beating out my own bugs to be > covering up for other developers' stupidity as well. (Yes, I'm aware > of the "be liberal in what you accept" argument, but don't believe it > was ever intended to include covering up for incompetence and > corruption at your own expense. And if it was then whoever coined it > was themselves a fool.) > > Now I do realise these sorts of problems can reflect badly on > appscript from the punter's point of view - "It worked on > AppleScript, so appscript must be broken" - but the solution to that > is educating users that the fault lies with the application > developer, and that the proper solution is to file a bug report with > that developer. I agree with this in principle, but there's also the "practicality beats purity" dictum. Thinking out loud: isn't what we want some sort of editing instructions for the aete, so we could specify something like "When parsing the aete for Excel if the Set description matches this-and-this condition replace it with this routine", passing a routine that would issue a warning and call the builtin lowercase set. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From jason at smileproject.com Wed Apr 21 16:52:31 2004 From: jason at smileproject.com (Jason Van Anden) Date: Wed Apr 21 16:52:59 2004 Subject: [Pythonmac-SIG] Strange wx behavior on Mac OS X.3 Message-ID: I created a series of buttons in Windows using the wxPython modules, and everything looked just fine. When I went to run the same code on my Mac (pythonw bitsg.pyw): where there should be one button -- there are many duplicates - and more appear when I resize the window. Any ideas? Jason From daniel at brightfire.org Wed Apr 21 16:32:43 2004 From: daniel at brightfire.org (Daniel Lord) Date: Wed Apr 21 17:04:25 2004 Subject: [Pythonmac-SIG] Appscript and Excel In-Reply-To: References: Message-ID: <0ADD99FE-93D3-11D8-98A5-000A95ACE052@brightfire.org> > From: has > The best solution would be to fix Excel's aete resource. Start by > filing a bug report on it, though I'm also assuming you don't want to > wait till MS get around to releasing a formal patch. This IMHO is the best solution but out of our collective control and therefore not my first choice because I don't want to wait months or longer. I will file a bug report on it once I figure out the right channel to use at M$ to be sure it goes to the right place. > If you're > feeling brave, you could hack the app directly with a ResEdit-style > tool. Don't like this idea since M$ may update Excel without fixing the defect necessitating patching yet again. > Alternatively, there's an as-yet undocumented system for > working around aete problems by exporting and compiling aete data > into a Python module where it can be hacked manually. This module can > then be imported into your script and passed to appscript via the > app() function's 'terms' argument: > > from appscript import * > from customterminology import Excel_10_1_0 > > excel = app('Microsoft Excel', terms=Excel_10_1_0.appTerminology) > formulaRef = excel.Workbooks[1].Worksheets[1].Range['R1C1'].Formula > print formulaRef.get() > formulaRef.set('Test_From_Python_Appscript') I like this idea--this model can be distributed with any applications written and installed with distutils in site-packages or, optionally, by hand wherever the user wants. There is little of multiple versions of such solution conflicting since they are very specific. It possible to narrow the cope to jsut specific AEs so that the imports are additive to the current AETE's definitions? In this way, it would be a 'run-time' patch to the name space. Maybe that's kind of what Bob was hinting at though both he and you are much more savvy about these things than I so i might be off track here. > I'm still trying to decide on the best formal policy for dealing with > buggy aetes (appscript is much less forgiving of bad aetes than > AppleScript), and while this particular system works I really don't > like it much - it's complicated, clumsy, and hard for users to > follow, why I've not been quick to publicise it or release the full > resources to use it. However, I'm going to write it up for the 0.5.0 > release which should be out in another week or so, with the proviso > that it's being made public purely for discussion purposes and is > subject to change or removal at any time. I'd be interested in beta-testing 0.5.0 whenever you want if you are interested. Spreadsheets are a basic modeling tool for me and I shun VBA, so this or Applescript is it and I strongly prefer Python over AS. IMHO Apple should have "Done The Right ThingTM" and made Python as a key scripting language for the platform as a more powerful OOP alternative to Applescript. Nothing like creating Yet Another Platform-Dependent and Unique Language eh? Maybe if we put on some pressure they'll see the light and create OSA tools and modules for Python? Naaaaah! What was I thinking?. As if. I just used Windows in Virtual PC a few minutes ago and the brain fog hasn't quite worn off I guess . -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 3337 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040421/b49e88e9/attachment.bin From dkwolfe at pacbell.net Wed Apr 21 17:16:38 2004 From: dkwolfe at pacbell.net (Dan Wolfe) Date: Wed Apr 21 17:16:45 2004 Subject: [Pythonmac-SIG] Appscript and Excel In-Reply-To: <0ADD99FE-93D3-11D8-98A5-000A95ACE052@brightfire.org> References: <0ADD99FE-93D3-11D8-98A5-000A95ACE052@brightfire.org> Message-ID: <2D18645A-93D9-11D8-AD37-003065BA8704@pacbell.net> Actually, it been done.... Apple's only supplies an Applescript interface to the OSA API's... but give that it's an open spec you can create your own replacement for Applescript if you have the time and money. :-) Late Night Software did this for Javascript and Bill Fancher had an implementation of Python as an OSA language a while back... Google for OSA Bill and Python... you'll get a couple of hits... :-) - Dan On Apr 21, 2004, at 1:32 PM, Daniel Lord wrote: MHO Apple should have "Done The Right ThingTM" and made Python as a key scripting language for the platform as a more powerful OOP alternative to Applescript. Nothing like creating Yet Another Platform-Dependent and Unique Language eh? Maybe if we put on some pressure they'll see the light and create OSA tools and modules for Python? Naaaaah! What was I thinking?. From kevino at tulane.edu Wed Apr 21 18:12:57 2004 From: kevino at tulane.edu (Kevin Ollivier) Date: Wed Apr 21 18:13:05 2004 Subject: [Pythonmac-SIG] Strange wx behavior on Mac OS X.3 In-Reply-To: References: Message-ID: <0B3C992C-93E1-11D8-B781-000393CB1C86@tulane.edu> Hi all, This is fixed in wxMac CVS HEAD, and we plan on having a release out soon. =) Thanks, Kevin On Apr 21, 2004, at 1:52 PM, Jason Van Anden wrote: > I created a series of buttons in Windows using the wxPython modules, > and everything looked just fine. When I went to run the same code on > my Mac (pythonw bitsg.pyw): where there should be one button -- there > are many duplicates - and more appear when I resize the window. Any > ideas? > > Jason > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From lanceboyle at myrealbox.com Wed Apr 21 20:26:44 2004 From: lanceboyle at myrealbox.com (Lance Boyle) Date: Wed Apr 21 20:26:44 2004 Subject: [Pythonmac-SIG] Fwd: [SciPy-user] ANN: SciPy 0.3 Released Message-ID: I see that SciPy 0.3 has been released and that perhaps I should take another look at it. What are the installation issues with respect to MacPython? Some time back I was Finking and battling two Pythons and trying to compile ATLAS and I finally decided that other things were more important. Jerry Begin forwarded message: > From: "Travis N. Vaught" > Date: April 21, 2004 2:40:24 PM MST > To: scipy-dev@scipy.org, scipy-user@scipy.org, > python-announce@python.org, numpy-discussion@lists.sourceforge.net, > python-list@python.org > Cc: Subject: [SciPy-user] ANN: SciPy 0.3 Released > Reply-To: SciPy Users List > > Greetings, > > SciPy 0.3 has been released and binaries are available from the > scipy.org site. > > http://www.scipy.org > > Changes since the 0.1 version (0.1 enjoyed a wide release, there was a > version 0.2 that had limited exposure) include the following: > > - general improvements: Added utility functions for constructing > arrays by concatenation, intended mainly for command-line use. Added > bmat constructor for easy creation of block matrices. Added mat > constructor for constructing matrices (where * is matrix > multiplication). Added many PIL utility functions so that if the PIL > is installed, image loading, saving, and other operations are > available. Added scipy.info, which handles dynamic docstrings and > class help better than python's help command. > > - documentation: much improved > > - sparse: superLU upgraded to 3.0 > > - optimize: Added non-linear conjugate gradient algorithm. > Improvements to BFGS algorithm and Wolfe-condition line-search. Added > two CONSTRAINED optimization techniques. Added simulated annealing and > brute-force optimization strategies and Powell's method. Added many > very good 1-D root-finding routines. > > - stats: Added many statistical distributions. Many continuous and > discrete random variables are available with a simple mechanism for > adding new ones. Added several statistical tests. > > - special: Added MANY new special functions. |general_function| > renamed to |vectorize| and moved to scipy_base. Improved the way > domain errors are handled (user specified display of problems). More > tests on special functions added. > > - fftpack: replaced with fftpack2--can optionally be configured to > support djbfft > > - io: Reading of MATLAB .mat files (version 4 and 5) supported. > Writing version 4 .mat files supported. Added very flexible and > general_purpose text file reader. Added shelving save operation to > save variables into an importable module. Routines for reading and > writing fortran-records. > > - linalg: Linear algebra is greatly improved over SciPy 0.1. ATLAS is > now optional (but encouraged). Most lapack functions have simplified > interfaces (all lapack and blas available). Matrix exponentials and > other matrix functions added. > > - signal: Added support for filter design and LTI system analysis. > > - xplt: Updated xplt to use newer pygist so that Windows platform is > supported. Addition of several plotting types. > > - integrate: added another ODE integrator. Added romberg integration > and several other integration approaches. > > > The complete release notes can be found here: > > http://www.scipy.org/download/scipy_release_notes_0.3.html > > > You'll also notice that scipy.org is now a spanking new Plone portal > (http://www.plone.org -- keep up the good work, plone folks). > > This is the first binary release in a long time and we hope to > increase the frequency to every 6 months or so. > > If you'd like to follow or join the community, you can subscribe to > the mailing lists here: > > http://www.scipy.org/mailinglists/ > > Best Regards, > > Travis > > > BTW SciPy is: > ------------- > SciPy is an open source library of scientific tools for Python. SciPy > supplements the popular Numeric module, gathering a variety of high > level science and engineering modules together as a single package. > > SciPy includes modules for graphics and plotting, optimization, > integration, special functions, signal and image processing, genetic > algorithms, ODE solvers, and others. > > _______________________________________________ > SciPy-user mailing list > SciPy-user@scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From eric at enthought.com Wed Apr 21 21:45:14 2004 From: eric at enthought.com (eric jones) Date: Wed Apr 21 21:45:16 2004 Subject: [Pythonmac-SIG] Fwd: [SciPy-user] ANN: SciPy 0.3 Released In-Reply-To: References: Message-ID: <408723AA.7070306@enthought.com> Hey Jerry, We'd like to eventually build Mac installations as part of our standard build process, but I have no idea when that will actually happen. Is there someone out there that can build and package scipy as a .dmg file? If so, we'll stick it on the download page. Fink is also a possibility, but many Mac users I've run into really frown upon Fink and would really prefer .dmg installs. I guess we can stick both up on the site so that everyone is happy. thanks, eric Lance Boyle wrote: > I see that SciPy 0.3 has been released and that perhaps I should take > another look at it. What are the installation issues with respect to > MacPython? Some time back I was Finking and battling two Pythons and > trying to compile ATLAS and I finally decided that other things were > more important. > > Jerry > > > Begin forwarded message: > >> From: "Travis N. Vaught" >> Date: April 21, 2004 2:40:24 PM MST >> To: scipy-dev@scipy.org, scipy-user@scipy.org, >> python-announce@python.org, numpy-discussion@lists.sourceforge.net, >> python-list@python.org >> Cc: Subject: [SciPy-user] ANN: SciPy 0.3 Released >> Reply-To: SciPy Users List >> >> Greetings, >> >> SciPy 0.3 has been released and binaries are available from the >> scipy.org site. >> >> http://www.scipy.org >> >> Changes since the 0.1 version (0.1 enjoyed a wide release, there was >> a version 0.2 that had limited exposure) include the following: >> >> - general improvements: Added utility functions for constructing >> arrays by concatenation, intended mainly for command-line use. Added >> bmat constructor for easy creation of block matrices. Added mat >> constructor for constructing matrices (where * is matrix >> multiplication). Added many PIL utility functions so that if the PIL >> is installed, image loading, saving, and other operations are >> available. Added scipy.info, which handles dynamic docstrings and >> class help better than python's help command. >> >> - documentation: much improved >> >> - sparse: superLU upgraded to 3.0 >> >> - optimize: Added non-linear conjugate gradient algorithm. >> Improvements to BFGS algorithm and Wolfe-condition line-search. Added >> two CONSTRAINED optimization techniques. Added simulated annealing >> and brute-force optimization strategies and Powell's method. Added >> many very good 1-D root-finding routines. >> >> - stats: Added many statistical distributions. Many continuous and >> discrete random variables are available with a simple mechanism for >> adding new ones. Added several statistical tests. >> >> - special: Added MANY new special functions. |general_function| >> renamed to |vectorize| and moved to scipy_base. Improved the way >> domain errors are handled (user specified display of problems). More >> tests on special functions added. >> >> - fftpack: replaced with fftpack2--can optionally be configured to >> support djbfft >> >> - io: Reading of MATLAB .mat files (version 4 and 5) supported. >> Writing version 4 .mat files supported. Added very flexible and >> general_purpose text file reader. Added shelving save operation to >> save variables into an importable module. Routines for reading and >> writing fortran-records. >> >> - linalg: Linear algebra is greatly improved over SciPy 0.1. ATLAS is >> now optional (but encouraged). Most lapack functions have simplified >> interfaces (all lapack and blas available). Matrix exponentials and >> other matrix functions added. >> >> - signal: Added support for filter design and LTI system analysis. >> >> - xplt: Updated xplt to use newer pygist so that Windows platform is >> supported. Addition of several plotting types. >> >> - integrate: added another ODE integrator. Added romberg integration >> and several other integration approaches. >> >> >> The complete release notes can be found here: >> >> http://www.scipy.org/download/scipy_release_notes_0.3.html >> >> >> You'll also notice that scipy.org is now a spanking new Plone portal >> (http://www.plone.org -- keep up the good work, plone folks). >> >> This is the first binary release in a long time and we hope to >> increase the frequency to every 6 months or so. >> >> If you'd like to follow or join the community, you can subscribe to >> the mailing lists here: >> >> http://www.scipy.org/mailinglists/ >> >> Best Regards, >> >> Travis >> >> >> BTW SciPy is: >> ------------- >> SciPy is an open source library of scientific tools for Python. SciPy >> supplements the popular Numeric module, gathering a variety of high >> level science and engineering modules together as a single package. >> >> SciPy includes modules for graphics and plotting, optimization, >> integration, special functions, signal and image processing, genetic >> algorithms, ODE solvers, and others. >> >> _______________________________________________ >> SciPy-user mailing list >> SciPy-user@scipy.net >> http://www.scipy.net/mailman/listinfo/scipy-user >> > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From chris at fonnesbeck.org Wed Apr 21 23:28:34 2004 From: chris at fonnesbeck.org (Christopher Fonnesbeck) Date: Wed Apr 21 23:28:44 2004 Subject: [Pythonmac-SIG] Fwd: [SciPy-user] ANN: SciPy 0.3 Released In-Reply-To: References: Message-ID: <22BBBCE0-940D-11D8-96C8-000A956FDAC0@fonnesbeck.org> > > I see that SciPy 0.3 has been released and that perhaps I should take > another look at it. What are the installation issues with respect to > MacPython? Some time back I was Finking and battling two Pythons and > trying to compile ATLAS and I finally decided that other things were > more important. > > There is no need for *any* Fink packages to compile and run scipy on OSX. Using the vector libraries in the developer tools is sufficient. I've been running the latest CVS scipy for months on my powerbook with minimal problems. Let me know if you run into any. C. -- Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g ) Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia "More and more of our imports come from overseas." George W. Bush, 25 September 2000 -- Putting http://wecanstopspam.org in your email helps it pass through overzealous spam filters. From marlong at rogers.com Wed Apr 21 17:59:16 2004 From: marlong at rogers.com (Marlon A. Griffith) Date: Thu Apr 22 03:02:33 2004 Subject: [Pythonmac-SIG] mod_python works (was: Re: libpython2.3.a?) In-Reply-To: <2147483647.1082547204@[192.168.2.201]> References: <2147483647.1082390161@blue-four.us.itd.umich.edu> <60E09B28-92A4-11D8-984D-000A958D1666@cwi.nl> <2147483647.1082474541@blue-four.us.itd.umich.edu> <787B9222-9301-11D8-90CB-000A95686CD8@redivi.com> <2147483647.1082547204@[192.168.2.201]> Message-ID: Lance, At 11:33 AM -0400 4/21/04, Lance E Sloan wrote: >--On Tuesday, April 20, 2004 3:32 PM -0400 Bob Ippolito > wrote: >>Just like I said: >>Nope! mod_python for Apache 1.3.x isn't compatible with a multithreaded >>Python even if you could get it to compile+link. > >And it's not that I doubted you, but I just wanted to see for >myself. I was in the neighborhood (mod_python was built), so I >couldn't think of any reason not to try. Besides, if I understood >Jack's question, he wanted to know what would happen anyway. > >So yesterday I used Fink (for the first time) to install apache2, >apache2-dev, and a couple other apache2-* packages. I got Apache 2 >running on a different port and it didn't interfere with the Apache >1 supplied by Apple. >I had some trouble getting mod_python 3.1.3 to build at first, >though. My computer didn't have apr-config. I found that Fink had >an apr package I needed, then I was on my way. mod_python compiled >fine and works. Now I just have to learn a bit about how to >configure it for my needs. Where did you get the source for puthon for compiling mod_python? Did you use MacPython's source or a python that you got through Fink or another means? P.S. I would like to use MacPython's source if possible. tia -- Make it a great day! http://members.rogers.com/kalyxsis "We move ahead by going deeper." Jennifer James (1943- ) American Writer "Don't let your schooling interfere with your education." Mark Twain "Do not parrot the words of famous people. Learn the meaning of what they say and repeat it in your own words." Mark Twain (not an exact quote). From pecora at anvil.nrl.navy.mil Thu Apr 22 10:05:38 2004 From: pecora at anvil.nrl.navy.mil (Louis M. Pecora) Date: Thu Apr 22 10:06:20 2004 Subject: [Pythonmac-SIG] Fwd: [SciPy-user] ANN: SciPy 0.3 Released In-Reply-To: <22BBBCE0-940D-11D8-96C8-000A956FDAC0@fonnesbeck.org> References: <22BBBCE0-940D-11D8-96C8-000A956FDAC0@fonnesbeck.org> Message-ID: >There is no need for *any* Fink packages to compile and run scipy on >OSX. Using the vector libraries in the developer tools is >sufficient. I've been running the latest CVS scipy for months on my >powerbook with minimal problems. Let me know if you run into any. > >C. > >-- >Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g ) >Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia >-- >Putting http://wecanstopspam.org in your email helps it pass through >overzealous spam filters. Christopher, It sounds like you know how to do this. Do you have anything written up on what steps to go through to install SciPy? -- Cheers, Lou Pecora From Chris.Barker at noaa.gov Thu Apr 22 12:15:54 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Thu Apr 22 12:16:19 2004 Subject: [Pythonmac-SIG] Fwd: [SciPy-user] ANN: SciPy 0.3 Released In-Reply-To: <22BBBCE0-940D-11D8-96C8-000A956FDAC0@fonnesbeck.org> References: <22BBBCE0-940D-11D8-96C8-000A956FDAC0@fonnesbeck.org> Message-ID: <4087EFBA.5070200@noaa.gov> Christopher Fonnesbeck wrote: > There is no need for *any* Fink packages to compile and run scipy on > OSX. Using the vector libraries in the developer tools is sufficient. indeed, more than sufficient, the vector libraries are optimized for Apple hardware. -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 Chris.Barker@noaa.gov From lsloan at umich.edu Thu Apr 22 12:23:37 2004 From: lsloan at umich.edu (Lance E Sloan) Date: Thu Apr 22 12:23:43 2004 Subject: [Pythonmac-SIG] mod_python works (was: Re: libpython2.3.a?) In-Reply-To: References: <2147483647.1082390161@blue-four.us.itd.umich.edu> <60E09B28-92A4-11D8-984D-000A958D1666@cwi.nl> <2147483647.1082474541@blue-four.us.itd.umich.edu> <787B9222-9301-11D8-90CB-000A95686CD8@redivi.com> <2147483647.1082547204@[192.168.2.201]> Message-ID: <2147483647.1082636617@blue-four.us.itd.umich.edu> --On Wednesday, April 21, 2004 5:59 PM -0400 "Marlon A. Griffith" wrote: > Where did you get the source for puthon for compiling mod_python? Did you > use MacPython's source or a python that you got through Fink or another > means? That's the part I like the best: I didn't use *any* Python source. I just used the Python that comes with Mac OS X 10.3.3. It's a thing of beauty. Very little work required to get mod_python running so I can get to using it quickly. -- Lance E Sloan, Systems Research Programmer III U-M WATS: Web Applications, Technologies, and Solutions Full-service web and database design, development, and hosting. http://www.itcs.umich.edu/wats/ - "Putting U on the Web" From marlong at rogers.com Thu Apr 22 12:34:47 2004 From: marlong at rogers.com (Marlon A. Griffith) Date: Thu Apr 22 12:34:58 2004 Subject: [Pythonmac-SIG] mod_python works (was: Re: libpython2.3.a?) In-Reply-To: <2147483647.1082636617@blue-four.us.itd.umich.edu> References: <2147483647.1082390161@blue-four.us.itd.umich.edu> <60E09B28-92A4-11D8-984D-000A958D1666@cwi.nl> <2147483647.1082474541@blue-four.us.itd.umich.edu> <787B9222-9301-11D8-90CB-000A95686CD8@redivi.com> <2147483647.1082547204@[192.168.2.201]> <2147483647.1082636617@blue-four.us.itd.umich.edu> Message-ID: At 12:23 PM -0400 4/22/04, Lance E Sloan wrote: >--On Wednesday, April 21, 2004 5:59 PM -0400 "Marlon A. Griffith" > wrote: >>Where did you get the source for puthon for compiling mod_python? Did you >>use MacPython's source or a python that you got through Fink or another >>means? > >That's the part I like the best: I didn't use *any* Python source. >I just used the Python that comes with Mac OS X 10.3.3. It's a >thing of beauty. Very little work required to get mod_python running >so I can get to using it quickly. Nice! How long have you been using the newly compiled mod_python then and have you had any issues yet? This is yet another reason for me to upgrade to X.3.3. Sigh! -- Make it a great day! http://members.rogers.com/kalyxsis "We move ahead by going deeper." Jennifer James (1943- ) American Writer "Don't let your schooling interfere with your education." Mark Twain "Do not parrot the words of famous people. Learn the meaning of what they say and repeat it in your own words." Mark Twain (not an exact quote). From pecora at anvil.nrl.navy.mil Thu Apr 22 16:22:37 2004 From: pecora at anvil.nrl.navy.mil (Louis M. Pecora) Date: Thu Apr 22 16:22:32 2004 Subject: [Pythonmac-SIG] Adjusting the Numeric text Wrap in Output Window of Python IDE ?? Message-ID: It seems that printing arrays (from Numeric) to the Output window in the Mac Python IDE automaticall wraps text printed at about 80 columns (shades of punch cards!). Is there any way to change this default? I have two screens and like to stretch the output window to one whole screen. It would be nice to have longer arrays run across the entire window before wrapping. Thanks. -- Cheers, Lou Pecora From jason at smileproject.com Thu Apr 22 18:35:21 2004 From: jason at smileproject.com (Jason Van Anden) Date: Thu Apr 22 18:36:22 2004 Subject: [Pythonmac-SIG] OSX.3 vs pyGame Message-ID: <56EFB076-94AD-11D8-9837-0003930488EC@smileproject.com> Hello, I am trying to install pyGame on my Mac, and having a heck of time doing it. Am I beating a dead horse? I followed the instructions regarding the Installation Manager -- but to no avail. Any suggestions warmly welcomed. J From bob at redivi.com Thu Apr 22 19:50:27 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Apr 22 19:46:16 2004 Subject: [Pythonmac-SIG] OSX.3 vs pyGame In-Reply-To: <56EFB076-94AD-11D8-9837-0003930488EC@smileproject.com> References: <56EFB076-94AD-11D8-9837-0003930488EC@smileproject.com> Message-ID: On Apr 22, 2004, at 6:35 PM, Jason Van Anden wrote: > I am trying to install pyGame on my Mac, and having a heck of time > doing it. > Am I beating a dead horse? > > I followed the instructions regarding the Installation Manager -- but > to no avail. > > Any suggestions warmly welcomed. Please read http://pythonmac.org/wiki/FAQ If you still have problems, ask again on this list -- but we will need descriptions of the problem(s) you're having. -bob From chris at fonnesbeck.org Fri Apr 23 11:27:32 2004 From: chris at fonnesbeck.org (Christopher Fonnesbeck) Date: Fri Apr 23 11:27:37 2004 Subject: [Pythonmac-SIG] Fwd: [SciPy-user] ANN: SciPy 0.3 Released Message-ID: <51491.69.55.173.180.1082734052.squirrel@mail.zettai.net> I have written up some OSX installation instructions thhis morning and have submitted them to the SciPy folks. I will inform the list when these are made available on the SciPy site (hopefully soon). Chris -- Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g ) Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia From chris at fonnesbeck.org Fri Apr 23 12:41:46 2004 From: chris at fonnesbeck.org (Christopher Fonnesbeck) Date: Fri Apr 23 12:41:53 2004 Subject: [Pythonmac-SIG] Fwd: [SciPy-user] ANN: SciPy 0.3 Released In-Reply-To: References: <51491.69.55.173.180.1082734052.squirrel@mail.zettai.net> Message-ID: <1BF3ADFA-9545-11D8-8C1B-000A956FDAC0@fonnesbeck.org> On Apr 23, 2004, at 12:21 PM, Louis M. Pecora wrote: >> I have written up some OSX installation instructions thhis morning and >> have submitted them to the SciPy folks. I will inform the list when >> these >> are made available on the SciPy site (hopefully soon). >> >> Chris > > Ergo, We are in debt to you. Thank you. > The instructions have been published on SciPy.org: http://www.scipy.org/documentation/Members/fonnesbeck/osx_build.txt I hope I have not forgotten anything important -- its been awhile since I installed it from *scratch*, but I believe everything is there. Let me know if it is otherwise. Cheers, Chris -- Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g ) Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia "More and more of our imports come from overseas." George W. Bush, 25 September 2000 -- Putting http://wecanstopspam.org in your email helps it pass through overzealous spam filters. From lsloan at umich.edu Fri Apr 23 13:34:49 2004 From: lsloan at umich.edu (Lance E Sloan) Date: Fri Apr 23 13:34:54 2004 Subject: [Pythonmac-SIG] mod_python works (was: Re: libpython2.3.a?) In-Reply-To: References: <2147483647.1082390161@blue-four.us.itd.umich.edu> <60E09B28-92A4-11D8-984D-000A958D1666@cwi.nl> <2147483647.1082474541@blue-four.us.itd.umich.edu> <787B9222-9301-11D8-90CB-000A95686CD8@redivi.com> <2147483647.1082547204@[192.168.2.201]> <2147483647.1082636617@blue-four.us.itd.umich.edu> Message-ID: <2147483647.1082727289@141-213-238-109.umnet.umich.edu> --On Thursday, April 22, 2004 12:34 PM -0400 "Marlon A. Griffith" wrote: > At 12:23 PM -0400 4/22/04, Lance E Sloan wrote: >> That's the part I like the best: I didn't use *any* Python source. >> I just used the Python that comes with Mac OS X 10.3.3. It's a >> thing of beauty. Very little work required to get mod_python running >> so I can get to using it quickly. > > Nice! How long have you been using the newly compiled mod_python then and > have you had any issues yet? > > This is yet another reason for me to upgrade to X.3.3. Sigh! Hmm... I've just been using it since Tuesday, I think. No problems yet, but I've not gotten as much time to work with it as I would like. My "real" work keeps getting in the way. ;) -- Lance E Sloan, Systems Research Programmer III U-M WATS: Web Applications, Technologies, and Solutions Full-service web and database design, development, and hosting. http://www.itcs.umich.edu/wats/ - "Putting U on the Web" From gohaku at earthlink.net Sat Apr 24 13:01:23 2004 From: gohaku at earthlink.net (gohaku) Date: Sat Apr 24 13:01:31 2004 Subject: [Pythonmac-SIG] [Newbie] Problem running wxPython script Message-ID: <044761E3-9611-11D8-9E0E-000A9574CFD8@earthlink.net> Hi everyone, I just installed wxMac and wxPython successfully ( Or so I think ) and I am having problems running the following: from wxPython.wx import * class MyApp(wxApp): def OnInit(self): frame = wxFrame(NULL, -1, "Hello from wxPython") frame.Show(true) self.SetTopWindow(frame) return true app = MyApp(0) app.MainLoop() I use "pythonw" to run the script but get the following: Traceback (most recent call last): File "wx.py", line 1, in ? from wxPython.wx import * File "//Library/Python/2.3/wxPython/__init__.py", line 10, in ? import _wx File "//Library/Python/2.3/wxPython/_wx.py", line 3, in ? from core import * File "//Library/Python/2.3/wxPython/core.py", line 15, in ? import wx.core File "/Users/johndoe/Desktop/wx.py", line 1, in ? from wxPython.wx import * ImportError: No module named wx I am losing my mind searching newsgroups and the Web to see If I missed anything. And yes, I downloaded the Latest Installer for wxMac and wxPython. btw, I am using OS Xv10.3.3. Please help. Thanks in advance. -gohaku From john at hazen.net Sat Apr 24 15:42:42 2004 From: john at hazen.net (John Hazen) Date: Sat Apr 24 15:45:58 2004 Subject: [Pythonmac-SIG] [Newbie] Problem running wxPython script In-Reply-To: <044761E3-9611-11D8-9E0E-000A9574CFD8@earthlink.net> References: <044761E3-9611-11D8-9E0E-000A9574CFD8@earthlink.net> Message-ID: <20040424194242.GA25732@gate2.hazen.net> * gohaku [2004-04-24 09:58]: > > I use "pythonw" to run the script but get the following: > > Traceback (most recent call last): > File "wx.py", line 1, in ? > from wxPython.wx import * > File "//Library/Python/2.3/wxPython/__init__.py", line 10, in ? > import _wx > File "//Library/Python/2.3/wxPython/_wx.py", line 3, in ? > from core import * > File "//Library/Python/2.3/wxPython/core.py", line 15, in ? > import wx.core -------------^^ > File "/Users/johndoe/Desktop/wx.py", line 1, in ? > from wxPython.wx import * > ImportError: No module named wx > > I am losing my mind searching newsgroups and the Web to see If I missed > anything. Hi Gohaku- Try naming your file something other than "wx.py". The default sys.path puts the current directory first in the search order, so internal to wxPython, it's trying to import your file, instead of the "wx" module that comes with wxPython. HTH- John From Jack.Jansen at cwi.nl Sat Apr 24 17:12:41 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sat Apr 24 17:12:41 2004 Subject: [Pythonmac-SIG] Fwd: [SciPy-user] ANN: SciPy 0.3 Released In-Reply-To: <1BF3ADFA-9545-11D8-8C1B-000A956FDAC0@fonnesbeck.org> References: <51491.69.55.173.180.1082734052.squirrel@mail.zettai.net> <1BF3ADFA-9545-11D8-8C1B-000A956FDAC0@fonnesbeck.org> Message-ID: <1F59D43B-9634-11D8-B6C3-000D934FF6B4@cwi.nl> On 23 Apr 2004, at 18:41, Christopher Fonnesbeck wrote: > The instructions have been published on SciPy.org: > > http://www.scipy.org/documentation/Members/fonnesbeck/osx_build.txt I would be interested in getting SciPy into Package Manager, but this would still require the end user to download dependencies such as AquaTerm (and possibly some of the libraries too, if SciPy links against dynamic libraries). Would that be worth the trouble? Anyone willing to help me doing it? Oh yes, Chris, my name is "jansen", not "jesnesn":-) -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From gohaku at earthlink.net Sat Apr 24 17:30:10 2004 From: gohaku at earthlink.net (gohaku) Date: Sat Apr 24 17:30:17 2004 Subject: [Pythonmac-SIG] [Newbie] Problem running wxPython script In-Reply-To: <20040424194242.GA25732@gate2.hazen.net> References: <044761E3-9611-11D8-9E0E-000A9574CFD8@earthlink.net> <20040424194242.GA25732@gate2.hazen.net> Message-ID: <90549D31-9636-11D8-9FF0-000A9574CFD8@earthlink.net> On Apr 24, 2004, at 3:42 PM, John Hazen wrote: > Hi Gohaku- > > Try naming your file something other than "wx.py". The default > sys.path > puts the current directory first in the search order, so internal to > wxPython, it's trying to import your file, instead of the "wx" module > that comes with wxPython. > > HTH- > Hi John, Thanks a lot! :) I renamed my file to test.py which solved my problem. That, and using an Older version ( v2.4.2.4 ) of wxPythonOSX. I received the following error Message for ( wxPythonOSX v2.5.1.5 and wxMac v2.4.2 ): Fatal Error: Mismatch between the program and library build versions detected. The library used 2.5.1 (debug,ANSI,compiler with C++ ABI 100,wx containers,compatible with 2.4), and wxPython used 2.5.1 (debug,ANSI,compiler with C++ ABI 102,wx containers,compatible with 2.4). Abort All the scripts from the wxPython tutorial are working thankfully. Thanks again John. Sincerely, -gohaku From hengist.podd at virgin.net Sun Apr 25 09:02:29 2004 From: hengist.podd at virgin.net (has) Date: Sun Apr 25 09:02:46 2004 Subject: [Pythonmac-SIG] Seeking feedback: PyMod 0.1 Message-ID: Hi all, Still beating away at the new HTMLTemplate docs, I'm afraid, so appscript 0.5.0 will be sometime next week now. However, something I have gotten around to finishing this week is a preview release of my simple AppleSpaghetti Studio-based GUI tool for building and installing downloaded distutils packages: http://freespace.virgin.net/hamish.sanderson/PyMod.app.sit The name sucks (suggestions?), and there's no documentation or nice icon yet, but it appears to do the job ok and should be self-explanatory. Works with both setup.py and *.tar.gz files and supports multi-item drag-n-drop, file chooser and direct input; runs distutils via Terminal.app in background. Issues I've noted so far: 1. The drag-n-drop support and file chooser dialog could be a bit more discriminating in what they accept. 2. Direct input currently only works with full posix paths; it'd be nice if understood paths starting with ~/ and ~name/ as well. Please let me know what you think. has -- http://freespace.virgin.net/hamish.sanderson/ From bob at eyesopen.com Mon Apr 26 00:47:49 2004 From: bob at eyesopen.com (Robert Tolbert) Date: Mon Apr 26 00:43:20 2004 Subject: [Pythonmac-SIG] building extensions that link against dynamic libraries (revisited) Message-ID: <408C9475.1010708@eyesopen.com> I hate to dredge up an old topic, but I've spent more time chasing this weird problem and am still befuddled as to why I can't get this to work. The original question was posted here: http://mail.python.org/pipermail/pythonmac-sig/2004-January/009911.html where I asked some questions about importing an extension that is linked against a shared dynamic library that I've also built. In a nutshell, I am wrapping a large C++ API in Python using SWIG. I can built the base C++ libraries as either static libs or dynamic libs. I can built the extension linked against either of these. And here is where the difference lies. If I link against the static libraries, my extension loads and works just fine. If I link against the dynamic libraries, Python hangs trying to import the extension. Ctrl-C won't interupt it, I have to Ctrl-Z and kill -9 to get it to stop. Interestingly, Fink's python can import and use either extension as built above. The problem is only with /usr/bin/python on Panther. As a follow-up to the last discussion, I have done several things to try and rule out several of the issues people have noted in emails and the FAQ. 1. I have switched to building the extension using distutils; still won't load. 2. I have tried building on a second Panther machine that never had Jaguar (old system python) and has never had Fink. So I could rule out the problems people have noted due to multiple Python's being installed. 3. I've used otool on the extension .so to see which libraries/Frameworks it is dependent on. I've made sure that DYLD_LIBRARY_PATH points to the directory containing my C++ dynamic libraries. This was enough to make sure Fink's python can load the modules just fine. My wonder now is whether /usr/bin/python actually honors DYLD_LIBRARY_PATH, or whether the is some other location I need to put my .dylibs to help it find them. At the end of the day, I can probably get customers to use Fink or build their own Python into /usr/local/bin but it sure would be nice to have this work with the system python. Bob Tolbert From Jack.Jansen at cwi.nl Mon Apr 26 06:58:09 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon Apr 26 06:59:07 2004 Subject: [Pythonmac-SIG] building extensions that link against dynamic libraries (revisited) In-Reply-To: <408C9475.1010708@eyesopen.com> References: <408C9475.1010708@eyesopen.com> Message-ID: <9ADE4AB2-9770-11D8-BD53-000A958D1666@cwi.nl> On 26-apr-04, at 6:47, Robert Tolbert wrote: > I hate to dredge up an old topic, but I've spent more time chasing > this weird problem and am still befuddled as to why I can't get this > to work. > > The original question was posted here: > > http://mail.python.org/pipermail/pythonmac-sig/2004-January/009911.html > > where I asked some questions about importing an extension that is > linked against a shared dynamic library that I've also built. In a > nutshell, I am wrapping a large C++ API in Python using SWIG. I can > built the base C++ libraries as either static libs or dynamic libs. I > can built the extension linked against either of these. And here is > where the difference lies. > > If I link against the static libraries, my extension loads and works > just fine. > > If I link against the dynamic libraries, Python hangs trying to import > the extension. Ctrl-C won't interupt it, I have to Ctrl-Z and kill -9 > to get it to stop. First I want to reiterate the last suggestion I made back in January: use some of the DYLD debugging environment variables to see if you can figure out what is going on. Especially now that you have it working with fink-python that could turn out to be very helpful (see where fink-python mac apple-python differ). DYLD_PRINT_LIBRARIES comes to mind, and you may also want to play with DYLD_BIND_AT_LAUNCH and DYLD_ABORT_MULTIPLE_INITS Another suggestion is to (temporarily) make sure you don't need DYLD_LIBRARY_PATH by putting your shared libraries in /usr/local/lib. This'll let you work out whether the problem is somehow related to how you set DYLD_LIBRARY_PATH or how it is picked up or something. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From hengist.podd at virgin.net Mon Apr 26 10:26:23 2004 From: hengist.podd at virgin.net (has) Date: Mon Apr 26 10:29:45 2004 Subject: [Pythonmac-SIG] update posted: PyMod 0.1.1 In-Reply-To: References: Message-ID: Quick update to 0.1.1 (fixes a bug when reopening Prefs dialog): http://freespace.virgin.net/hamish.sanderson/PyMod.app.sit has -- http://freespace.virgin.net/hamish.sanderson/ From bob at eyesopen.com Mon Apr 26 12:27:08 2004 From: bob at eyesopen.com (Bob Tolbert) Date: Mon Apr 26 12:27:17 2004 Subject: [Pythonmac-SIG] building extensions that link against dynamic libraries - Fixed! In-Reply-To: <9ADE4AB2-9770-11D8-BD53-000A958D1666@cwi.nl> References: <408C9475.1010708@eyesopen.com> <9ADE4AB2-9770-11D8-BD53-000A958D1666@cwi.nl> Message-ID: <90489868-979E-11D8-BBEE-000A95B465D4@eyesopen.com> Thanks for the quick response. All your ideas gave me enough energy to re-double my efforts to find and fix this problem. I did not know about all the DYLD_* environment variables and I recommend anyone else working on extensions/dylibs on OS X become familiar with these as well as otool. After turning on DYLD_PRINT_LIBRARIES, I could see that all the correct libraries were in fact loading yet the import would still hang. I finally decided to go look for another project wraps C++ into a Python extension. Of course, wxPython is just such a beast so I went digging through the source to find appropriate switches to compiling and linking my original dylibs, as well as building the extension. Addtionally, I re-read the discussion of about a month ago giving multiple choices for building extensions in general. My final changes that get everything to work: Changes while build base C++ libraries. 1. Added -dynamic to CXXFLAGS. I already had -fPIC, but -dynamic seems to be used as well. (don't know if this is absolutely required) 2. Linked all dylibs with "-dynamiclib -single_module -undefined dynamic_lookup" as recommended in the archives, plus the -single_module switch came from the wxMAC makefiles. Then to build the extension, I used: "-bundle -undefined dynamic_lookup" and made sure not to use "-framework Python" From this I get a bundle that can successfully be imported into the system Framework Python as well as Fink's python. This gives maximum flexibility to my customers to use either one which was definitely a goal. Clearly, I didn't use distutils since it would use "-framework Python" by default. Thanks to Jack for spurring me on with these other ideas and to Robin Dunn et. al. for going down this path before me. Bob Robert W. Tolbert Ph.D. p. (505) 473-7385 Ext. 83 OpenEye Scientific Software f. (505) 473-0833 3600 Cerrillos Road, Suite 1107 Santa Fe, NM 87507 On Apr 26, 2004, at 4:58 AM, Jack Jansen wrote: > > On 26-apr-04, at 6:47, Robert Tolbert wrote: > >> I hate to dredge up an old topic, but I've spent more time chasing >> this weird problem and am still befuddled as to why I can't get this >> to work. >> >> The original question was posted here: >> >> http://mail.python.org/pipermail/pythonmac-sig/2004-January/ >> 009911.html >> >> where I asked some questions about importing an extension that is >> linked against a shared dynamic library that I've also built. In a >> nutshell, I am wrapping a large C++ API in Python using SWIG. I can >> built the base C++ libraries as either static libs or dynamic libs. I >> can built the extension linked against either of these. And here is >> where the difference lies. >> >> If I link against the static libraries, my extension loads and works >> just fine. >> >> If I link against the dynamic libraries, Python hangs trying to >> import the extension. Ctrl-C won't interupt it, I have to Ctrl-Z and >> kill -9 to get it to stop. > > First I want to reiterate the last suggestion I made back in January: > use some of the DYLD debugging environment variables to see if you can > figure out what is going on. Especially now that you have it working > with fink-python that could turn out to be very helpful (see where > fink-python mac apple-python differ). DYLD_PRINT_LIBRARIES comes to > mind, and you may also want to play with DYLD_BIND_AT_LAUNCH and > DYLD_ABORT_MULTIPLE_INITS > > Another suggestion is to (temporarily) make sure you don't need > DYLD_LIBRARY_PATH by putting your shared libraries in /usr/local/lib. > This'll let you work out whether the problem is somehow related to how > you set DYLD_LIBRARY_PATH or how it is picked up or something. > -- > Jack Jansen, , http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma > Goldman From n9yty at n9yty.com Mon Apr 26 13:45:24 2004 From: n9yty at n9yty.com (Steven Palm) Date: Mon Apr 26 13:45:57 2004 Subject: [Pythonmac-SIG] OT? wxGlade "application" bundle? Message-ID: <7EFFD6B7-97A9-11D8-B072-000A95B1990C@n9yty.com> I've not been able to build (via bundlebuilder) a launchable bundle of wxGlade for MacOS X. Has anyone else tried and hopefully succeeded? :-) Thanks! -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2098 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040426/ca2af37c/smime.bin From bob at redivi.com Mon Apr 26 15:12:06 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Apr 26 15:07:44 2004 Subject: [Pythonmac-SIG] building extensions that link against dynamic libraries - Fixed! In-Reply-To: <90489868-979E-11D8-BBEE-000A95B465D4@eyesopen.com> References: <408C9475.1010708@eyesopen.com> <9ADE4AB2-9770-11D8-BD53-000A958D1666@cwi.nl> <90489868-979E-11D8-BBEE-000A95B465D4@eyesopen.com> Message-ID: <9BC7C97E-97B5-11D8-9DFB-000A95686CD8@redivi.com> On Apr 26, 2004, at 12:27 PM, Bob Tolbert wrote: > From this I get a bundle that can successfully be imported into the > system Framework Python as well as Fink's python. This gives maximum > flexibility to my customers to use either one which was definitely a > goal. Clearly, I didn't use distutils since it would use "-framework > Python" by default. You can simply change the linker flags that distutils uses by sudo editing the LDSHARED (definitely) and BLDSHARED (maybe) definitions in: /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ config/Makefile You will also need to make sure to have the MACOSX_DEPLOYMENT_TARGET environment variable set to 10.3 whenever you use distutils, or else ld will probably complain since the default is 10.1 compatibility and this linker flag was not available until 10.3. -bob From ronaldoussoren at mac.com Mon Apr 26 16:14:50 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon Apr 26 16:15:10 2004 Subject: [Pythonmac-SIG] building extensions that link against dynamic libraries - Fixed! In-Reply-To: <9BC7C97E-97B5-11D8-9DFB-000A95686CD8@redivi.com> References: <408C9475.1010708@eyesopen.com> <9ADE4AB2-9770-11D8-BD53-000A958D1666@cwi.nl> <90489868-979E-11D8-BBEE-000A95B465D4@eyesopen.com> <9BC7C97E-97B5-11D8-9DFB-000A95686CD8@redivi.com> Message-ID: <5F36196C-97BE-11D8-9E4F-0003931CFE24@mac.com> On 26-apr-04, at 21:12, Bob Ippolito wrote: > > On Apr 26, 2004, at 12:27 PM, Bob Tolbert wrote: > >> From this I get a bundle that can successfully be imported into the >> system Framework Python as well as Fink's python. This gives maximum >> flexibility to my customers to use either one which was definitely a >> goal. Clearly, I didn't use distutils since it would use "-framework >> Python" by default. > > You can simply change the linker flags that distutils uses by sudo > editing the LDSHARED (definitely) and BLDSHARED (maybe) definitions > in: > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/config/Makefile If you're really sick you can get the same effect by some sneaky Python code. Of course I'd never write such code ;) ;) Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: pkghack.tar Type: application/x-tar Size: 10240 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040426/106e3cce/pkghack-0001.tar -------------- next part -------------- -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From Jack.Jansen at cwi.nl Mon Apr 26 17:58:13 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon Apr 26 17:58:09 2004 Subject: [Pythonmac-SIG] building extensions that link against dynamic libraries - Fixed! In-Reply-To: <5F36196C-97BE-11D8-9E4F-0003931CFE24@mac.com> References: <408C9475.1010708@eyesopen.com> <9ADE4AB2-9770-11D8-BD53-000A958D1666@cwi.nl> <90489868-979E-11D8-BBEE-000A95B465D4@eyesopen.com> <9BC7C97E-97B5-11D8-9DFB-000A95686CD8@redivi.com> <5F36196C-97BE-11D8-9E4F-0003931CFE24@mac.com> Message-ID: On 26 Apr 2004, at 22:14, Ronald Oussoren wrote: >> You can simply change the linker flags that distutils uses by sudo >> editing the LDSHARED (definitely) and BLDSHARED (maybe) definitions >> in: >> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ >> python2.3/config/Makefile > > If you're really sick you can get the same effect by some sneaky > Python code. We need *something* like this to implement Bob's idea of using dynamic_lookup to fix the two-python problem, and while this solution is better than what I have now (which is absolutely nothing) I'm not 100% satisfied with it. The main problem I have is that the .pth trick means that this code will be run in every single Python invocation. In other words, every run of Python will start off by fiddling with the distutils internals (with all the side effects and imports and such that this concurs). Does anyone have any smart ideas on how we could fix this, so we only execute this code when distutils is actually used? For 2.4 we can fix this once and for all by having distutils try and do an "import distutils_hotfix" in __init__, but that doesn't help us for apple-installed 2.3. I also have slight misgivings about the way the script will fix any distutils that comes on its path (I would prefer to fix only things we're 100% sure we can fix), but that's easy to change. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From bob at redivi.com Mon Apr 26 18:28:12 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Apr 26 18:23:51 2004 Subject: [Pythonmac-SIG] building extensions that link against dynamic libraries - Fixed! In-Reply-To: References: <408C9475.1010708@eyesopen.com> <9ADE4AB2-9770-11D8-BD53-000A958D1666@cwi.nl> <90489868-979E-11D8-BBEE-000A95B465D4@eyesopen.com> <9BC7C97E-97B5-11D8-9DFB-000A95686CD8@redivi.com> <5F36196C-97BE-11D8-9E4F-0003931CFE24@mac.com> Message-ID: <008F382D-97D1-11D8-B57C-000A95686CD8@redivi.com> On Apr 26, 2004, at 5:58 PM, Jack Jansen wrote: > On 26 Apr 2004, at 22:14, Ronald Oussoren wrote: >>> You can simply change the linker flags that distutils uses by sudo >>> editing the LDSHARED (definitely) and BLDSHARED (maybe) definitions >>> in: >>> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ >>> python2.3/config/Makefile >> >> If you're really sick you can get the same effect by some sneaky >> Python code. > > We need *something* like this to implement Bob's idea of using > dynamic_lookup to fix the two-python problem, and while this solution > is better than what I have now (which is absolutely nothing) I'm not > 100% satisfied with it. > > The main problem I have is that the .pth trick means that this code > will be run in every single Python invocation. In other words, every > run of Python will start off by fiddling with the distutils internals > (with all the side effects and imports and such that this concurs). > Does anyone have any smart ideas on how we could fix this, so we only > execute this code when distutils is actually used? You're mistaken, actually. It fiddles with sys.path on every python invocation, nothing more. It poses for the original distutils, and uses pkgutil to bring the original distutils in when it gets imported. > For 2.4 we can fix this once and for all by having distutils try and > do an "import distutils_hotfix" in __init__, but that doesn't help us > for apple-installed 2.3. It's more complicated than that.. there are three situations: (a) building on 10.3+ for 10.3+ currently supported configuration use the fix (b) building on 10.3+ for 10.1+ with a 10.1+ safe Python currently unsupported but people want this reluctantly use -framework Python use a different fix (set NEXT_ROOT, lower MACOSX_DEPLOYMENT_TARGET) (c) building on < 10.3 currently supported configuration can not use the fix reluctantly use -framework Python TODO: Whatever version of Python that ships with OS X 10.4 should support ONLY situation (a). This means that with default configuration options (or possibly just MACOSX_DEPLOYMENT_TARGET >= 10.3 introspection), the next releases of Python 2.3 and 2.4 should build for (a). Hot-fix should be available for OS X 10.3 python to support ONLY situation (a) [OS X 10.3 python is not 10.1+ safe anyway]. Ronald's pkghack is adequate for this. Some separate distribution and configure flag (or possibly just MACOSX_DEPLOYMENT_TARGET <= 10.2 and NEXT_ROOT introspection) of Python should be created to support situation (b). > I also have slight misgivings about the way the script will fix any > distutils that comes on its path (I would prefer to fix only things > we're 100% sure we can fix), but that's easy to change. I wouldn't be terribly worried about this.. how many distutils are there? And how many of those distutils aren't just slight modifications to the current? -bob From ronaldoussoren at mac.com Tue Apr 27 00:50:17 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue Apr 27 00:50:59 2004 Subject: [Pythonmac-SIG] building extensions that link against dynamic libraries - Fixed! In-Reply-To: <008F382D-97D1-11D8-B57C-000A95686CD8@redivi.com> References: <408C9475.1010708@eyesopen.com> <9ADE4AB2-9770-11D8-BD53-000A958D1666@cwi.nl> <90489868-979E-11D8-BBEE-000A95B465D4@eyesopen.com> <9BC7C97E-97B5-11D8-9DFB-000A95686CD8@redivi.com> <5F36196C-97BE-11D8-9E4F-0003931CFE24@mac.com> <008F382D-97D1-11D8-B57C-000A95686CD8@redivi.com> Message-ID: <614F9975-9806-11D8-9E4F-0003931CFE24@mac.com> On 27-apr-04, at 0:28, Bob Ippolito wrote: > >> I also have slight misgivings about the way the script will fix any >> distutils that comes on its path (I would prefer to fix only things >> we're 100% sure we can fix), but that's easy to change. > > I wouldn't be terribly worried about this.. how many distutils are > there? And how many of those distutils aren't just slight > modifications to the current? I'm more worried about the amount of thought and testing that went into the module this hotfix. I've only tested it by doing a quick rebuild of PyObjC. The patch should be made safer by checking for MACOSX_DEPLOYEMENT_TARGET and the current OS version (in the __init__.py, not in the .pth file) Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From bob at redivi.com Tue Apr 27 01:16:47 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Apr 27 01:12:27 2004 Subject: [Pythonmac-SIG] building extensions that link against dynamic libraries - Fixed! In-Reply-To: <614F9975-9806-11D8-9E4F-0003931CFE24@mac.com> References: <408C9475.1010708@eyesopen.com> <9ADE4AB2-9770-11D8-BD53-000A958D1666@cwi.nl> <90489868-979E-11D8-BBEE-000A95B465D4@eyesopen.com> <9BC7C97E-97B5-11D8-9DFB-000A95686CD8@redivi.com> <5F36196C-97BE-11D8-9E4F-0003931CFE24@mac.com> <008F382D-97D1-11D8-B57C-000A95686CD8@redivi.com> <614F9975-9806-11D8-9E4F-0003931CFE24@mac.com> Message-ID: <15215821-980A-11D8-B57C-000A95686CD8@redivi.com> On Apr 27, 2004, at 12:50 AM, Ronald Oussoren wrote: > On 27-apr-04, at 0:28, Bob Ippolito wrote: >> >>> I also have slight misgivings about the way the script will fix any >>> distutils that comes on its path (I would prefer to fix only things >>> we're 100% sure we can fix), but that's easy to change. >> >> I wouldn't be terribly worried about this.. how many distutils are >> there? And how many of those distutils aren't just slight >> modifications to the current? > > I'm more worried about the amount of thought and testing that went > into the module this hotfix. I've only tested it by doing a quick > rebuild of PyObjC. > > The patch should be made safer by checking for > MACOSX_DEPLOYEMENT_TARGET and the current OS version (in the > __init__.py, not in the .pth file) MACOSX_DEPLOYMENT_TARGET should be trusted if set to a reasonable value, and it should be injected into the environment if unset or otherwise not appropriate. The OS version does NOT really matter! Here is pseudocode for what should happen.. # this is important! It makes very little sense to compile a 10.2-compatible module against a 10.3+ python injected_dt = max(dt_when_python_was_compiled, current_dt or dt_when_python_was_compiled) # use it if we can if injected_dt < '10.3': use '-framework Python' else: use '-undefined dynamic_lookup' We must preserve the MACOSX_DEPLOYMENT_TARGET that was set when python was compiled (requires a patch to python.. I am not an expert with the python build process so someone else will have to do this). For a /System Python, it should be the current os version. -bob From larson at cs.ualberta.ca Tue Apr 27 18:31:05 2004 From: larson at cs.ualberta.ca (Bryce Larson) Date: Tue Apr 27 18:31:09 2004 Subject: [Pythonmac-SIG] Best IDE? Message-ID: <921AA189-989A-11D8-8B01-000A95D79734@cs.ualberta.ca> I am new to python and have been looking for a good IDE that supports wx. I wondering if anyone has any recommendations? Thank you, Bryce From kranki2 at earthlink.net Tue Apr 27 20:59:47 2004 From: kranki2 at earthlink.net (Robert White) Date: Tue Apr 27 20:59:57 2004 Subject: [Pythonmac-SIG] Python Setup for Darwinports Message-ID: <5864A6EA-98AF-11D8-8CA2-000A95A94FC8@earthlink.net> I may have missed it, but I am not aware any macpython people contributing to the discussions of how to properly implement Python in MacOSX and none of the darwinports people seem to be active on macpython when major discussions of how to implement python and pythnon-related software in darwinports are occurring. Since I belong to both mailing lists, but do not feel that I am knowledgeable enough to comment on technical details, I think that it would be worthwhile if some of the people on darwinports who are implementing the new python implementation consulted with some on the macpython group and vice versa. I have found that there is a significant amount of in-depth knowledge of the apple-installed python and running multiple pythons under MacOSX in the macpython group. If this has already occurred, I apologize for having missed that point and you can disregard this msg. Otherwise, it is just an observation/suggestion and sorry for not thinking of it sooner. Just my $.02, FWIW. From bob at redivi.com Tue Apr 27 21:41:56 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Apr 27 21:37:33 2004 Subject: [Pythonmac-SIG] Python Setup for Darwinports In-Reply-To: <5864A6EA-98AF-11D8-8CA2-000A95A94FC8@earthlink.net> References: <5864A6EA-98AF-11D8-8CA2-000A95A94FC8@earthlink.net> Message-ID: <3B67EA96-98B5-11D8-B57C-000A95686CD8@redivi.com> On Apr 27, 2004, at 8:59 PM, Robert White wrote: > I may have missed it, but I am not aware any macpython people > contributing to the discussions of how to properly implement Python in > MacOSX and none of the darwinports people seem to be active on > macpython when major discussions of how to implement python and > pythnon-related software in darwinports are occurring. Since I belong > to both mailing lists, but do not feel that I am knowledgeable enough > to comment on technical details, I think that it would be worthwhile > if some of the people on darwinports who are implementing the new > python implementation consulted with some on the macpython group and > vice versa. I have found that there is a significant amount of > in-depth knowledge of the apple-installed python and running multiple > pythons under MacOSX in the macpython group. > > If this has already occurred, I apologize for having missed that point > and you can disregard this msg. Otherwise, it is just an > observation/suggestion and sorry for not thinking of it sooner. This is a great suggestion. It seems that Ronald Oussoren is already subscribed.. he does have the technical knowledge to speak on both lists about these issues, and I have just subscribed myself for redundancy :) Ideally discussions that involve changes to the Python source tree would take place on pythonmac-sig, because there are more Python committers subscribed here. -bob From ronaldoussoren at mac.com Wed Apr 28 02:55:05 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed Apr 28 02:55:14 2004 Subject: [Pythonmac-SIG] Python Setup for Darwinports In-Reply-To: <5864A6EA-98AF-11D8-8CA2-000A95A94FC8@earthlink.net> References: <5864A6EA-98AF-11D8-8CA2-000A95A94FC8@earthlink.net> Message-ID: On 28-apr-04, at 2:59, Robert White wrote: > I may have missed it, but I am not aware any macpython people > contributing to the discussions of how to properly implement Python in > MacOSX and none of the darwinports people seem to be active on > macpython when major discussions of how to implement python and > pythnon-related software in darwinports are occurring. I'm also subscribed to both lists, and I even joined the discussion. The current solution seems sane to me: they have their own python tree (in /opt/local), and two site-packages directories "site-packages" and "vendor-packages". The vendor-packages directory is used for packages installed by DarwinPorts. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From simon-lists at ldml.com Wed Apr 28 05:21:31 2004 From: simon-lists at ldml.com (Simon Forster) Date: Wed Apr 28 05:21:47 2004 Subject: [Pythonmac-SIG] MacPython Install Message-ID: <6FB2D546-98F5-11D8-A309-000A9579123A@ldml.com> I would like to "upgrade" my instal of Python to MacPython. I'm running Mac OS 10.3.3 and, having just used the MacPython additions installer, I realise that its updated the system copy of Python, not my instal. Question: How do I add the appropriate modules to my /usr/local/bin/Python2.3/ (my 2.3.3 instal) rather than the system versh? I've looked through MacPython's FAQ as suggested elsewhere on the MacPython web site but I didn't see anything directly relevant. TIA Simon Forster _____________________________________________________ LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK Tel: +44 (0)70 9230 5244 Fax: +44 (0)70 9230 5247 _____________________________________________________ From gherman at darwin.in-berlin.de Thu Apr 29 04:48:54 2004 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Thu Apr 29 04:43:56 2004 Subject: [Pythonmac-SIG] Is wave.py maybe broken? Message-ID: <0B95C8CA-99BA-11D8-A145-00039345C610@darwin.in-berlin.de> Hi, I'm trying to use the wave module in the standard library, but seem to get errors when accessing .wav files which are otherwise playing fine on OS X (see traceback below). Is this perhaps an issue with a "vaguely defined" format or is it platform-specific, even? Thanks for any hints... Here's a sample which gives me the error below: http://www.dailywav.com/0404/seriousbitch.wav Dinu Python 2.3.3 (#1, Feb 2 2004, 19:00:54) [GCC 3.1 20020420 (prerelease)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> import wave >>> f = wave.open("seriousbitch.wav") Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/wave.py", line 483, in open return Wave_read(f) File "/usr/lib/python2.3/wave.py", line 162, in __init__ self.initfp(f) File "/usr/lib/python2.3/wave.py", line 143, in initfp self._read_fmt_chunk(chunk) File "/usr/lib/python2.3/wave.py", line 264, in _read_fmt_chunk raise Error, 'unknown format: ' + `wFormatTag` wave.Error: unknown format: 85 >>> -- Dinu C. Gherman - http://python.net/~gherman ...................................................................... "The best way to predict the future is to invent it." (Alan Kay) From gherman at darwin.in-berlin.de Thu Apr 29 05:25:07 2004 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Thu Apr 29 05:20:01 2004 Subject: [Pythonmac-SIG] Is wave.py maybe broken? In-Reply-To: <0B95C8CA-99BA-11D8-A145-00039345C610@darwin.in-berlin.de> Message-ID: <1AE322BC-99BF-11D8-A145-00039345C610@darwin.in-berlin.de> Dinu Gherman: > I'm trying to use the wave module in the standard library, but seem > to get errors when accessing .wav files which are otherwise playing > fine on OS X (see traceback below). The following, using PyObjC, does also not produce any sound for the .wav files I've got, but it does for .aiff ones... Kind of strange... Dinu Python 2.3.3 (#1, Feb 2 2004, 19:00:54) [GCC 3.1 20020420 (prerelease)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> from AppKit import NSSound >>> mkSound = NSSound.alloc().initWithContentsOfFile_byReference_ >>> s = mkSound("seriousbitch.wav", False) >>> s.play() 1 From artelse at mohr-i.nl Thu Apr 29 05:57:26 2004 From: artelse at mohr-i.nl (Arthur Elsenaar) Date: Thu Apr 29 05:57:35 2004 Subject: [Pythonmac-SIG] Is wave.py maybe broken? In-Reply-To: <1AE322BC-99BF-11D8-A145-00039345C610@darwin.in-berlin.de> References: <1AE322BC-99BF-11D8-A145-00039345C610@darwin.in-berlin.de> Message-ID: <9ED33284-99C3-11D8-9C60-000A95C887F8@mohr-i.nl> Dinu Gherman wrote: > Dinu Gherman: > >> I'm trying to use the wave module in the standard library, but seem >> to get errors when accessing .wav files which are otherwise playing >> fine on OS X (see traceback below). > > The following, using PyObjC, does also not produce any sound for > the .wav files I've got, but it does for .aiff ones... > > Kind of strange... I've been hit by this limitation as well with pygame: pygame.error: Unknown WAVE data format: 0x4x The wave format has different 'incarnations' and some aren't supported by python. Quicktime on the other hand can play them just fine because it knows how to handle that particular format. I say 'incarnations' as I haven't done any research in the nitty gritty of the wave formats.. yet. Arthur From gherman at darwin.in-berlin.de Thu Apr 29 06:28:36 2004 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Thu Apr 29 06:23:29 2004 Subject: [Pythonmac-SIG] Is wave.py maybe broken? In-Reply-To: <9ED33284-99C3-11D8-9C60-000A95C887F8@mohr-i.nl> Message-ID: Arthur Elsenaar: > The wave format has different 'incarnations' and some aren't > supported by python. Quicktime on the other hand can play them > just fine because it knows how to handle that particular format. Thanks, I've been told the seriousbitch sample seems to contain an MP3 stream, which might be the cause of the problem... Then, I guess it's sad one cannot even "open" auch a file to read its parameters only... In any case, I'd be interested to know how to use Carbon modules to take the extra step via Quicktime to access the audio parameters and possibly even the data, if anybody knows how to do that...? Thanks, Dinu -- Dinu C. Gherman - http://python.net/~gherman ...................................................................... "The best way to predict the future is to invent it." (Alan Kay) From rowen at cesmail.net Thu Apr 29 13:35:16 2004 From: rowen at cesmail.net (Russell E. Owen) Date: Thu Apr 29 13:35:42 2004 Subject: [Pythonmac-SIG] Re: MacPython Install References: <6FB2D546-98F5-11D8-A309-000A9579123A@ldml.com> Message-ID: In article <6FB2D546-98F5-11D8-A309-000A9579123A@ldml.com>, Simon Forster wrote: > I would like to "upgrade" my instal of Python to MacPython. I'm running > Mac OS 10.3.3 and, having just used the MacPython additions installer, > I realise that its updated the system copy of Python, not my instal. > > Question: How do I add the appropriate modules to my > /usr/local/bin/Python2.3/ (my 2.3.3 instal) rather than the system > versh? I've looked through MacPython's FAQ as suggested elsewhere on > the MacPython web site but I didn't see anything directly relevant. This is a bit confusing as stated. MacOS X 10.3 comes with python 2.3.0 in /System. You should not touch that. You will not ever get it up to 2.3.3. Also, it does NOT coexist well with other MacPython aqua/python installations. If you just ran the MacPython extras installer then you are safe. This uses the Python in /System without touching it, but adds a MacPython folder in Applications with useful extras such as an IDE, the Package Manager and help. This built in python puts extra modules in /Library/Python/2.3/ and if you do the normal distutils thing to install packages (or use Package Manager) then that is exactly where they will end up. If you installed Python 2.3.3 as an aqua/Mac installation (rather than a straight unix/X install) then you can expect conflicts and trouble. I'm not fully up on what goes wrong, but it is a bad idea. You *CAN* safely install plain vanilla unix/X python (and I do that myself). In that case add-on packages are not shared so you'll have to install them twice, once per version of python, being sure to use the right version of python in both cases. For example: /usr/local/bin/python setup.py install vs /usr/bin/python setup.py install or if you have /usr/local/bin first on your path you can do as I do: python setup.py install for unix python pythonw setup.py install for aqua python I hope this didn't make things yet more confusing. -- Russell From jason at smileproject.com Thu Apr 29 20:49:40 2004 From: jason at smileproject.com (Jason Van Anden) Date: Thu Apr 29 20:50:12 2004 Subject: [Pythonmac-SIG] Setting PYTHONPATH on mac os x Message-ID: <437CADE9-9A40-11D8-ADFF-0003930488EC@smileproject.com> Major newbie question - but one that was not so easy to parse out of a Google search for "set pythonpath mac" - until now, hopefully, with your help. How do I add to the pythonpath on mac os x? Really digging working with Python and the Mac, by the way. Thanks! J From speno at isc.upenn.edu Fri Apr 30 11:25:45 2004 From: speno at isc.upenn.edu (John P Speno) Date: Fri Apr 30 11:26:19 2004 Subject: [Pythonmac-SIG] Setting PYTHONPATH on mac os x In-Reply-To: <437CADE9-9A40-11D8-ADFF-0003930488EC@smileproject.com> References: <437CADE9-9A40-11D8-ADFF-0003930488EC@smileproject.com> Message-ID: <20040430152545.GA2563@isc.upenn.edu> On Thu, Apr 29, 2004 at 08:49:40PM -0400, Jason Van Anden wrote: > Major newbie question - but one that was not so easy to parse out of a > Google search for "set pythonpath mac" - until now, hopefully, with > your help. How do I add to the pythonpath on mac os x? I just added this to the Pythonmac FAQ here: http://pythonmac.org/wiki/FAQ Look in the general section. Please let me know if that answers your question. Thanks. From jhrsn at pitt.edu Fri Apr 30 13:04:56 2004 From: jhrsn at pitt.edu (Jim Harrison) Date: Fri Apr 30 13:05:14 2004 Subject: [Pythonmac-SIG] Setting PYTHONPATH on mac os x In-Reply-To: <20040430152545.GA2563@isc.upenn.edu> Message-ID: on 4/30/04 11:25 AM, John P Speno at speno@isc.upenn.edu wrote: > On Thu, Apr 29, 2004 at 08:49:40PM -0400, Jason Van Anden wrote: >> Major newbie question - but one that was not so easy to parse out of a >> Google search for "set pythonpath mac" - until now, hopefully, with >> your help. How do I add to the pythonpath on mac os x? > > I just added this to the Pythonmac FAQ here: > > http://pythonmac.org/wiki/FAQ > > Look in the general section. > > Please let me know if that answers your question. Note that the Apple tech note referenced in the wiki entry ignores ignores a number of details that would be useful for newbies: the correct format for multiple paths associated with one variable name, how to get the Property List Editor or other editing environment to find/open the .MacOSX directory, and so on. There are also several utilities that can be helpful, such as the RCEnvironment prefpane for viewing and setting environment variables, BBEdit for opening and editing hidden directories/files and OnyX for revealing hidden directories/files so that any editor can be used. I added comments about these to the wiki entry. It would probably be a good idea of someone knowledgeable checked my edit to make sure it's entirely correct. Jim Harrison Univ. of Pittsburgh From bob at redivi.com Fri Apr 30 13:23:49 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Apr 30 13:23:58 2004 Subject: [Pythonmac-SIG] Setting PYTHONPATH on mac os x In-Reply-To: References: Message-ID: <24EB0338-9ACB-11D8-94F6-000A95686CD8@redivi.com> On Apr 30, 2004, at 1:04 PM, Jim Harrison wrote: > on 4/30/04 11:25 AM, John P Speno at speno@isc.upenn.edu wrote: > >> On Thu, Apr 29, 2004 at 08:49:40PM -0400, Jason Van Anden wrote: >>> Major newbie question - but one that was not so easy to parse out of >>> a >>> Google search for "set pythonpath mac" - until now, hopefully, with >>> your help. How do I add to the pythonpath on mac os x? >> >> I just added this to the Pythonmac FAQ here: >> >> http://pythonmac.org/wiki/FAQ >> >> Look in the general section. >> >> Please let me know if that answers your question. > > Note that the Apple tech note referenced in the wiki entry ignores > ignores a > number of details that would be useful for newbies: the correct format > for > multiple paths associated with one variable name, how to get the > Property > List Editor or other editing environment to find/open the .MacOSX > directory, > and so on. There are also several utilities that can be helpful, such > as the > RCEnvironment prefpane for viewing and setting environment variables, > BBEdit > for opening and editing hidden directories/files and OnyX for revealing > hidden directories/files so that any editor can be used. > > I added comments about these to the wiki entry. It would probably be a > good > idea of someone knowledgeable checked my edit to make sure it's > entirely > correct. I would suggest that people use pth files instead of trying to use PYTHONPATH. Given a user account with privileges to write to a site directory, I think that PYTHONPATH is *ONLY* appropriate for something like a bootstrap shell script that starts a particular application. There isn't a FAQ entry for using pth files yet, but you can search the archives here, they've been talked about a number of times. In short, to add a directory by way of a pth file, simply make a plain text file with any name that has "pth" as the extension. The contents of the file should be the absolute path you would like to add (~ and $vars are not allowed). Move the file to a site directory (such as /Library/Python/2.3 for OS X 10.3). This has the distinct advantage that it works regardless of what your environment happens to be, and it only affects python interpreters that use that site directory. Unconditionally setting PYTHONPATH will affect EVERY python, regardless of Python version or vendor (apple, fink, darwinports, user compiled, etc.). -bob From daniel at brightfire.org Fri Apr 30 17:11:10 2004 From: daniel at brightfire.org (Daniel Lord) Date: Fri Apr 30 17:11:19 2004 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG Digest, Vol 12, Issue 38 In-Reply-To: References: Message-ID: Just one opinion and experience and for what little it's worth: I find that compiling from source but configuring and installing a 'framework' install and using Aqua TCL/TK works but is problematic due to a few sticky areas including: PIL which I cannot get to compile though I haven't tried very hard, having to use pythonw as the command to force OS X to behave properly, and some Tkinter GUI attributes are overridden by Apples Gestapo-like UI enforcement (just kidding about the Gestapo comparison BTW but they are strict about it ). Non-standard paths due to the framework install are most likely are the reason I struggle with PIL. This is a pain and it may be what Russell is alluding to when stating that an aqua/Mac install can cause conflicts and trouble. It appears it does. Sticking with X/standard python is what I would do if I could do it over again. I used to use Fink but have moved away from it FYI. Stay as 'standard' as you can and you'll avoid a lot of extra and cumbersome work in the future. There is always something you'll want to use that breaks on a 'non-standard' install. And if you are not particularly skilled in the nuances of Python environments and I am not, though many regular contributors here are, it is vexing to be unable to run some standard and not-so-standard additions. X11 on OS X seems to work very well as of Panther OS X and I second Russell's recommendation. --Daniel > >> I would like to "upgrade" my instal of Python to MacPython. I'm >> running >> Mac OS 10.3.3 and, having just used the MacPython additions installer, >> I realise that its updated the system copy of Python, not my instal. >> >> Question: How do I add the appropriate modules to my >> /usr/local/bin/Python2.3/ (my 2.3.3 instal) rather than the system >> versh? I've looked through MacPython's FAQ as suggested elsewhere on >> the MacPython web site but I didn't see anything directly relevant. > > This is a bit confusing as stated. > > MacOS X 10.3 comes with python 2.3.0 in /System. You should not touch > that. You will not ever get it up to 2.3.3. Also, it does NOT coexist > well with other MacPython aqua/python installations. > > If you just ran the MacPython extras installer then you are safe. This > uses the Python in /System without touching it, but adds a MacPython > folder in Applications with useful extras such as an IDE, the Package > Manager and help. > > This built in python puts extra modules in /Library/Python/2.3/ and if > you do the normal distutils thing to install packages (or use Package > Manager) then that is exactly where they will end up. > > If you installed Python 2.3.3 as an aqua/Mac installation (rather than > a > straight unix/X install) then you can expect conflicts and trouble. I'm > not fully up on what goes wrong, but it is a bad idea. > > You *CAN* safely install plain vanilla unix/X python (and I do that > myself). In that case add-on packages are not shared so you'll have to > install them twice, once per version of python, being sure to use the > right version of python in both cases. For example: > > /usr/local/bin/python setup.py install > vs > /usr/bin/python setup.py install > > or if you have /usr/local/bin first on your path you can do as I do: > python setup.py install for unix python > pythonw setup.py install for aqua python > > I hope this didn't make things yet more confusing. > > -- Russell