From jerry.levan at eku.edu Wed Sep 1 05:36:07 2004 From: jerry.levan at eku.edu (Jerry LeVan) Date: Wed Sep 1 05:36:12 2004 Subject: [Pythonmac-SIG] Python Postgresql support? In-Reply-To: <20040831100006.496161E4010@bag.python.org> References: <20040831100006.496161E4010@bag.python.org> Message-ID: <0F3825B6-FBC8-11D8-BE09-000393779D9C@eku.edu> Is it possible to build the python postgresql support library on Mac OSX 10.3.5 with the default python install? Adding "--with-python" gets an error message about libpython not being a shared library when attempting to build postgresql. (pg 7.4.5) Thanks for any pointers. Jerry From lists at boutiquenumerique.com Wed Sep 1 09:09:52 2004 From: lists at boutiquenumerique.com (=?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?=) Date: Wed Sep 1 11:10:55 2004 Subject: [Pythonmac-SIG] Re: [GENERAL] Python Postgresql support? In-Reply-To: <96A6C6FA-FBC6-11D8-BE09-000393779D9C@eku.edu> References: <20040831100006.496161E4010@bag.python.org> <96A6C6FA-FBC6-11D8-BE09-000393779D9C@eku.edu> Message-ID: Use psycopg, it's a hell of a lot faster anyway. On Tue, 31 Aug 2004 23:25:35 -0400, Jerry LeVan wrote: > Is it possible to build the python postgresql support library > on Mac OSX 10.3.5 with the default python install? > > Adding "--with-python" gets an error message about libpython > not being a shared library when attempting to build postgresql. > (pg 7.4.5) > > Thanks for any pointers. > > Jerry > > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend > From hinsen at cnrs-orleans.fr Fri Sep 3 12:45:49 2004 From: hinsen at cnrs-orleans.fr (hinsen@cnrs-orleans.fr) Date: Fri Sep 3 12:45:01 2004 Subject: [Pythonmac-SIG] Distinguishing between MacPython and Fink Python at runtime Message-ID: <6B07A076-FD96-11D8-89B2-000A95999556@cnrs-orleans.fr> Is anyone aware of a reliable method for finding out at runtime if a program is running under MacPython or the Fink installation of Python? sys.platform is "darwin" in both cases. The reason for wanting to distinguish between the two is the difference in the handling of modifier keys in the standard X11 Tk and the TclTkAqua that MacPython uses. The X11 version uses Ctrl and Alt (which is mapped to the command key), whereas TclTkAqua uses Ctrl and Command. Konrad. From john at totalrekall.co.uk Sun Sep 5 08:30:30 2004 From: john at totalrekall.co.uk (John Dean) Date: Sun Sep 5 08:28:17 2004 Subject: [Pythonmac-SIG] Developing Python extentions on Mac X OS Message-ID: <000701c49311$d7eac170$0501a8c0@sun.thekompany.co.uk> Hi I am attempting to port Rekall to the Mac, only I am acomplete newbbie when it comes to Mac application development; I am more at home on Linux or Windows. Rekall includes a large number of Python extentions, which need Sip and SlipLib. Sip, SipLib and the extentions are dependent on the Mac equivalent of libpython2.3.so (possibly libpython2.3.dylib) yet it doesn't seem to be available with the Apple supplied dev kits. Could somebody tell where I can find the python dylib or would I need to buold Python from scratch? Thank you in advance Regards John Dean co-author of Rekall, the alternative to MS Access From ronaldoussoren at mac.com Sun Sep 5 10:07:19 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun Sep 5 10:08:16 2004 Subject: [Pythonmac-SIG] Developing Python extentions on Mac X OS In-Reply-To: <000701c49311$d7eac170$0501a8c0@sun.thekompany.co.uk> References: <000701c49311$d7eac170$0501a8c0@sun.thekompany.co.uk> Message-ID: <9B91A84C-FF12-11D8-8765-000A95C77748@mac.com> On 5-sep-04, at 8:30, John Dean wrote: > Hi > > I am attempting to port Rekall to the Mac, only I am acomplete newbbie > when it comes to Mac application development; I am more at home on > Linux or Windows. Rekall includes a large number of Python extentions, > which need Sip and SlipLib. Sip, SipLib and the extentions are > dependent on the Mac equivalent of libpython2.3.so (possibly > libpython2.3.dylib) yet it doesn't seem to be available with the Apple > supplied dev kits. Could somebody tell where I can find the python > dylib or would I need to buold Python from scratch? Link with '-framework Python'. On MacOS X 10.2 you'll have to install MacPython first, because the included python is 2.2 and doesn't include a shared library. Ronald From ludger.humbert at hagen.de Fri Sep 3 18:55:44 2004 From: ludger.humbert at hagen.de (Dr. Ludger Humbert) Date: Sun Sep 5 14:39:48 2004 Subject: [Pythonmac-SIG] Distinguishing between MacPython and Fink Python at runtime In-Reply-To: <6B07A076-FD96-11D8-89B2-000A95999556@cnrs-orleans.fr> References: <6B07A076-FD96-11D8-89B2-000A95999556@cnrs-orleans.fr> Message-ID: <4138A210.4090502@hagen.de> hinsen@cnrs-orleans.fr wrote: > Is anyone aware of a reliable method for finding out at runtime if a > program is running under MacPython or the Fink installation of Python? > sys.platform is "darwin" in both cases. Perhaps you will better use: import platform >>> print platform.__doc__ This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. If called from the command line, it prints the platform information concatenated as single string to stdout. The output format is useable as part of a filename. >>> platform.system() 'Linux' >>> platform.mac_ver() ('', ('', '', ''), '') >>> and may be, when working on a Mac ... Ludger From bob at redivi.com Sun Sep 5 16:19:23 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Sep 5 16:19:58 2004 Subject: [Pythonmac-SIG] Distinguishing between MacPython and Fink Python at runtime In-Reply-To: <6B07A076-FD96-11D8-89B2-000A95999556@cnrs-orleans.fr> References: <6B07A076-FD96-11D8-89B2-000A95999556@cnrs-orleans.fr> Message-ID: <9625C7FC-FF46-11D8-A72B-000A95686CD8@redivi.com> On Sep 3, 2004, at 6:45 AM, hinsen@cnrs-orleans.fr wrote: > Is anyone aware of a reliable method for finding out at runtime if a > program is running under MacPython or the Fink installation of Python? > sys.platform is "darwin" in both cases. Fink should probably test positive with sys.prefix.startswith('/sw') > The reason for wanting to distinguish between the two is the > difference in the handling of modifier keys in the standard X11 Tk and > the TclTkAqua that MacPython uses. The X11 version uses Ctrl and Alt > (which is mapped to the command key), whereas TclTkAqua uses Ctrl and > Command. However... testing for Fink vs. MacPython is the Wrong Thing To Do. You should just try and detect TclTkAqua versus X11 TclTkAqua, not Fink vs MacPython. It's possible to use TclTkAqua with a Fink Python or X11 Tk with MacPython. I'm not familiar enough with Tcl/Tk to know how, though. -bob From hinsen at cnrs-orleans.fr Mon Sep 6 14:48:20 2004 From: hinsen at cnrs-orleans.fr (hinsen@cnrs-orleans.fr) Date: Mon Sep 6 14:47:41 2004 Subject: [Pythonmac-SIG] Distinguishing between MacPython and Fink Python at runtime In-Reply-To: <9625C7FC-FF46-11D8-A72B-000A95686CD8@redivi.com> References: <6B07A076-FD96-11D8-89B2-000A95999556@cnrs-orleans.fr> <9625C7FC-FF46-11D8-A72B-000A95686CD8@redivi.com> Message-ID: <08563B81-0003-11D9-8B8F-000A95999556@cnrs-orleans.fr> On Sep 5, 2004, at 16:19, Bob Ippolito wrote: > Fink should probably test positive with sys.prefix.startswith('/sw') That's what I am using at the moment, but since it is possible to install fink somewhere else, it doesn't look like the ideal solution. > However... testing for Fink vs. MacPython is the Wrong Thing To Do. > You should just try and detect TclTkAqua versus X11 TclTkAqua, not > Fink vs MacPython. It's possible I would have to do it through Tkinter, but I couldn't find anything of use there. Perhaps the TclTkAqua people would be the ones to ask... I'll report if I find something. Konrad. From njriley at uiuc.edu Mon Sep 6 16:15:47 2004 From: njriley at uiuc.edu (Nicholas Riley) Date: Mon Sep 6 16:15:56 2004 Subject: [Pythonmac-SIG] Distinguishing between MacPython and Fink Python at runtime In-Reply-To: <08563B81-0003-11D9-8B8F-000A95999556@cnrs-orleans.fr> References: <6B07A076-FD96-11D8-89B2-000A95999556@cnrs-orleans.fr> <9625C7FC-FF46-11D8-A72B-000A95686CD8@redivi.com> <08563B81-0003-11D9-8B8F-000A95999556@cnrs-orleans.fr> Message-ID: <20040906141547.GA72721@uiuc.edu> On Mon, Sep 06, 2004 at 02:48:20PM +0200, hinsen@cnrs-orleans.fr wrote: > On Sep 5, 2004, at 16:19, Bob Ippolito wrote: > I would have to do it through Tkinter, but I couldn't find anything of > use there. Perhaps the TclTkAqua people would be the ones to ask... > I'll report if I find something. >>> import Tkinter >>> foo = Tkinter.Toplevel() >>> foo.winfo_server() 'QD10R30 Apple 1035' for Aqua, or you'd get back "X11..." for X11. Unfortunately, at least in the TkAqua 8.4.1 I have on my desktop G4, winfo_server (and the corresponding Tcl, 'winfo server') causes the process to crash: % wish % toplevel foo % winfo server .foo wish: line 2: 25264 Segmentation fault "$(dirname $0)/../../Applications/Utilities/Wish Shell.app/Contents/MacOS/Wish Shell" "$@" 0 libSystem.B.dylib 0x90006e70 strlen + 0x50 1 com.tcltk.tcllibrary 0x0a060240 Tcl_AppendResultVA + 0xec 2 com.tcltk.tcllibrary 0x0a060330 Tcl_AppendResult + 0x30 3 com.tcltk.tklibrary 0x0b0905a4 TkGetServerInfo + 0x74 4 com.tcltk.tklibrary 0x0b021500 Tk_WinfoObjCmd + 0x4b0 5 com.tcltk.tcllibrary 0x0a00e344 TclEvalObjvInternal + 0x2a4 6 com.tcltk.tcllibrary 0x0a030e10 TclExecuteByteCode + 0x94c 7 com.tcltk.tcllibrary 0x0a030408 TclCompEvalObj + 0x160 8 com.tcltk.tcllibrary 0x0a00efe8 Tcl_EvalObjEx + 0xc0 9 com.tcltk.tcllibrary 0x0a03c334 Tcl_RecordAndEvalObj + 0xb4 10 com.tcltk.tcllibrary 0x0a03c1f8 Tcl_RecordAndEval + 0x58 11 com.tcltk.tklibrary 0x0b048374 StdinProc + 0x130 12 com.tcltk.tcllibrary 0x0a044454 Tcl_NotifyChannel + 0x114 13 com.tcltk.tklibrary 0x0b0860cc FileHandlerEventProc + 0x7c 14 com.tcltk.tcllibrary 0x0a054380 Tcl_ServiceEvent + 0xa4 15 com.tcltk.tcllibrary 0x0a054750 Tcl_DoOneEvent + 0x16c 16 com.tcltk.tklibrary 0x0b02b60c Tk_MainLoop + 0x18 17 com.tcltk.tklibrary 0x0b048220 Tk_MainEx + 0x31c It works fine on my PowerBook with TkAqua 8.4.7, so it must have been fixed somewhere in between. -- =Nicholas Riley | From hinsen at cnrs-orleans.fr Tue Sep 7 19:19:48 2004 From: hinsen at cnrs-orleans.fr (hinsen@cnrs-orleans.fr) Date: Tue Sep 7 19:19:00 2004 Subject: [Pythonmac-SIG] Distinguishing between MacPython and Fink Python at runtime In-Reply-To: <20040906141547.GA72721@uiuc.edu> References: <6B07A076-FD96-11D8-89B2-000A95999556@cnrs-orleans.fr> <9625C7FC-FF46-11D8-A72B-000A95686CD8@redivi.com> <08563B81-0003-11D9-8B8F-000A95999556@cnrs-orleans.fr> <20040906141547.GA72721@uiuc.edu> Message-ID: <1F0D85BD-00F2-11D9-88BF-000A95999556@cnrs-orleans.fr> On Sep 6, 2004, at 16:15, Nicholas Riley wrote: >>>> import Tkinter >>>> foo = Tkinter.Toplevel() >>>> foo.winfo_server() > 'QD10R30 Apple 1035' > > for Aqua, or you'd get back "X11..." for X11. That looks useful, thanks! > Unfortunately, at least in the TkAqua 8.4.1 I have on my desktop G4, > winfo_server (and the corresponding Tcl, 'winfo server') causes the > process to crash: ... > It works fine on my PowerBook with TkAqua 8.4.7, so it must have been > fixed somewhere in between. > TkAqua is pretty unstable in general, so I am willing to take the point of view that everyone should update regularly. Konrad. From strauchdieb at gmx.de Tue Sep 7 23:37:31 2004 From: strauchdieb at gmx.de (Gabriel Birke) Date: Tue Sep 7 23:37:37 2004 Subject: [Pythonmac-SIG] Measuring the users idle time Message-ID: <1F67FA6C-0116-11D9-951C-003065B2C0E2@gmx.de> Hello! Is there any way to measure the the time the user was idle? Maybe with the Carbon call InstallEventLoopIdleTimer? I don't care if I get the number of seconds the user was idle or if I have to write the callback myself. Thanks Gabriel From hughejp at mac.com Thu Sep 9 14:23:25 2004 From: hughejp at mac.com (james hughes) Date: Thu Sep 9 14:23:37 2004 Subject: [Pythonmac-SIG] Installing MacPython-Panther on Tiger... Message-ID: <0C6091F9-025B-11D9-B1D5-000A95A27482@mac.com> I am clearly trying to something that should not work, but here goes... Any help will be gratefully appreciated. Thanks On Aug 15, 2004, at 12:46 PM, Rodney Somerstein wrote: > According to public information (Apple has released the code), the > build of Tiger as of WWDC uses Python 2.3.3. There is, of course, > plenty of time for this to change.. but you can assume at least 2.3.3. > Since it is the same major version of Python, anything compiled against > the Python 2.3.0 on Mac OS X 10.3 should just work with 10.4's (and > vice versa, to a large extent). I would like to confirm that the developers release of 10.4 is indeed 2.3.3. % python Python 2.3.3 (#1, Jun 12 2004, 21:10:18) [GCC 3.3 20030304 (Apple Computer, Inc. build 1656)] on darwin The log from the install is Sep 9 08:14:48 : Installer App Built on Jun 21 2004 at 17:47:34 Sep 9 08:14:48 : Hardware Model: PowerBook5,1 @ 999 MHz, 2048 MB Sep 9 08:14:48 : Running OS Build: 8A171 Sep 9 08:14:48 : ATS:OFAGetFontMetrics is obsolete, please call GCGetStrikeInfo instead. (this is most likely #3636855. Unless you are making the call directly, please ignore this message.) Sep 9 08:14:48 : MacPython-Panther Installation Log Sep 9 08:14:48 : Opened from: /Volumes/MacPython-Panther-2.3-2/MacPython-Panther.pkg Sep 9 08:14:56 : ======================================== Sep 9 08:14:56 : User chose Easy Install Sep 9 08:14:56 : Items to be installed Sep 9 08:14:56 : MacPython-Panther: Install Sep 9 08:14:56 : ======================================== Sep 9 08:15:02 : Creating temporary directory "/private/tmp/.Install-temp/.MacPython-Panther.pkg.23760" Sep 9 08:15:02 : Removed existing directory at /private/tmp/.Install-temp Sep 9 08:15:02 : Running Writing receipt for MacPython-Panther Sep 9 08:15:05 : Finished Writing receipt for MacPython-Panther Sep 9 08:15:05 : Running Extracting files from MacPython-Panther Sep 9 08:15:06 : pkgExtractor[23768]: 2004-09-09 08:15:06.006 pkgExtractor[23768] BomFatalError - cpio read error: bad file format Sep 9 08:15:08 : Finished Extracting files from MacPython-Panther Sep 9 08:15:08 : Install failed: Some files for MacPython-Panther may not have been written correctly. From njriley at uiuc.edu Thu Sep 9 17:04:40 2004 From: njriley at uiuc.edu (Nicholas Riley) Date: Thu Sep 9 17:04:47 2004 Subject: [Pythonmac-SIG] Measuring the users idle time In-Reply-To: <1F67FA6C-0116-11D9-951C-003065B2C0E2@gmx.de> References: <1F67FA6C-0116-11D9-951C-003065B2C0E2@gmx.de> Message-ID: <20040909150440.GB39285@uiuc.edu> On Tue, Sep 07, 2004 at 11:37:31PM +0200, Gabriel Birke wrote: > Is there any way to measure the the time the user was idle? There is, but unfortunately I have not been able to figure out a way to exclude the effects of application-generated calls to UpdateSystemActivity(), which resets the idle time to 0. UpdateSystemActivity is used by most audio/video players to stop displays from blanking, and so forth. Here's the code. I ripped it out of a larger module, so there might be a few syntax errors that cause it not to compile as is. /* compile with distutils as: setup( # ... ext_modules=[Extension('_watch', sources=['_watchmodule.c'], extra_link_args=['-framework', 'ApplicationServices', '-framework', 'IOKit'])] */ #include "Python.h" #include "pymactoolbox.h" #include #include static PyObject * watch_idleseconds(PyObject *self, PyObject *args) { io_registry_entry_t hidSystemService; hidSystemService = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOHIDSystem")); if (hidSystemService == NULL) { PyErr_SetString(PyExc_OSError, "Couldn't get IORegistry entry for IOHIDSystem"); return NULL; } CFMutableDictionaryRef propertyDict = NULL; IOReturn result = IORegistryEntryCreateCFProperties(hidSystemService, &propertyDict, kCFAllocatorDefault, 0); IOObjectRelease(hidSystemService); if (result != KERN_SUCCESS || propertyDict == NULL) { PyErr_SetString(PyExc_OSError, "Couldn't get properties for IOHIDSystem"); return NULL; } PyObject *pyIdleSeconds = NULL; CFTypeRef idleTime = CFDictionaryGetValue(propertyDict, CFSTR("HIDIdleTime")); if (idleTime == NULL) { PyErr_SetString(PyExc_OSError, "IOHIDSystem had no HIDIdleTime property\n"); goto cleanup; } CFTypeID idleType = CFGetTypeID(idleTime); int64_t idleNanoseconds; if (idleType == CFDataGetTypeID()) // Jaguar CFDataGetBytes((CFDataRef)idleTime, CFRangeMake(0, sizeof(idleNanoseconds)), (UInt8*) &idleNanoseconds); else if (idleType == CFNumberGetTypeID()) // Panther and later CFNumberGetValue((CFNumberRef)idleTime, kCFNumberSInt64Type, &idleNanoseconds); else { PyErr_SetString(PyExc_OSError, "Couldn't understand idle time (not CFData or CFNumber)"); goto cleanup; } pyIdleSeconds = PyLong_FromLongLong(idleNanoseconds / kSecondScale); cleanup: CFRelease(propertyDict); return pyIdleSeconds; } static PyMethodDef _watch_methods[] = { {"idleseconds", watch_idleseconds, METH_NOARGS, "idleseconds() -> long integer\n\n" "Return the number of seconds since a keyboard/mouse movement."}, {NULL, NULL, 0, NULL} }; PyMODINIT_FUNC init_watch(void) { (void)Py_InitModule("_watch", _watch_methods); } -- =Nicholas Riley | From rowen at u.washington.edu Thu Sep 9 18:52:03 2004 From: rowen at u.washington.edu (Russell E Owen) Date: Thu Sep 9 18:52:08 2004 Subject: [Pythonmac-SIG] bundlebuilder question: snack (tcl extension) Message-ID: Any ideas on getting snack (a tcl extension that supports sound) installed in a Python application via bundlebuilder? I think it may have worked at one time (e.g. perhaps with an older version of tcl/tk) but it certainly is not working now. The snack shared library is not copied into the bundle. I've tried various locations for the shared library, but no success so far. Any hints would be gratefully received. Also, any suggestions for a better sound package. All I want to do is play sound queues in a Tkinter-based Python application. (Thus all I want to do is play sound files asynchronously). Snack seems to work, but installation is a bit of a pain. -- Russell From hengist.podd at virgin.net Thu Sep 9 18:57:48 2004 From: hengist.podd at virgin.net (has) Date: Thu Sep 9 18:57:49 2004 Subject: [Pythonmac-SIG] appscript 0.6.0 tentatively posted Message-ID: Hi all, New, preview-ish version of appscript (0.6.0) now posted at: Feel free to kick the wheels. :) This is a ground-up rewrite, implementing appscript as a wrapper round the lower-level aem package. It lacks the automatic reference validation of previous versions (this could be provided as an optional extension) so won't catch user errors like badly-formed references. OTOH, it's much more forgiving of buggy application terminology resources (a common problem). References also lack built-in help() methods at this point, though could add them in again later if folk think they'd be useful. Sorting out documentation is next, after which I'll start on Apple Event Object Model support for aem.receive. Comments, suggestions, brickbats, etc. to the usual address, ta. has p.s. One minor change in the aem and appscript APIs: the NOT() method used in constructing test references has been replaced with a NOT property. Otherwise, they should be identical to before. -- http://freespace.virgin.net/hamish.sanderson/ From brian at simpleprojectmanagement.com Thu Sep 9 21:21:19 2004 From: brian at simpleprojectmanagement.com (Brian Christensen) Date: Thu Sep 9 21:18:56 2004 Subject: [Pythonmac-SIG] Error in loading Bundle on Mac OS X 10.3.4 Message-ID: <6D91DE03-0295-11D9-99BC-000393D72CDE@simpleprojectmanagement.com> I posted this problem to the wxPython-mac list, but no one there was able to solve the problem. Maybe you folks can help. -------- My wxPython application works perfectly on my Mac OS X 10.3.4 test machine, but it does not load for one of my users. He also has Mac OS X 10.3.4 installed. He has tried in on both his laptop and desktop machines with the same result. I appreciate your help in trying to track down this problem. I have some additional data that may help to track down this problem. I have the output of the "set" command on both the users machine and my test machine. I also have the results of the "otools -L" command from my development machine. It has been a couple of weeks since my last post on this so I will repeat the error message he is getting: ===== Wed Jul 14 2004 ===== 17:47:12 US/Pacific ===== Traceback (most recent call last): ??File "/Users/andycarter/Desktop/GanttPV v0.1.1 Folder/GanttPV.app/Contents/Resources/GanttPV.py", line 45, in ? ????import wx ??File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/wx/__init__.py", line 19, in ? ??File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/wx/core.py", line 4, in ? ??File "", line 11, in ? ??File "", line 9, in __load ImportError: Failure linking new module: /usr/lib/wxPython-2.5.1.5/lib/libwx_base_carbond_xml-2.5.1.dylib: dyld: /Users/andycarter/Desktop/GanttPV v0.1.1 Folder/GanttPV.app/Contents/MacOS/GanttPV can't open library: /usr/lib/wxPython-2.5.1.5/lib/libwx_base_carbond_xml-2.5.1.dylib ?(No such file or directory, errno = 2) ------ end of error message ----- ------ Response from wxPython-mac list ------- > Any ideas what may be causing the problem? Or any suggestions what I > could check next? Unfortunately I have no ideas. The wxPython extension modules will have encoded in them the paths to the wxMac dylibs they use, but setting DYLD_LIBRARY_PATH will cause the dynamic loader to look in that location first. What appears to be happening is that the DYLD_LIBRARY_PATH being put in os.environ in the bundle's startup script is being ignored for some reason and so the loader is still looking in the compiled in path, which doesn't exist. I fooled around with this for a while this morning by building a standalone bundle for the superdoodle sample. I then moved my installed wxMac libs to another location so they wouldn't be found by the bundle. The bundle loaded and ran fine. I then tweaked the startup script so that it wasn't setting DYLD_LIBRARY_PATH and then I got an error just like what you reported. The only other thing I can think of to try is to build your bundle on a Panther system and see if it makes any difference. (You could even do semi-standalone in that case to not include the Python framework since it will already be on the target machines.) -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! ------ end of wxPython-mac list response ------ The following is the information I included in my post to the wxPython-mac list: This is the contents of the python file in the bundle that that tells the Mac where to find the library files. ----------- start of file ------------------------------ #!/usr/bin/python import sys, os execdir = os.path.dirname(sys.argv[0]) executable = os.path.join(execdir, "Python") resdir = os.path.join(os.path.dirname(execdir), "Resources") libdir = os.path.join(os.path.dirname(execdir), "Frameworks") mainprogram = os.path.join(resdir, "GanttPV.py") sys.argv.insert(1, mainprogram) if 1 or 0: ????os.environ["PYTHONPATH"] = resdir ????if 1: ????????os.environ["PYTHONHOME"] = resdir else: ????pypath = os.getenv("PYTHONPATH", "") ????if pypath: ????????pypath = ":" + pypath ????os.environ["PYTHONPATH"] = resdir + pypath os.environ["PYTHONEXECUTABLE"] = executable os.environ["DYLD_LIBRARY_PATH"] = libdir os.environ["DYLD_FRAMEWORK_PATH"] = libdir os.execve(executable, sys.argv, os.environ) ----------- end of file ------------------------------ Per my request, the user opened the Mac bundle and confirmed that the "missing" file is there. On Wednesday, July 21, 2004, at 03:17 PM, Brian Christensen wrote: > > On Tuesday, July 20, 2004, at 06:00 PM, Robin Dunn wrote: > >> Brian Christensen wrote: >> >>> I have confirmed that the library files are copied to the right >>> directory. What makes this particularly troublesome is that I now >>> have a test machine that uses the same version of Mac OS X 10.3.4 >>> that my user has, but it works fine on my test machine! >> >> Does your test machine have wxPython installed? > > No my test machine doesn't have wxPython installed. My test machine does not have the Mac development tools installed either. > >> >> >>> What could make it work correctly on one machine, but not on the >>> other? >>> Is there something else that could be changing the DYLD_LIBRARY_PATH >>> after the "os.execve" but before it tries to load the library >>> module? Some script file that is being automatically loaded >>> somewhere in the middle of the process? >> >> Not that I know of, but that isn't saying much when it comes to OSX. >> Perhaps there are some other environment variables that are set that >> are affecting things. Try getting them to send you the output of >> "set" from a terminal window. > > I have sent an email to ask. Hopefully he will answer. I'm concerned > he may have given up on it. Here is the result of the set command on the user's machine that will not run the program: ------- Begin - User Mac -------- Last login: Wed Jul 21 13:49:08 on console Welcome to Darwin! ClearCube3:~ andycarter$ set BASH=/bin/bash BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="powerpc-apple-darwin7.0") BASH_VERSION='2.05b.0(1)-release' COLUMNS=80 DIRSTACK=() EUID=501 GROUPS=() HISTFILE=/Users/andycarter/.bash_history HISTFILESIZE=500 HISTSIZE=500 HOME=/Users/andycarter HOSTNAME=ClearCube3.local HOSTTYPE=powerpc IFS=$' \t\n' LINES=24 LOGNAME=andycarter MACHTYPE=powerpc-apple-darwin7.0 MAILCHECK=60 OPTERR=1 OPTIND=1 OSTYPE=darwin7.0 PATH=/bin:/sbin:/usr/bin:/usr/sbin PIPESTATUS=([0]="0") PPID=961 PS1='\h:\w \u\$ ' PS2='> ' PS4='+ ' PWD=/Users/andycarter SECURITYSESSIONID=2100d0 SHELL=/bin/bash SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive- comments: monitor SHLVL=1 TERM=xterm-color TERM_PROGRAM=Apple_Terminal TERM_PROGRAM_VERSION=100 UID=501 USER=andycarter _=/etc/bashrc __CF_USER_TEXT_ENCODING=0x1F5:0:0 ------ End - User Mac ------- Here is the result from my test machine that does run the program: ------- Begin - Test Mac -------- Last login: Tue Aug 10 04:42:10 on console Welcome to Darwin! iMac:~ avc$ set BASH=/bin/bash BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="powerpc-apple-darwin7.0") BASH_VERSION='2.05b.0(1)-release' COLUMNS=80 DIRSTACK=() EUID=502 GROUPS=() HISTFILE=/Users/avc/.bash_history HISTFILESIZE=500 HISTSIZE=500 HOME=/Users/avc HOSTNAME=iMac.local HOSTTYPE=powerpc IFS=$' \t\n' LINES=24 LOGNAME=avc MACHTYPE=powerpc-apple-darwin7.0 MAILCHECK=60 OPTERR=1 OPTIND=1 OSTYPE=darwin7.0 PATH=/bin:/sbin:/usr/bin:/usr/sbin PIPESTATUS=([0]="0") PPID=497 PS1='\h:\w \u\$ ' PS2='> ' PS4='+ ' PWD=/Users/avc SECURITYSESSIONID=20f660 SHELL=/bin/bash SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive- comments:monitor SHLVL=1 TERM=xterm-color TERM_PROGRAM=Apple_Terminal TERM_PROGRAM_VERSION=100 UID=502 USER=avc _=/etc/bashrc __CF_USER_TEXT_ENCODING=0x1F6:0:0 ------ End - Test Mac ------- >> You could also try using "otool -L" on _core.so with and without >> DYLD_LIBRARY_PATH set to see what it is trying to load in each case. > > When I type "otool" I get "otool: Command not found." I guess that > would be because I don't have the Apple developer tools installed. > This is what I get from otool on my development Mac (Mac OS X 10.2.8): ----- Begin ----- [G4:Resources/ExtensionModules/wx] bcc% otool -L _core.so _core.so: /Library/Frameworks/Python.framework/Versions/2.3/Python (compatibility version 2.3.0, current version 2.3.0) /usr/lib/wxPython-2.5.1.5/lib/libwx_macd_html-2.5.1.dylib (compatibility version 2.5.1, current version 2.5.1) /usr/lib/wxPython-2.5.1.5/lib/libwx_macd_adv-2.5.1.dylib (compatibility version 2.5.1, current version 2.5.1) /usr/lib/wxPython-2.5.1.5/lib/libwx_macd_core-2.5.1.dylib (compatibility version 2.5.1, current version 2.5.1) /usr/lib/wxPython-2.5.1.5/lib/libwx_base_carbond_xml-2.5.1.dylib (compatibility version 2.5.1, current version 2.5.1) /usr/lib/wxPython-2.5.1.5/lib/libwx_base_carbond_net-2.5.1.dylib (compatibility version 2.5.1, current version 2.5.1) /usr/lib/wxPython-2.5.1.5/lib/libwx_base_carbond-2.5.1.dylib (compatibility version 2.5.1, current version 2.5.1) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 122.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 63.0.0) [G4:Resources/ExtensionModules/wx] bcc% ----- End ----- Any ideas what may be causing the problem? Or any suggestions what I could check next? (Andy, Thanks for your help in trying to track this down. -- Brian) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 9659 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040909/df99ee0d/attachment-0001.bin From rtjohan at syspres.com Fri Sep 10 20:00:25 2004 From: rtjohan at syspres.com (rtjohan@syspres.com) Date: Fri Sep 10 20:00:46 2004 Subject: [Pythonmac-SIG] MacPython Syntax Highlighting? Message-ID: <4AEF0D6E-0353-11D9-A941-000A95A89CC8@syspres.com> Hello, Just starting to use MacPython, but was surprised to see the default setup doesn't seems to have syntax highlighting. Is there a way to enable that? When used IDLE when suffering on Windows, I believe IDLE did have this feature. Thanks, Richard From altis at semi-retired.com Fri Sep 10 20:25:08 2004 From: altis at semi-retired.com (Kevin Altis) Date: Fri Sep 10 20:25:11 2004 Subject: [Pythonmac-SIG] \r in string causes eval to fail Message-ID: I've run into a problem with eval on the Mac and I'm not sure whether it is a bug or expected behavior. The problem is that if \r is used as the line terminator instead of \n then it causes eval to fail. I ran into this while copying and pasting some text to eval and the clipboard had converted my newlines to returns. Here is an example done in the shell. As you can see below, using newlines as a separator is fine, but return (\r) isn't. This would probably only come up on the Mac where return (CR, \r) is the default line terminator, but I didn't know whether universal newlines support was supposed to deal with this kind of issue. >>> s = """{'type':'Button',\r'name':'Button1',\r'position':(10, 10),\r'label':'Button1',\r}""" >>> s2 = s.replace('\r', '\n') >>> eval(s2) {'position': (10, 10), 'type': 'Button', 'name': 'Button1', 'label': 'Button1'} >>> eval(s) Traceback (most recent call last): File "", line 1, in ? File "", line 1 {'type':'Button', 'name':'Button1', 'position':(10, 10), 'label':'Button1', } ^ SyntaxError: invalid syntax >>> ka From rtjohan at syspres.com Fri Sep 10 20:26:58 2004 From: rtjohan at syspres.com (rtjohan@syspres.com) Date: Fri Sep 10 20:27:23 2004 Subject: [Pythonmac-SIG] MacPython Syntax Highlighting? In-Reply-To: <4AEF0D6E-0353-11D9-A941-000A95A89CC8@syspres.com> References: <4AEF0D6E-0353-11D9-A941-000A95A89CC8@syspres.com> Message-ID: <00388F24-0357-11D9-A941-000A95A89CC8@syspres.com> The program I'm referring to is PythonIDE, but seems to be referred to as MacPython also. Anyhow, would be great if can turn on syntax highlighting in this program. > Hello, > > Just starting to use MacPython, but was surprised to see the default > setup doesn't seems to have syntax highlighting. Is there a way to > enable that? When used IDLE when suffering on Windows, I believe IDLE > did have this feature. > > Thanks, > Richard > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From rtjohan at syspres.com Fri Sep 10 20:41:23 2004 From: rtjohan at syspres.com (rtjohan@syspres.com) Date: Fri Sep 10 20:41:45 2004 Subject: [Pythonmac-SIG] PythonIDE w/ DarwinPorts Python? Message-ID: <03E0D98C-0359-11D9-A941-000A95A89CC8@syspres.com> Been using darwin ports to install postgresql, python, apache2, psycopg with great success on MacOSX 10.3.5. So, I use the darwin ports python which is installed in /opt/local/bin/python. Wondering how to tell PythonIDE to use this darwin python instead of the built-in python. The darwin python contains all the python packages. One way I can think of is to use softlink to redirect to darwin python. Hate to be messing with the default install though, would imagine there is some configuration file that can be modified instead. Any tips most welcome. Thanks, Richard From bob at redivi.com Fri Sep 10 20:41:50 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Sep 10 20:42:26 2004 Subject: [Pythonmac-SIG] \r in string causes eval to fail In-Reply-To: References: Message-ID: <13B2EA34-0359-11D9-A274-000A95686CD8@redivi.com> On Sep 10, 2004, at 2:25 PM, Kevin Altis wrote: > I've run into a problem with eval on the Mac and I'm not sure whether > it is a bug or expected behavior. The problem is that if \r is used as > the line terminator instead of \n then it causes eval to fail. I ran > into this while copying and pasting some text to eval and the > clipboard had converted my newlines to returns. Here is an example > done in the shell. As you can see below, using newlines as a separator > is fine, but return (\r) isn't. This would probably only come up on > the Mac where return (CR, \r) is the default line terminator, but I > didn't know whether universal newlines support was supposed to deal > with this kind of issue. > > >>> s = """{'type':'Button',\r'name':'Button1',\r'position':(10, > 10),\r'label':'Button1',\r}""" > >>> s2 = s.replace('\r', '\n') > >>> eval(s2) "Universal newlines" is only a mode for the file object (as far as I know anyway). eval and compile take strings. It would be a lot more portable to do this to normalize your input strings: '\n'.join(s.splitlines()) splitlines is essentially universal newlines support at the string level. It might be smart to do this internally, maybe this deserves a feature request or bug report? -bob From gandreas at visi.com Fri Sep 10 21:10:14 2004 From: gandreas at visi.com (Glenn Andreas) Date: Fri Sep 10 21:10:44 2004 Subject: [Pythonmac-SIG] MacPython Syntax Highlighting? In-Reply-To: <4AEF0D6E-0353-11D9-A941-000A95A89CC8@syspres.com> References: <4AEF0D6E-0353-11D9-A941-000A95A89CC8@syspres.com> Message-ID: At 11:00 AM -0700 9/10/04, rtjohan@syspres.com wrote: >Hello, > >Just starting to use MacPython, but was surprised to see the default >setup doesn't seems to have syntax highlighting. Is there a way to >enable that? When used IDLE when suffering on Windows, I believe >IDLE did have this feature. Give PyOXIDE a try: -- Glenn Andreas gandreas@gandreas.com oh my! Mad, Bad, and Dangerous to Know From djacomy at yahoo.fr Sat Sep 11 00:10:24 2004 From: djacomy at yahoo.fr (Damien JACOMY) Date: Sat Sep 11 00:06:01 2004 Subject: [Pythonmac-SIG] Mac OS X 10.3 and Tkinter Message-ID: Hi folks, the IDE crashes every time when running this test : import _tkinter => ok import Tkinter => ok Tkinter._test() => the widget open and then CRASH!!!! the stack trace in the Console window is : Fatal Python error: PyEval_SaveThread: NULL tstate Thanks for you help. -- Damien JACOMY From ksenia at ksenia.nl Sat Sep 11 01:34:57 2004 From: ksenia at ksenia.nl (Ksenia Marasanova) Date: Sat Sep 11 01:36:01 2004 Subject: [Pythonmac-SIG] IDE with vi keybindings Message-ID: <06748AA2-0382-11D9-9CCD-000A957911BC@ksenia.nl> Hi, I currently use Vim for Python coding and I am quite happy with it. However, from time to time I google for a 'real' IDE, but there's seems to be not much results... So this time I want to ask: Can anybody recommend a (Python) editor / IDE, which runs on OSX and has vi key bindings? Except for Vim :) Thanks! Ksenia. From Larry.A.Meyn at nasa.gov Sat Sep 11 03:00:28 2004 From: Larry.A.Meyn at nasa.gov (Larry Meyn) Date: Sat Sep 11 03:00:36 2004 Subject: [Pythonmac-SIG] Mac OS X 10.3 and Tkinter In-Reply-To: References: Message-ID: Damien, Your answer can be found in the MacPython FAQ located at http://www.pythonmac.org/wiki/FAQ I've copied the relevant FAQ below. Good luck! Larry 3.7 The IDE crashes when I run a Tkinter script (PyObjC script, wxPython script) The IDE uses the old Carbon GUI toolbox for its windowing. Trying to run a script that brings in its own GUI toolbox (such as Tck/Tk, Cocoa, wxWindows or anything else) will cause great confusion: redraws and events for the toolboxes will be sent to the wrong place, etc. At best things will not work as expected, at worst the IDE will crash. For the time being you should run almost all scripts that use a windowing toolbox outside the IDE, either with the pythonw program from a Terminal window or with PythonLauncher from the Finder. On Sep 10, 2004, at 3:10 PM, Damien JACOMY wrote: > Hi folks, > > the IDE crashes every time when running this test : > import _tkinter => ok > import Tkinter => ok > Tkinter._test() => the widget open and then CRASH!!!! > > the stack trace in the Console window is : > Fatal Python error: PyEval_SaveThread: NULL tstate > > Thanks for you help. > > -- > Damien JACOMY > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > Larry Meyn Aerospace Operations Modeling Office M/S 210-10 NASA Ames Research Center Moffett Field, CA 94035-1000 E-mail: Larry.A.Meyn@nasa.gov Phone: (650) 604-5038 Fax: (650) 604-0222 E-Fax: (425) 944-5526 sent via e-mail -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2110 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040910/4ec1aa90/attachment.bin From djacomy at yahoo.fr Sat Sep 11 08:51:39 2004 From: djacomy at yahoo.fr (Damien JACOMY) Date: Sat Sep 11 08:47:17 2004 Subject: [Pythonmac-SIG] Mac OS X 10.3 and Tkinter In-Reply-To: Message-ID: > Larry, > > Thanks for this piece of in formation. I haven?t seen this page yet. > But the problem is greater than I think. > I can?t use the module Tkinter without IDE, > because when I use a windowing toolbox outside the IDE, I have another error : > ImportError: No module named _tkinter, > although the module _tkinter was installed by package manager. > > Thanks > > Damien, > > > > > Damien, > > Your answer can be found in the MacPython FAQ located at > http://www.pythonmac.org/wiki/FAQ > I've copied the relevant FAQ below. Good luck! > > Larry > > 3.7 The IDE crashes when I run a Tkinter script (PyObjC script, wxPython > script) > > The IDE uses the old Carbon GUI toolbox for its windowing. Trying to run a > script that brings in its own GUI toolbox (such as Tck/Tk, Cocoa, wxWindows or > anything else) will cause great confusion: redraws and events for the > toolboxes will be sent to the wrong place, etc. At best things will not work > as expected, at worst the IDE will crash. > > For the time being you should run almost all scripts that use a windowing > toolbox outside the IDE, either with the pythonw program from a Terminal > window or with PythonLauncher from the Finder. > > On Sep 10, 2004, at 3:10 PM, Damien JACOMY wrote: > >> Hi folks, >> >> the IDE crashes every time when running this test : >> import _tkinter => ok >> import Tkinter => ok >> Tkinter._test() => the widget open and then CRASH!!!! >> >> the stack trace in the Console window is : >> Fatal Python error: PyEval_SaveThread: NULL tstate >> >> Thanks for you help. >> >> -- >> Damien JACOMY >> >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG@python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> > Larry Meyn > Aerospace Operations Modeling Office > > M/S 210-10 > NASA Ames Research Center > Moffett Field, CA 94035-1000 > > E-mail: Larry.A.Meyn@nasa.gov > Phone: (650) 604-5038 > Fax: (650) 604-0222 > E-Fax: (425) 944-5526 sent via e-mail > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20040911/ce90919e/attachment-0001.html From Larry.A.Meyn at nasa.gov Sat Sep 11 18:01:09 2004 From: Larry.A.Meyn at nasa.gov (Larry Meyn) Date: Sat Sep 11 18:01:23 2004 Subject: [Pythonmac-SIG] Mac OS X 10.3 and Tkinter In-Reply-To: References: Message-ID: Damien, You might have more than one Python installed on your machine. This is a subject that also deserves a FAQ entry, but there have been several mailing list postings on the subject. As a start, try typing "which python" on the the Terminal command line and see if the result is "/usr/bin/python", if it isn't you may not be running Jack's MacPython from the command line. I don't remember the best way to solve this problem, but I believe that you can find helpful information in the Pythonmac-SIG postings from the last couple of months. Larry On Sep 10, 2004, at 11:51 PM, Damien JACOMY wrote: > Larry, > > Thanks for this piece of in formation. I haven?t seen this page yet. > But the problem is greater than I think. > I can?t use the module Tkinter without IDE, > because when I use a windowing toolbox outside the IDE, I have > another error : ImportError: No module named _tkinter, > although the module _tkinter was installed by package manager. > > Thanks > > Damien, > > > > > Damien, > > Your answer can be found in the MacPython FAQ located at > ?http://www.pythonmac.org/wiki/FAQ ? > I've copied the relevant FAQ below. ?Good luck! > > Larry > > 3.7 The IDE crashes when I run a Tkinter script (PyObjC script, > wxPython script) > > The IDE uses the old Carbon GUI toolbox for its windowing. Trying to > run a script that brings in its own GUI toolbox (such as Tck/Tk, > Cocoa, wxWindows or anything else) will cause great confusion: redraws > and events for the toolboxes will be sent to the wrong place, etc. At > best things will not work as expected, at worst the IDE will crash. > > ?For the time being you should run almost all scripts that use a > windowing toolbox outside the IDE, either with the pythonw program > from a Terminal window or with PythonLauncher from the Finder. > ? > On Sep 10, 2004, at 3:10 PM, Damien JACOMY wrote: > > > Hi folks, > > the IDE crashes every time when running this test : > import _tkinter ?=> ok > import Tkinter ?=> ok > Tkinter._test() ?=> the widget open and then CRASH!!!! > > ?the stack trace in the Console window is : > Fatal Python error: PyEval_SaveThread: NULL tstate > > Thanks for you help. > > -- ? > Damien JACOMY > > > > _______________________________________________ > Pythonmac-SIG maillist ?- ?Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > > > Larry Meyn > Aerospace Operations Modeling Office > > M/S 210-10 ?????????????????????? > NASA Ames Research Center ??????? > Moffett Field, CA 94035-1000 ???? > ???????????????????????????????? > E-mail: Larry.A.Meyn@nasa.gov > Phone: ?(650) 604-5038 > Fax: ???(650) 604-0222 > E-Fax: ?(425) 944-5526 sent via e-mail ? > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 5289 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040911/e3ca1463/attachment.bin From Jack.Jansen at cwi.nl Sat Sep 11 18:55:18 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sat Sep 11 18:55:21 2004 Subject: [Pythonmac-SIG] bundlebuilder question: snack (tcl extension) In-Reply-To: References: Message-ID: <5C7E480E-0413-11D9-85A2-000D934FF6B4@cwi.nl> On 10 Sep 2004, at 01:52, Russell E Owen wrote: > Also, any suggestions for a better sound package. All I want to do is > play sound queues in a Tkinter-based Python application. (Thus all I > want to do is play sound files asynchronously). Snack seems to work, > but installation is a bit of a pain. My first choices would be Sound Manager (Carbon.Snd) or quicktime (Carbon.Qt). Sound Manager should not interfere with Tkinter (at least, I can't see how it could), but it's a rather old toolbox (and so is the Python interface) so it can be a bit quirky to get working. But there are examples. Actually, I think the Audio_mac module (in Lib/plat-mac) may already do what you want, just make sure you keep it fed with enough samples (for example in a Tkinter timer callback). If it doesn't do the right thing it's a good example anyway. Caveat: I haven't used this module in a long time, and I'm not sure anyone else ever did. QuickTime needs to be told not to open visual elements (such as it's playback control panel), and then it should be fine with Tkinter 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 Jack.Jansen at cwi.nl Sat Sep 11 19:02:28 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sat Sep 11 19:02:31 2004 Subject: [Pythonmac-SIG] Error in loading Bundle on Mac OS X 10.3.4 In-Reply-To: <6D91DE03-0295-11D9-99BC-000393D72CDE@simpleprojectmanagement.com> References: <6D91DE03-0295-11D9-99BC-000393D72CDE@simpleprojectmanagement.com> Message-ID: <5CAE914E-0414-11D9-85A2-000D934FF6B4@cwi.nl> On 10 Sep 2004, at 04:21, Brian Christensen wrote: > ImportError: Failure linking new module: > /usr/lib/wxPython-2.5.1.5/lib/libwx_base_carbond_xml-2.5.1.dylib: > dyld: /Users/andycarter/Desktop/GanttPV v0.1.1 > Folder/GanttPV.app/Contents/MacOS/GanttPV can't open library: > /usr/lib/wxPython-2.5.1.5/lib/libwx_base_carbond_xml-2.5.1.dylib ?(No > such file or directory, errno = 2) As you seem to have found out by n ow this is the culprit: the dynamic linker (dyld) can't find the library named "libwx_base_carbond_xml-2.5.1.dylib". As the rest of your message seems to say that you have set DYLD_LIBRARY_PATH, there are a couple of possible problems: - libwx_base_carbond_xml-2.5.1.dylib really isn't on DYLD_LIBRARY_PATH, or it is a symlink pointing into thin air (i.e. back into the /usr/lib space, to a file that isn't there) - DYLD_LIBRARY_PATH somehow isn't really set. Check by adding system("printenv") to you code at a strategic place. - DYLD_LIBRARY_PATH is being ignored, for instance because the user is running set-UID. There's another environment variable you could set to debug this, DYLD_PRINT_LIBRARIES. Actually, there's quite a few that may help, see "man dyld" for a list of all the environment variables that influence the dynamic loader. Please let us hear the results, -- 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 Sep 11 19:06:08 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sat Sep 11 19:06:12 2004 Subject: [Pythonmac-SIG] PythonIDE w/ DarwinPorts Python? In-Reply-To: <03E0D98C-0359-11D9-A941-000A95A89CC8@syspres.com> References: <03E0D98C-0359-11D9-A941-000A95A89CC8@syspres.com> Message-ID: On 11 Sep 2004, at 03:41, rtjohan@syspres.com wrote: > Been using darwin ports to install postgresql, python, apache2, > psycopg with great success on MacOSX 10.3.5. So, I use the darwin > ports python which is installed in /opt/local/bin/python. Wondering > how to tell PythonIDE to use this darwin python instead of the > built-in python. The darwin python contains all the python packages. For PythonIDE (or other applets) you could change the main program and make it execute /opt/local/bin/python, but make sure you change the invocation that runs the eventual main program, not the #! line (which only runs the bootstrap program). But note you're on uncharted territory here... -- 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 Sep 11 19:08:38 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sat Sep 11 19:08:42 2004 Subject: [Pythonmac-SIG] MacPython Syntax Highlighting? In-Reply-To: <00388F24-0357-11D9-A941-000A95A89CC8@syspres.com> References: <4AEF0D6E-0353-11D9-A941-000A95A89CC8@syspres.com> <00388F24-0357-11D9-A941-000A95A89CC8@syspres.com> Message-ID: <396C3EB6-0415-11D9-85A2-000D934FF6B4@cwi.nl> On 11 Sep 2004, at 03:26, rtjohan@syspres.com wrote: > The program I'm referring to is PythonIDE, but seems to be referred to > as MacPython also. Anyhow, would be great if can turn on syntax > highlighting in this program. The current PythonIDE is at the end of its life. A new one will come (but not in the next release). In the mean time you could use PyOxide, as Kevin suggests. There's also a provisional syntax coloring module for PythonIDE, but I don't know much about it, I'll leave it to other people to point out where it is and how it works. -- 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 altis at semi-retired.com Sat Sep 11 19:23:34 2004 From: altis at semi-retired.com (Kevin Altis) Date: Sat Sep 11 19:23:39 2004 Subject: [Pythonmac-SIG] \r in string causes eval to fail In-Reply-To: <13B2EA34-0359-11D9-A274-000A95686CD8@redivi.com> References: <13B2EA34-0359-11D9-A274-000A95686CD8@redivi.com> Message-ID: <4F27A010-0417-11D9-89A4-000A9598382A@semi-retired.com> On Sep 10, 2004, at 11:41 AM, Bob Ippolito wrote: > > On Sep 10, 2004, at 2:25 PM, Kevin Altis wrote: > >> I've run into a problem with eval on the Mac and I'm not sure whether >> it is a bug or expected behavior. The problem is that if \r is used >> as the line terminator instead of \n then it causes eval to fail. I >> ran into this while copying and pasting some text to eval and the >> clipboard had converted my newlines to returns. Here is an example >> done in the shell. As you can see below, using newlines as a >> separator is fine, but return (\r) isn't. This would probably only >> come up on the Mac where return (CR, \r) is the default line >> terminator, but I didn't know whether universal newlines support was >> supposed to deal with this kind of issue. >> >> >>> s = """{'type':'Button',\r'name':'Button1',\r'position':(10, >> 10),\r'label':'Button1',\r}""" >> >>> s2 = s.replace('\r', '\n') >> >>> eval(s2) > > "Universal newlines" is only a mode for the file object (as far as I > know anyway). eval and compile take strings. > > It would be a lot more portable to do this to normalize your input > strings: > > '\n'.join(s.splitlines()) > > splitlines is essentially universal newlines support at the string > level. It might be smart to do this internally, maybe this deserves a > feature request or bug report? > I double-checked and eval doesn't like \r\n line endings either as you would get on Windows, so the behavior is consistent. It might be a good idea to have line endings dealt with automatically with compile, eval, exec, etc. but this would need to be brought up on python-dev. My guess is that there are a lot of places in the language and standard libs where the input arg is supposed to be a string using linefeeds as the line terminator, so it would be difficult to find and handle all the cases. ka From mwh at python.net Sun Sep 12 18:21:06 2004 From: mwh at python.net (Michael Hudson) Date: Sun Sep 12 18:21:08 2004 Subject: [Pythonmac-SIG] IDE with vi keybindings In-Reply-To: <06748AA2-0382-11D9-9CCD-000A957911BC@ksenia.nl> (Ksenia Marasanova's message of "Sat, 11 Sep 2004 02:34:57 +0300") References: <06748AA2-0382-11D9-9CCD-000A957911BC@ksenia.nl> Message-ID: <2mu0u3xxu5.fsf@starship.python.net> Ksenia Marasanova writes: > Hi, > > I currently use Vim for Python coding and I am quite happy with > it. However, from time to time I google for a 'real' IDE, but there's > seems to be not much results... So this time I want to ask: > > Can anybody recommend a (Python) editor / IDE, which runs on OSX and > has vi key bindings? Except for Vim :) Emacs + VIPER? :) Cheers, mwh (ducking :-) -- I also fondly recall Paris because that's where I learned to debug Zetalisp while drunk. -- Olin Shivers From bob at redivi.com Sun Sep 12 18:49:45 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Sep 12 18:50:36 2004 Subject: [Pythonmac-SIG] IDE with vi keybindings In-Reply-To: <2mu0u3xxu5.fsf@starship.python.net> References: <06748AA2-0382-11D9-9CCD-000A957911BC@ksenia.nl> <2mu0u3xxu5.fsf@starship.python.net> Message-ID: On Sep 12, 2004, at 12:21 PM, Michael Hudson wrote: > Ksenia Marasanova writes: > >> I currently use Vim for Python coding and I am quite happy with >> it. However, from time to time I google for a 'real' IDE, but there's >> seems to be not much results... So this time I want to ask: >> >> Can anybody recommend a (Python) editor / IDE, which runs on OSX and >> has vi key bindings? Except for Vim :) > > Emacs + VIPER? :) Eclipse has a Python module and a Vi input module these days too, doesn't it? -bob From hengist.podd at virgin.net Mon Sep 13 01:26:49 2004 From: hengist.podd at virgin.net (has) Date: Mon Sep 13 01:28:15 2004 Subject: [Pythonmac-SIG] FBAs with bundlebuilder? Message-ID: Hi folks, Just had a cracking idea for stealth-selling MacPython to AppleScripters: provide an easy way to create scriptable faceless background applications in Python. Far faster than executing Python scripts via 'do shell script', far easier than writing C-based osaxen. Basically a terminology-driven wrapper around aem.receive that allows users to define their own application commands and enumerations in a bundlebuilder-based FBA that they can then drop into their ScriptingAdditions folder and call from AppleScripts. AppleScripters are perenially starved for decent language extension mechanisms, so I can see them potentially going nuts for something like this - and once we've got that first hook into them we can gradually start selling them on Python as a general alternative to AppleScript. Subverting and stealing their users by the back door, if you like. ;) I'm working on the API at the moment, mostly trying to figure the best way to incorporate scripting terminology - I'm thinking decorators might be a good way to provide callbacks with metadata that can be retrieved automatically via introspection, allowing users to write stuff like: __name__ = 'Foo.app' class ae_SomeSuite: ae_suiteinfo = '????', 'Some Suite', 'Various commands and stuff.' @ae_handler('Pyth', 'Mult', 'multiply_string', 'Multiply a string', ('The result.', 'TEXT'), ('----', 'direct', 'The string to multiply.', 'TEXT'), ('Cnte', 'by', 'Number of times to multiply the string (default=2).', 'long', kOptional)) def ae_multiply(self, direct, by=2): try: return AEResult(direct * by) except: return AEError(-1700) The can then drag-n-drop this script onto an applet that automatically generates an FBA titled 'Foo.app' ready for use. The app generates an aete on demand when it receives an <>, so users don't need to create their own terminology resources; e.g. the above example would produce the following terminology: Some Suite : Various commands and stuff. multiply string : Multiply a string. multiply string string -- The string to multiply. [by : integer] -- Number of times to multiply the string (default=2). Result : string -- The result. What I mostly need right at the moment is a way to create FBAs from bundlebuilder, or something similar in Cocoa/ObjC would do just as well (though I'd want to avoid PyObjC to keep the number of 3rd-party dependencies down). If anyone knows how to do this, or can provide me with something suitable, it'd be a great help. Once I've finalised the API (won't be long), I can hammer out some examples and propaganda and we can start selling it to the AS community. Cheers, has -- http://freespace.virgin.net/hamish.sanderson/ From tony.mcdonald at ncl.ac.uk Mon Sep 13 12:05:00 2004 From: tony.mcdonald at ncl.ac.uk (Tony McDonald) Date: Mon Sep 13 12:05:08 2004 Subject: [Pythonmac-SIG] Python Postgresql support? In-Reply-To: <0F3825B6-FBC8-11D8-BE09-000393779D9C@eku.edu> References: <20040831100006.496161E4010@bag.python.org> <0F3825B6-FBC8-11D8-BE09-000393779D9C@eku.edu> Message-ID: <5F7AD9AC-056C-11D9-867A-000A95AB99B2@ncl.ac.uk> Not a general response, this is really focussing on pyscopg. psycopg is, shall we say, not the easiest module to compile up... I had to do this to make it all happen... (a bash shell) [544][tonymcd@eagle : Thu Aug 26 10:05] ~/python/psycopg-1.1.15 % LIBS='-lcrypto -lssl' ./configure --with-postgres-includes=/usr/local/pgsql/include --with-postgres-libraries=/usr/local/pgsql/lib --with-mxdatetime-includes=../egenix-mx-base-2.0.4/mx/DateTime/ mxDateTime/ checking for python... /usr/bin/python checking python version... 2.3 checking python installation prefix... /System/Library/Frameworks/Python.framework/Versions/2.3 checking python installation exec_prefix... /System/Library/Frameworks/Python.framework/Versions/2.3 checking definitions in Python library makefile... done checking location of python library... $(prefix)/lib/python2.3/site-packages checking location of python shared modules... $(exec_prefix)/lib/python2.3/site-packages checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking how to run the C preprocessor... gcc -E checking whether make sets $(MAKE)... yes checking for inline... inline checking PostgreSQL version... 7.4 checking PostgreSQL type catalog... /usr/local/pgsql/include/catalog/pg_type.h checking for mxDateTime.h... yes checking for main in -lcrypt... no checking for main in -lcrypto... yes checking for PQconnectStart in -lpq... yes checking for PQfreeNotify in -lpq... yes checking for asprintf... yes configure: creating ./config.status config.status: creating Setup config.status: creating config.h config.status: creating Makefile.pre config.status: executing default commands creating Makefile 'make' then did the good stuff and I can now use postgres on my mac from python hth tone On 1 Sep 2004, at 04:36, Jerry LeVan wrote: > Is it possible to build the python postgresql support library > on Mac OSX 10.3.5 with the default python install? > So I guess the answer is no, as you need to d/l postgres (I got mine from http://www.entropy.ch/software/macosx/) and the egenix packages. > Adding "--with-python" gets an error message about libpython > not being a shared library when attempting to build postgresql. > (pg 7.4.5) > > Thanks for any pointers. > > Jerry > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > -- Dr Tony McDonald, Asst Director, FMSC. 0191 246 4543 School of Medical Education Development Project Manager, FDTL-4 ePortfolios http://www.eportfolios.ac.uk/ From jerry.levan at eku.edu Mon Sep 13 15:25:25 2004 From: jerry.levan at eku.edu (Jerry LeVan) Date: Mon Sep 13 15:25:29 2004 Subject: [Pythonmac-SIG] Python Postgresql support? In-Reply-To: <5F7AD9AC-056C-11D9-867A-000A95AB99B2@ncl.ac.uk> References: <20040831100006.496161E4010@bag.python.org> <0F3825B6-FBC8-11D8-BE09-000393779D9C@eku.edu> <5F7AD9AC-056C-11D9-867A-000A95AB99B2@ncl.ac.uk> Message-ID: <5F18CF18-0588-11D9-A0FB-000393779D9C@eku.edu> I googled around and found on MacOSXGuru some conversations on how to build the python support library and get PyGreSQL to build It is ugly but it works... It looks like psycopg is a lot easier to build, I might give that a try also... Thanks for the interesting transcript. Jerry On Sep 13, 2004, at 6:05 AM, Tony McDonald wrote: > Not a general response, this is really focussing on pyscopg. > > psycopg is, shall we say, not the easiest module to compile up... > > I had to do this to make it all happen... (a bash shell) > > [544][tonymcd@eagle : Thu Aug 26 10:05] ~/python/psycopg-1.1.15 > % LIBS='-lcrypto -lssl' ./configure > --with-postgres-includes=/usr/local/pgsql/include > --with-postgres-libraries=/usr/local/pgsql/lib > --with-mxdatetime-includes=../egenix-mx-base-2.0.4/mx/DateTime/ > mxDateTime/ > checking for python... /usr/bin/python > checking python version... 2.3 > checking python installation prefix... > /System/Library/Frameworks/Python.framework/Versions/2.3 > checking python installation exec_prefix... > /System/Library/Frameworks/Python.framework/Versions/2.3 > checking definitions in Python library makefile... done > checking location of python library... > $(prefix)/lib/python2.3/site-packages > checking location of python shared modules... > $(exec_prefix)/lib/python2.3/site-packages > checking for gcc... gcc > checking for C compiler default output file name... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking how to run the C preprocessor... gcc -E > checking whether make sets $(MAKE)... yes > checking for inline... inline > checking PostgreSQL version... 7.4 > checking PostgreSQL type catalog... > /usr/local/pgsql/include/catalog/pg_type.h > checking for mxDateTime.h... yes > checking for main in -lcrypt... no > checking for main in -lcrypto... yes > checking for PQconnectStart in -lpq... yes > checking for PQfreeNotify in -lpq... yes > checking for asprintf... yes > configure: creating ./config.status > config.status: creating Setup > config.status: creating config.h > config.status: creating Makefile.pre > config.status: executing default commands > creating Makefile > > 'make' then did the good stuff and I can now use postgres on my mac > from python > > hth > tone > > On 1 Sep 2004, at 04:36, Jerry LeVan wrote: > >> Is it possible to build the python postgresql support library >> on Mac OSX 10.3.5 with the default python install? >> > > So I guess the answer is no, as you need to d/l postgres (I got mine > from http://www.entropy.ch/software/macosx/) and the egenix packages. > >> Adding "--with-python" gets an error message about libpython >> not being a shared library when attempting to build postgresql. >> (pg 7.4.5) >> >> Thanks for any pointers. >> >> Jerry >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG@python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> > -- > Dr Tony McDonald, Asst Director, FMSC. 0191 246 4543 > School of Medical Education Development > Project Manager, FDTL-4 ePortfolios http://www.eportfolios.ac.uk/ > From jerry.levan at eku.edu Mon Sep 13 15:42:18 2004 From: jerry.levan at eku.edu (Jerry LeVan) Date: Mon Sep 13 15:42:21 2004 Subject: [Pythonmac-SIG] Where am I ? Message-ID: Hi, I am fairly new to python, there is a task I need to figure out. Suppose I have my "main" program in a folder, and various support modules in *folders* in the same folder as the main program. How can I import stuff from the folders? Can I do this so that if everything gets moved to a new location, the imports will still work? In tcl I can do something like: set basedir [file dirname [info script]] <-- get the dir containing main source [file join $basedir Support pgconnect.tcl] <-- load others... source [file join $basedir Support Help.tcl] <-- contained in source [file join $basedir Support readme.tcl] <-- basedir/support source [file join $basedir Support tableInfo.tcl] Thanks, Jerry From arthur at iaaa.nl Mon Sep 13 15:38:18 2004 From: arthur at iaaa.nl (Arthur Elsenaar) Date: Mon Sep 13 16:07:14 2004 Subject: [Pythonmac-SIG] quicktime info? Message-ID: <2C058913-058A-11D9-937A-000A95C887F8@iaaa.nl> Hi, looked around the archives and documentation, but can't find information on how to use some very limited quicktime functionality. The main functionality I need are the movieplayer to load a sound file, duration and position information. I like to add this an existing pythoncard application, so I suspect a PyObjC solution is out the door? Thanks, Arthur. From jacob at jacobian.org Mon Sep 13 16:18:07 2004 From: jacob at jacobian.org (Jacob Kaplan-Moss) Date: Mon Sep 13 16:18:09 2004 Subject: [Pythonmac-SIG] FBAs with bundlebuilder? In-Reply-To: References: Message-ID: Has -- That sounds brilliant! I've been using been using a Python FBA to do iTunes scripting (with very small AppleScript stubs in iTunes Scripts menu), but I've been coding the script terminology files by hand, and I love the idea of using a decorator to automate the process. As for creating FBAs, it's really quite simple; all you have to do is add: LSUIElement 1 to the app's Info.plist, and you get a FBA. I know there's a way to get bundlebuilder to stick this automatically into the Info.plist, but I haven't figured it out yet. Again, what a great idea! Jacob From ronaldoussoren at mac.com Mon Sep 13 16:24:48 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon Sep 13 16:24:43 2004 Subject: [Pythonmac-SIG] FBAs with bundlebuilder? In-Reply-To: References: Message-ID: On 13-sep-04, at 16:18, Jacob Kaplan-Moss wrote: > Has -- > > That sounds brilliant! I've been using been using a Python FBA to do > iTunes scripting (with very small AppleScript stubs in iTunes Scripts > menu), but I've been coding the script terminology files by hand, and > I love the idea of using a decorator to automate the process. > > As for creating FBAs, it's really quite simple; all you have to do is > add: > > LSUIElement > 1 > > to the app's Info.plist, and you get a FBA. I know there's a way to > get bundlebuilder to stick this automatically into the Info.plist, but > I haven't figured it out yet. add a plist argument to the call to buildapp: buildapp( ... plist=plistlib.PList(LSUIElement=1) ) Ronald From ksenia at ksenia.nl Mon Sep 13 16:55:35 2004 From: ksenia at ksenia.nl (Ksenia Marasanova) Date: Mon Sep 13 16:55:42 2004 Subject: [Pythonmac-SIG] IDE with vi keybindings In-Reply-To: References: <06748AA2-0382-11D9-9CCD-000A957911BC@ksenia.nl> <2mu0u3xxu5.fsf@starship.python.net> Message-ID: > Eclipse has a Python module and a Vi input module these days too, > doesn't it? > Yes, indeed! Thank you for the tip. I looked at Eclipse about eight months ago, and didn't like it much - it was so slow and Java-oriented, and VI plugin was in the early stage... But after you reminded me about it I downloaded Eclipse 3.0 yesterday, and (maybe it's my imagination) but it fills faster and it looks nicer. And with Pydev plugin I have nice class outline and code folding. I bought VI plugin (it's commercial now) for 15 euro and voila - it works great! Finally an IDE :) Thanks, Ksenia. From kevino at tulane.edu Mon Sep 13 16:55:53 2004 From: kevino at tulane.edu (Kevin Ollivier) Date: Mon Sep 13 16:56:01 2004 Subject: [Pythonmac-SIG] quicktime info? In-Reply-To: <2C058913-058A-11D9-937A-000A95C887F8@iaaa.nl> References: <2C058913-058A-11D9-937A-000A95C887F8@iaaa.nl> Message-ID: <02B8805E-0595-11D9-AD54-000393CB1C86@tulane.edu> Hi Arthur, On Sep 13, 2004, at 6:38 AM, Arthur Elsenaar wrote: > Hi, > > looked around the archives and documentation, but can't find > information on how to use some very limited quicktime functionality. > > The main functionality I need are the movieplayer to load a sound > file, duration and position information. > > I like to add this an existing pythoncard application, so I suspect a > PyObjC solution is out the door? Well, I'm in the process of developing wxQtMovie for wxPython, which should already do what you need. (There's also wxSound, though I don't think you can get duration or position information with it.) Since pythoncard uses wxPython underneath, I think all that's needed is for Kevin A. to make the class accessible from pythoncard itself. I'm forwarding this to wxPython developer's list so that we can discuss this further and work out a solution. Thanks, Kevin From altis at semi-retired.com Mon Sep 13 18:08:40 2004 From: altis at semi-retired.com (Kevin Altis) Date: Mon Sep 13 18:08:47 2004 Subject: [Pythonmac-SIG] quicktime info? In-Reply-To: <02B8805E-0595-11D9-AD54-000393CB1C86@tulane.edu> References: <2C058913-058A-11D9-937A-000A95C887F8@iaaa.nl> <02B8805E-0595-11D9-AD54-000393CB1C86@tulane.edu> Message-ID: <2DA4E8B9-059F-11D9-99B7-000A9598382A@semi-retired.com> On Sep 13, 2004, at 7:55 AM, Kevin Ollivier wrote: > Hi Arthur, > > On Sep 13, 2004, at 6:38 AM, Arthur Elsenaar wrote: > >> Hi, >> >> looked around the archives and documentation, but can't find >> information on how to use some very limited quicktime functionality. >> >> The main functionality I need are the movieplayer to load a sound >> file, duration and position information. >> >> I like to add this an existing pythoncard application, so I suspect a >> PyObjC solution is out the door? > > Well, I'm in the process of developing wxQtMovie for wxPython, which > should already do what you need. (There's also wxSound, though I don't > think you can get duration or position information with it.) Since > pythoncard uses wxPython underneath, I think all that's needed is for > Kevin A. to make the class accessible from pythoncard itself. I'm > forwarding this to wxPython developer's list so that we can discuss > this further and work out a solution. > PythonCard already wraps wx.Sound with its own Sound class in PythonCard/sound.py that is demonstrated by the sound sample application. There is another sample application, mp3player that uses the PyGame movie module to play MP3 files and the PyGame movie module definitely lets you do all the positional manipulation for MPEG. On the QuickTime front, as soon as Kevin O.'s module is part of the general wxPython distribution I will make a wrapper component for it, so maybe wxPython 2.5.2.9? ka From rowen at u.washington.edu Mon Sep 13 18:38:40 2004 From: rowen at u.washington.edu (Russell E Owen) Date: Mon Sep 13 18:38:50 2004 Subject: [Pythonmac-SIG] bundlebuilder question: snack (tcl extension) In-Reply-To: <5C7E480E-0413-11D9-85A2-000D934FF6B4@cwi.nl> References: <5C7E480E-0413-11D9-85A2-000D934FF6B4@cwi.nl> Message-ID: At 1:55 AM +0900 2004-09-12, Jack Jansen wrote: >On 10 Sep 2004, at 01:52, Russell E Owen wrote: >> Also, any suggestions for a better sound package. All I want to do >>is play sound queues in a Tkinter-based Python application. (Thus >>all I want to do is play sound files asynchronously). Snack seems >>to work, but installation is a bit of a pain. > >My first choices would be Sound Manager (Carbon.Snd) or quicktime >(Carbon.Qt). Sound Manager should not interfere with Tkinter (at >least, I can't see how it could), but it's a rather old toolbox (and >so is the Python interface) so it can be a bit quirky to get >working. But there are examples. Actually, I think the Audio_mac >module (in Lib/plat-mac) may already do what you want, just make >sure you keep it fed with enough samples (for example in a Tkinter >timer callback). If it doesn't do the right thing it's a good >example anyway. Caveat: I haven't used this module in a long time, >and I'm not sure anyone else ever did. > >QuickTime needs to be told not to open visual elements (such as it's >playback control panel), and then it should be fine with Tkinter too. Thank you very much for the kind reply. Unfortunately, I think I was not clear enough in my question. My application is cross-platform (with mostly unix users, some MacOS X users and a few hardy Windows pioneers). So I need cross-platform sound. For what it's worth, I found by trial and error that copying /Library/Tcl/snack2.2/ to Contents/Frameworks/Tcl.Framework/Resources/snack2.2/ did the trick as far as the bundled Tcl/Tk seeing the bundled snack. In my bundlebuilder script I use (again, after trial and error; I wish these arguments were documented, since translating from the command-line arguments to buildapp function call arguments is not always obvious): files = [ ("/Library/Tcl/snack2.2", "Contents/Frameworks/Tcl.Framework/Resources/snack2.2"), ] Anyway, life is good. Dethe Elza suggested I consider PyGame. My recollection is there is some trickiness involved in bundling PyGame apps, but I am definitely keeping PyGame in mind for a future change in the code. -- Russell From Chris.Barker at noaa.gov Mon Sep 13 18:38:22 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Mon Sep 13 18:43:54 2004 Subject: [Pythonmac-SIG] Where am I ? In-Reply-To: References: Message-ID: <4145CCFE.5070106@noaa.gov> Jerry LeVan wrote: > Hi, > > I am fairly new to python, there is a task I need to > figure out. > > Suppose I have my "main" program in a folder, and various > support modules in *folders* in the same folder as the > main program. > > How can I import stuff from the folders? Can I do this > so that if everything gets moved to a new location, > the imports will still work? What you want to do is make those folders Python packages. All you need to do to do that is have a __init__.py file in each of them. This module will get called when you import the package. It can have initialization stuff it it, or nothing (I usually have a doc string and pass statement) Once you've done that, you can import the modules in the folders like so: import FolderName.Modulename or from FolderName import Modulename Python should look in the directory that the current module is in for importing (in addition to sys.path), so that should be all there is to it. If you do need to have Python look in odd places for modules, you can add any path to sys.path: import sys sys.path.append("A_new_path") -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 jerry.levan at eku.edu Mon Sep 13 18:52:12 2004 From: jerry.levan at eku.edu (Jerry LeVan) Date: Mon Sep 13 18:52:16 2004 Subject: [Pythonmac-SIG] Where am I ? In-Reply-To: <4145CCCE.9050503@noaa.gov> References: <4145CCCE.9050503@noaa.gov> Message-ID: <42611412-05A5-11D9-A0FB-000393779D9C@eku.edu> Thanks, That should be enough to get started... Jerry On Sep 13, 2004, at 12:37 PM, Chris Barker wrote: > Jerry LeVan wrote: >> Hi, >> I am fairly new to python, there is a task I need to >> figure out. >> Suppose I have my "main" program in a folder, and various >> support modules in *folders* in the same folder as the >> main program. >> How can I import stuff from the folders? Can I do this >> so that if everything gets moved to a new location, >> the imports will still work? > > What you want to do is make those folders Python packages. All you > need to do to do that is have a __init__.py file in each of them. This > module will get called when you import the package. It can have > initialization stuff it it, or nothing (I usually have a doc string > and pass statement) > > Once you've done that, you can import the modules in the folders like > so: > > import FolderName.Modulename > > or > > from FolderName import Modulename > > Python should look in the directory that the current module is in for > importing (in addition to sys.path), so that should be all there is to > it. If you do need to have Python look in odd places for modules, you > can add any path to sys.path: > > import sys > > sys.path.append("A_new_path") > > -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 hengist.podd at virgin.net Tue Sep 14 00:11:16 2004 From: hengist.podd at virgin.net (has) Date: Tue Sep 14 00:13:03 2004 Subject: [Pythonmac-SIG] FBAs with bundlebuilder? In-Reply-To: References: Message-ID: Ronald and Jacob, Thanks for the speedy reply. I'll have something to show very shortly. For now you have to define your own MiniApplication subclass and use method calls to register callback functions as AE handlers: suite.command(callback, 'core', 'setd', 'set', "Set an object's data.", None, ('----', 'direct', 'The object for the command.', 'obj '), ('data', 'to', 'The new value.', '****') ) which works fine, but treating this information as function metadata and using introspection to discover these functions automatically (c.f. unittest) certainly has some semantic appeal. But I'll need to experiment a bit more to be sure what works best (I swear at times like these I hear Lisp faintly chuckling...). The AppleScriptable-FBA idea's come from work I'm doing on implementing Apple Event Object Model support for Python-based application developers, but that's a much larger, longer-term project and I think this is something that will stand well enough by itself, so main aim is to make it easy to use (declarative rather than imperative, hide event loops and Application classes and other stuff that ASers don't need to know about, trade flexibility for simplicity, etc). I figure we can target this primarily at ASers and worry about Python developer-oriented APIs in the full-blown aeom package. If anyone's any thoughts, please fire away. Also, if anyone fancies writing some functions for a working example, let me know; I'm off to sound out the AS community now and see what kinds of functionality they're currently desperately in need of. Cheers, has p.s. Jacob - would be interested to see what you've written if you want to show us. -- http://freespace.virgin.net/hamish.sanderson/ From delza at alliances.org Tue Sep 14 04:00:59 2004 From: delza at alliances.org (Dethe Elza) Date: Tue Sep 14 04:01:10 2004 Subject: [Pythonmac-SIG] Python Robotics? Message-ID: Has anyone compiled the Python Robotics[1] (the *other* Pyro[2]) for OS X (10.3, builtin Python)? Why are people still using Swig? It seems like every project using it has a requirement for a specific version down to the third dot (i.e., version x.y.z). TIA --Dethe All space and matter, organic or inorganic, has some degree of life in it [...] All matter/space has some degree of "self" in it. If either of these claims comes, in future, to be considered true, that would radically change our picture of the universe. --Christopher Alexander -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2367 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040913/fc5b418c/smime.bin From bhutten at ns.sympatico.ca Tue Sep 14 20:51:36 2004 From: bhutten at ns.sympatico.ca (Bill Hutten) Date: Tue Sep 14 20:51:40 2004 Subject: [Pythonmac-SIG] How to debug a non-functioning standalone app? Message-ID: <20040914195136.5804@smtp1.ns.sympatico.ca> Hi all: I have a standalone Python app (built with BundleBuilder). It works fine on my development machine, but when I move it to another OSX 10.3.x machine it does not work. When I launch the application, the icon appears momentarily in the dock, and then disappears. I've tried generating the app using --standalone and --semi-standalone, with no success in resolving this. When the app quits nothing is written to console.log, system.log, etc. How can I determine what's causing the problem? Is there something I can add to the Python source to log the errors? Any ideas appreciated... - bill -- bhutten@ns.sympatico.ca "God made man, but he used the monkey to do it" - Devo From cpr at emsoftware.com Wed Sep 15 03:38:05 2004 From: cpr at emsoftware.com (Chris Ryland) Date: Wed Sep 15 04:51:31 2004 Subject: [Pythonmac-SIG] \r in string causes eval to fail In-Reply-To: <4F27A010-0417-11D9-89A4-000A9598382A@semi-retired.com> References: <13B2EA34-0359-11D9-A274-000A95686CD8@redivi.com> <4F27A010-0417-11D9-89A4-000A9598382A@semi-retired.com> Message-ID: On Sep 11, 2004, at 1:23 PM, Kevin Altis wrote: > On Sep 10, 2004, at 11:41 AM, Bob Ippolito wrote: > >> >> On Sep 10, 2004, at 2:25 PM, Kevin Altis wrote: >> >>> I've run into a problem with eval on the Mac and I'm not sure >>> whether it is a bug or expected behavior. The problem is that if \r >>> is used as the line terminator instead of \n then it causes eval to >>> fail. I ran into this while copying and pasting some text to eval >>> and the clipboard had converted my newlines to returns. Here is an >>> example done in the shell. As you can see below, using newlines as a >>> separator is fine, but return (\r) isn't. This would probably only >>> come up on the Mac where return (CR, \r) is the default line >>> terminator, but I didn't know whether universal newlines support was >>> supposed to deal with this kind of issue. >>> >>> >>> s = """{'type':'Button',\r'name':'Button1',\r'position':(10, >>> 10),\r'label':'Button1',\r}""" >>> >>> s2 = s.replace('\r', '\n') >>> >>> eval(s2) >> >> "Universal newlines" is only a mode for the file object (as far as I >> know anyway). eval and compile take strings. >> >> It would be a lot more portable to do this to normalize your input >> strings: >> >> '\n'.join(s.splitlines()) >> >> splitlines is essentially universal newlines support at the string >> level. It might be smart to do this internally, maybe this deserves >> a feature request or bug report? >> > I double-checked and eval doesn't like \r\n line endings either as you > would get on Windows, so the behavior is consistent. It might be a > good idea to have line endings dealt with automatically with compile, > eval, exec, etc. but this would need to be brought up on python-dev. > My guess is that there are a lot of places in the language and > standard libs where the input arg is supposed to be a string using > linefeeds as the line terminator, so it would be difficult to find and > handle all the cases. Argh, this really seems like a basic bug in all versions of CPython. Eval/exec/parse should support all forms of linefeeds--what's the downside? Cheers! --Chris Ryland / Em Software, Inc. / www.emsoftware.com From ronaldoussoren at mac.com Wed Sep 15 11:22:49 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed Sep 15 11:22:54 2004 Subject: [Pythonmac-SIG] FBAs with bundlebuilder? In-Reply-To: References: Message-ID: On 14-sep-04, at 0:11, has wrote: > Ronald and Jacob, > > Thanks for the speedy reply. I'll have something to show very shortly. > For now you have to define your own MiniApplication subclass and use > method calls to register callback functions as AE handlers: > > suite.command(callback, 'core', 'setd', 'set', "Set an object's > data.", > None, > ('----', 'direct', 'The object for the command.', 'obj '), > ('data', 'to', 'The new value.', '****') > ) > > which works fine, but treating this information as function metadata > and using introspection to discover these functions automatically > (c.f. unittest) certainly has some semantic appeal. But I'll need to > experiment a bit more to be sure what works best (I swear at times > like these I hear Lisp faintly chuckling...). :-) > > The AppleScriptable-FBA idea's come from work I'm doing on > implementing Apple Event Object Model support for Python-based > application developers, but that's a much larger, longer-term project > and I think this is something that will stand well enough by itself, > so main aim is to make it easy to use (declarative rather than > imperative, hide event loops and Application classes and other stuff > that ASers don't need to know about, trade flexibility for simplicity, > etc). I figure we can target this primarily at ASers and worry about > Python developer-oriented APIs in the full-blown aeom package. Why would pythoneers need another API then AS-ers? If I understand you correctly the only part that's only for AS-ers is a default main function, others could supply their own eventloop. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From mwh at python.net Wed Sep 15 16:01:21 2004 From: mwh at python.net (Michael Hudson) Date: Wed Sep 15 16:01:24 2004 Subject: [Pythonmac-SIG] \r in string causes eval to fail In-Reply-To: (Chris Ryland's message of "Tue, 14 Sep 2004 21:38:05 -0400") References: <13B2EA34-0359-11D9-A274-000A95686CD8@redivi.com> <4F27A010-0417-11D9-89A4-000A9598382A@semi-retired.com> Message-ID: <2msm9jws0e.fsf@starship.python.net> Chris Ryland writes: > Argh, this really seems like a basic bug in all versions of > CPython. Eval/exec/parse should support all forms of > linefeeds--what's the downside? You haven't submitted a patch to do this yet? Semi-seriously, I'd guess that everyone who's bumped into this has found it easier to normalize the line feeds in Python than hack the parser (it's a little scary). Cheers, mwh -- If you don't use emacs, you're a pathetic, mewling, masochistic weakling and I can't be bothered to convert you. -- Ron Echeverri From Chris.Barker at noaa.gov Wed Sep 15 20:09:55 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Wed Sep 15 20:15:35 2004 Subject: [Pythonmac-SIG] \r in string causes eval to fail In-Reply-To: <2msm9jws0e.fsf@starship.python.net> References: <13B2EA34-0359-11D9-A274-000A95686CD8@redivi.com> <4F27A010-0417-11D9-89A4-000A9598382A@semi-retired.com> <2msm9jws0e.fsf@starship.python.net> Message-ID: <41488573.1090608@noaa.gov> Michael Hudson wrote: > Semi-seriously, I'd guess that everyone who's bumped into this has > found it easier to normalize the line feeds in Python than hack the > parser (it's a little scary). Would you need to hack the parser? I'd be inclined to simply put a filter in before the parser, just like I'd do in user code: CodeString = FixLineFeeds(CodeString) eval(CodeString) There would be a performance issue, because you'd be doing processing and copying of the string before parsing it, but I wonder how often performance is an issue when using eval and friends. Another question: Is there any chance that having eval and friends "fix" linefeeds would break existing code? I'm thinking not, but perhaps I'm not very imaginative. This is an issue that made universal newlines support in files a little more awkward. -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 mwh at python.net Wed Sep 15 20:28:40 2004 From: mwh at python.net (Michael Hudson) Date: Wed Sep 15 20:28:41 2004 Subject: [Pythonmac-SIG] \r in string causes eval to fail In-Reply-To: <41488573.1090608@noaa.gov> (Chris Barker's message of "Wed, 15 Sep 2004 11:09:55 -0700") References: <13B2EA34-0359-11D9-A274-000A95686CD8@redivi.com> <4F27A010-0417-11D9-89A4-000A9598382A@semi-retired.com> <2msm9jws0e.fsf@starship.python.net> <41488573.1090608@noaa.gov> Message-ID: <2mk6uvwfmv.fsf@starship.python.net> "Chris Barker" writes: > Michael Hudson wrote: > >> Semi-seriously, I'd guess that everyone who's bumped into this has >> found it easier to normalize the line feeds in Python than hack the >> parser (it's a little scary). > > Would you need to hack the parser? I'd be inclined to simply put a > filter in before the parser, just like I'd do in user code: > > CodeString = FixLineFeeds(CodeString) > eval(CodeString) Did you read what I said? Cheers, mwh -- The above comment may be extremely inflamatory. For your protection, it has been rot13'd twice. -- the signature of "JWhitlock" on slashdot From qdecavel at wanadoo.fr Wed Sep 15 20:58:10 2004 From: qdecavel at wanadoo.fr (Quentin DECAVEL) Date: Wed Sep 15 20:58:11 2004 Subject: [Pythonmac-SIG] Problem with a bundlebuilder application Message-ID: <21383151.1095274690771.JavaMail.www@wwinf0403> Hi I have recently met a weird problem using bundlebuilder (I'm quite a newbie, sorry if the question is trivial) : I have a Macpython/Pygame application that runs fine when launched from the command line; I use bundlebuilder, which send me some warnings but I still have a build; when I launch the obtained app by command line (with ./build/Test.app/Contents/MacOS/Test, there is still no problem, but every time I double click the app, it leaves after 5 to 10 seconds I have used the Console to get this error message : init Traceback (most recent call last): File "/Users/odecavel/Desktop/newengine/build/Test.app/Contents/Resources/ Greenhouse.py", line 145, in ? mainloop() File "/Users/odecavel/Desktop/newengine/enginemain.py", line 26, in mainloop curitem._handleevent(fakeevent('init')) File "/Users/odecavel/Desktop/newengine/inventoryfloat.py", line 247, in _handleevent self._handleinit() File "/Users/odecavel/Desktop/newengine/inventoryfloat.py", line 292, in _handleinit self._itemimages.append([item._draw(),None]) File "/Users/odecavel/Desktop/newengine/item.py", line 93, in _draw self._itemsurface = globals.loadfile(parameters.getitempath(), self._file, self._datfile, self._encryption) File "/Users/odecavel/Desktop/newengine/globals.py", line 114, in loadfile tmpsurface = pygame.image.load(os.path.join(filepath, filename)).convert() pygame.error: Couldn't open Greenhouse/items/item.bmp To build the app, I use python buildapp.py build, and here is my buildapp.py : import os from bundlebuilder import buildapp buildapp( name = "Test.app", mainprogram = "Greenhouse.py", includeModules = [], includePackages = ["/Library/Python/2.3/PyObjC/"], libs = [], ) Does anybody have an idea where I did wrong ? Thanks in advance From Martina at Oefelein.de Wed Sep 15 22:01:44 2004 From: Martina at Oefelein.de (Martina Oefelein) Date: Wed Sep 15 22:01:48 2004 Subject: [Pythonmac-SIG] Problem with a bundlebuilder application In-Reply-To: <21383151.1095274690771.JavaMail.www@wwinf0403> References: <21383151.1095274690771.JavaMail.www@wwinf0403> Message-ID: <1128CE15-0752-11D9-BFFA-000A957DBE94@Oefelein.de> Hi Quentin: > tmpsurface = pygame.image.load(os.path.join(filepath, > filename)).convert() > pygame.error: Couldn't open Greenhouse/items/item.bmp Your program doesn't find the file mentioned in the error message. Make sure to include it in the app bundle, and when you load the file specify the full path to the file within the app bundle. ciao Martina From Chris.Barker at noaa.gov Wed Sep 15 22:42:03 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Wed Sep 15 22:47:44 2004 Subject: [Pythonmac-SIG] \r in string causes eval to fail In-Reply-To: <2mk6uvwfmv.fsf@starship.python.net> References: <13B2EA34-0359-11D9-A274-000A95686CD8@redivi.com> <4F27A010-0417-11D9-89A4-000A9598382A@semi-retired.com> <2msm9jws0e.fsf@starship.python.net> <41488573.1090608@noaa.gov> <2mk6uvwfmv.fsf@starship.python.net> Message-ID: <4148A91B.9020908@noaa.gov> Michael Hudson wrote: > "Chris Barker" writes: > > >>Michael Hudson wrote: >> >> >>>Semi-seriously, I'd guess that everyone who's bumped into this has >>>found it easier to normalize the line feeds in Python than hack the >>>parser (it's a little scary). >> >>Would you need to hack the parser? I'd be inclined to simply put a >>filter in before the parser, just like I'd do in user code: >> >>CodeString = FixLineFeeds(CodeString) >>eval(CodeString) > > > Did you read what I said? yes, but I didn't write what I meant, at least not clearly. What I was trying to say was that rather than hack the parser, one could just insert a line feed fixer _before_ the parser, INSIDE eval and friends, essentially moving the python code I wrote, into eval. I can't imagine this would be hard, but it wouldn't get you any performance benefits over just writing one extra line of python. -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 mwh at python.net Thu Sep 16 13:08:01 2004 From: mwh at python.net (Michael Hudson) Date: Thu Sep 16 13:08:03 2004 Subject: [Pythonmac-SIG] \r in string causes eval to fail In-Reply-To: <4148A91B.9020908@noaa.gov> (Chris Barker's message of "Wed, 15 Sep 2004 13:42:03 -0700") References: <13B2EA34-0359-11D9-A274-000A95686CD8@redivi.com> <4F27A010-0417-11D9-89A4-000A9598382A@semi-retired.com> <2msm9jws0e.fsf@starship.python.net> <41488573.1090608@noaa.gov> <2mk6uvwfmv.fsf@starship.python.net> <4148A91B.9020908@noaa.gov> Message-ID: <2mfz5iwjxq.fsf@starship.python.net> "Chris Barker" writes: > Michael Hudson wrote: >> "Chris Barker" writes: >> >>>Michael Hudson wrote: >>> >>> >>>>Semi-seriously, I'd guess that everyone who's bumped into this has >>>>found it easier to normalize the line feeds in Python than hack the >>>>parser (it's a little scary). >>> >>>Would you need to hack the parser? I'd be inclined to simply put a >>>filter in before the parser, just like I'd do in user code: >>> >>>CodeString = FixLineFeeds(CodeString) >>>eval(CodeString) >> Did you read what I said? > > yes, but I didn't write what I meant, at least not clearly. Ah, OK :-) > What I was trying to say was that rather than hack the parser, one > could just insert a line feed fixer _before_ the parser, INSIDE eval > and friends, essentially moving the python code I wrote, into eval. I > can't imagine this would be hard, but it wouldn't get you any > performance benefits over just writing one extra line of python. Yes, that would work too. I'd much rather write line-ending normalizing code in Python than in C, though... Oh well, it's not my itch and I'm not going to scratch it. Cheers, mwh -- Lisp nearing the age of 50 is the most modern language out there. GC, dynamic, reflective, the best OO model extant including GFs, procedural macros, and the only thing old-fashioned about it is that it is compiled and fast. -- Kenny Tilton, comp.lang.python From vm at klankschap.nl Thu Sep 16 14:20:52 2004 From: vm at klankschap.nl (Floris van Manen) Date: Thu Sep 16 14:21:00 2004 Subject: [Pythonmac-SIG] screensaver sample code in python available? In-Reply-To: <2mfz5iwjxq.fsf@starship.python.net> References: <13B2EA34-0359-11D9-A274-000A95686CD8@redivi.com> <4F27A010-0417-11D9-89A4-000A9598382A@semi-retired.com> <2msm9jws0e.fsf@starship.python.net> <41488573.1090608@noaa.gov> <2mk6uvwfmv.fsf@starship.python.net> <4148A91B.9020908@noaa.gov> <2mfz5iwjxq.fsf@starship.python.net> Message-ID: <273596894.20040916142052@klankschap.nl> as i'm sort of new to the mac/osx platform, i was wondering if someone knows about (a link to) some sample code to build a screensaver for osx. written in python. that would help a lot to get started of course. // floris From bhutten at ns.sympatico.ca Thu Sep 16 14:49:10 2004 From: bhutten at ns.sympatico.ca (Bill Hutten) Date: Thu Sep 16 14:49:56 2004 Subject: [Pythonmac-SIG] How to debug a non-functioning standalone app? In-Reply-To: <20040914195136.5804@smtp1.ns.sympatico.ca> References: <20040914195136.5804@smtp1.ns.sympatico.ca> Message-ID: <20040916134910.28429@smtp1.ns.sympatico.ca> On Tue, 14 Sep 2004 15:51:36 -0300 bhutten@ns.sympatico.ca said: >I have a standalone Python app (built with BundleBuilder). It works fine >on my development machine, but when I move it to another OSX 10.3.x >machine it does not work. When I launch the application, the icon >appears momentarily in the dock, and then disappears. I've tried >generating the app using --standalone and --semi-standalone, with no >success in resolving this. Well, I've managed to resolve this. The problem was that I was not referencing the wxPython library in my bundlebuilder script. Doh. Here's my current bundlebuilder script - with this script I can generate a standalone wxPython application that runs successfully on any OSX 10.3 system: --------------------------------------------- from bundlebuilder import buildapp buildapp( name = "App", mainprogram = "App.py", includeModules = [], includePackages = [], libs = ["/usr/local/lib/wxPython-2.5.2.8/lib/libwx_macd-2.5.2.dylib"], ) --------------------------------------------- - bill -- bhutten@ns.sympatico.ca "God made man, but he used the monkey to do it" - Devo From ronaldoussoren at mac.com Thu Sep 16 21:54:28 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu Sep 16 21:54:48 2004 Subject: [Pythonmac-SIG] screensaver sample code in python available? In-Reply-To: <273596894.20040916142052@klankschap.nl> References: <13B2EA34-0359-11D9-A274-000A95686CD8@redivi.com> <4F27A010-0417-11D9-89A4-000A9598382A@semi-retired.com> <2msm9jws0e.fsf@starship.python.net> <41488573.1090608@noaa.gov> <2mk6uvwfmv.fsf@starship.python.net> <4148A91B.9020908@noaa.gov> <2mfz5iwjxq.fsf@starship.python.net> <273596894.20040916142052@klankschap.nl> Message-ID: <37E1EB06-081A-11D9-AFD9-000D93AD379E@mac.com> On 16-sep-04, at 14:20, Floris van Manen wrote: > as i'm sort of new to the mac/osx platform, i was wondering if someone > knows about (a link to) some sample code to build a screensaver for > osx. written in python. that would help a lot to get started of > course. There's a screensaver amongst the PyObjC examples. PyObjC's home is at http://pyobjc.sf.net/ Ronald From delza at livingcode.org Thu Sep 16 16:07:08 2004 From: delza at livingcode.org (Dethe Elza) Date: Thu Sep 16 21:55:34 2004 Subject: [Pythonmac-SIG] screensaver sample code in python available? In-Reply-To: <273596894.20040916142052@klankschap.nl> References: <13B2EA34-0359-11D9-A274-000A95686CD8@redivi.com> <4F27A010-0417-11D9-89A4-000A9598382A@semi-retired.com> <2msm9jws0e.fsf@starship.python.net> <41488573.1090608@noaa.gov> <2mk6uvwfmv.fsf@starship.python.net> <4148A91B.9020908@noaa.gov> <2mfz5iwjxq.fsf@starship.python.net> <273596894.20040916142052@klankschap.nl> Message-ID: In the pyobjc Examples folder there is an example called SillyBallSaver which should get you going. --Dethe When laws are outlawed, only outlaws will have laws. From djacomy at yahoo.fr Fri Sep 17 00:45:59 2004 From: djacomy at yahoo.fr (Damien JACOMY) Date: Fri Sep 17 00:41:27 2004 Subject: [Pythonmac-SIG] /Library vs /System/Library Message-ID: Hi Folks ! I had two Python Framework on my machine (OSX panther) : Library/framework/python.framework/... and System/ Library/framework/python.framework/... I remove the first one and /usr/local/bin as it said in the faq. Now, python can be running by IDLE and Python IDE, but I can't use a terminal window, and so Python Launcher. Damien From bhutten at ns.sympatico.ca Fri Sep 17 14:08:36 2004 From: bhutten at ns.sympatico.ca (Bill Hutten) Date: Fri Sep 17 14:09:25 2004 Subject: [Pythonmac-SIG] Interesting bundlebuilder problem & resolution... Message-ID: <20040917130836.11886@smtp1.ns.sympatico.ca> Here's an interesting one: I was working on some changes to a wxPython application, it was running correctly when launched from the command line, etc. So I decide to build a test standalone, using the usual "python buildapp.py --standalone build". Here's what I got: ------------------------------------------------- Traceback (most recent call last): File "buildapp.py", line 8, in ? libs = ["/usr/local/lib/wxPython-2.5.2.8/lib/libwx_macd-2.5.2.dylib"], File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/bundlebuilder.py", line 912, in buildapp main(builder) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/bundlebuilder.py", line 899, in main builder.setup() File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/bundlebuilder.py", line 437, in setup self.findDependencies() File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/bundlebuilder.py", line 628, in findDependencies mf.run_script(self.mainprogram) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/modulefinder.py", line 112, in run_script self.load_module('__main__', fp, pathname, stuff) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/modulefinder.py", line 265, in load_module co = compile(fp.read()+'\n', pathname, 'exec') TypeError: compile() expected string without null bytes ------------------------------------------------- After a bit of freaking out, I determined that the cause was that I had a non 7-bit ASCII character in my Python source. It was a single character, at the end of a line. Interestingly, it was a line that I had copied from a webpage, and for whatever reason Safari had included this character. I used BBEdit's "Zap Gremlins" command to find the offending character and delete it. Once that was done, bundlebuilder.py worked fine. What's odd to me is that the app ran fine from the command-line via "pythonw". It was only when the code was compiled via bundlebuilder that the gremlin character caused a problem. Maybe this'll help someone else... - bill -- bhutten@ns.sympatico.ca "God made man, but he used the monkey to do it" - Devo From hengist.podd at virgin.net Sun Sep 19 02:16:19 2004 From: hengist.podd at virgin.net (has) Date: Sun Sep 19 02:17:35 2004 Subject: [Pythonmac-SIG] FBAs with bundlebuilder? In-Reply-To: References: Message-ID: Ronald Oussoren wrote: >Why would pythoneers need another API then AS-ers? If I understand >you correctly the only part that's only for AS-ers is a default main >function, others could supply their own eventloop. As an oblique answer, here's an example of where I'm up to: ------- main.py script ------- from asapp import * ####### # Callback functions def inttotext(direct): try: return u''.join([unichr(i) for i in direct]) except ValueError, e: raise EventError(-1700, 'Some number was outside range 0-65535.') def texttoint(direct): return [ord(c) for c in direct] ####### # Install callbacks as Apple event handlers app = Application() tc = app.suite('????', 'Text Commands Suite', 'Commands for working with text.') tc.command(inttotext, 'Pyth', 'Ucha', 'unicode characters', "Convert a list of integers to Unicode text.", ('The unicode text.', typeUnicode), (kDirectArg, 'direct', 'List of integers in range 0-65535.', typeInteger, kList)) tc.command(texttoint, 'Pyth', 'Uint', 'unicode numbers', "Convert Unicode text to a list of integers.", ('List of integers.', typeInteger, kList), (kDirectArg, 'direct', 'The unicode text.', typeUnicode)) app.run() ------- end ------- ------- build.py script ------- from asapp.build import build build('TextCommands.app') ------- end ------- (Note: I'd really like the build script to go away in default cases, and just have a drag-n-drop applet that takes the mainprogram script and creates the application directly from that. Only time a build script should be needed is if you want to include 3rd-party modules in the application. Still working on this.) I've made it as procedural as possible, avoiding any need to write classes as most ASers don't know squat about OOP. This means I can't use 'aehandler' decorators and auto-discovery here, since decorators don't work on modules, but never mind... and I guess it's one fewer 'advanced' language concept for ASers to grok. It's something I still intend to explore in the broader aeom framework, which will be targeted squarely at Python-based application developers and support stuff like resolving object specifiers against an application's object model. Though it's early days and I'm still working on ideas for this as it's a pretty major project. [1][2] BTW, anyone know if there's a bug/request filed on BB-built applications to do something about them falling over and dying upon launch if there's a bug in the top-level code of the mainprogram script or that of any of its dependencies. This is something AppleScript applets handle quite nicely: if a bug occurs on launch (or any other time for that matter), an error dialog appears describing the problem, along with a button you can click to open the script in Script Editor ready for fixing. ASers definitely won't tolerate the current behaviour, so something will definitely need done about it asap. Cheers, has -- [1] Any ideas if/how an Apple Event Object Model support framework could be made to play nice with PyObjC apps? Presumably AE handling in PyObjC-based apps falls to Cocoa Scripting by default? Whereas aeom would build on aem.receive and aem.types.objectspecifier, which are powered by the Carbon Apple Event Manager. [2] Anyone know of any nice, clean, easy-to-grok document-based applications written in Python using MVC that I can study? -- http://freespace.virgin.net/hamish.sanderson/ From ronaldoussoren at mac.com Sun Sep 19 10:26:46 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun Sep 19 10:27:47 2004 Subject: [Pythonmac-SIG] FBAs with bundlebuilder? In-Reply-To: References: Message-ID: On 19-sep-04, at 2:16, has wrote: [... example code removed ...] > (Note: I'd really like the build script to go away in default cases, > and just have a drag-n-drop applet that takes the mainprogram script > and creates the application directly from that. Only time a build > script should be needed is if you want to include 3rd-party modules in > the application. Still working on this.) > > > I've made it as procedural as possible, avoiding any need to write > classes as most ASers don't know squat about OOP. This means I can't > use 'aehandler' decorators and auto-discovery here, since decorators > don't work on modules, but never mind... and I guess it's one fewer > 'advanced' language concept for ASers to grok. Decorators would also work on module level functions, but you'd have to create the Application instance before defining the ae-functions. You would need python2.4 to use decorators, which would make it harder to get your code accepted in the AS community. > It's something I still intend to explore in the broader aeom > framework, which will be targeted squarely at Python-based application > developers and support stuff like resolving object specifiers against > an application's object model. Though it's early days and I'm still > working on ideas for this as it's a pretty major project. [1][2] That sounds like major undertaking, especially when you want to support more than one GUI toolkit (Carbon, Cocoa, WxWidgets, ...). > > > BTW, anyone know if there's a bug/request filed on BB-built > applications to do something about them falling over and dying upon > launch if there's a bug in the top-level code of the mainprogram > script or that of any of its dependencies. This is something > AppleScript applets handle quite nicely: if a bug occurs on launch (or > any other time for that matter), an error dialog appears describing > the problem, along with a button you can click to open the script in > Script Editor ready for fixing. ASers definitely won't tolerate the > current behaviour, so something will definitely need done about it > asap. Bundlebuilder could use some surgery. One thing I'd like to add to bundlebuilder is the use of a custom main program, like the one used in the PyObjC Xcode templates. That would remove one step in bootstrap process, and would probably make it easier to add an error dialog. > > Cheers, > > has > > -- > > [1] Any ideas if/how an Apple Event Object Model support framework > could be made to play nice with PyObjC apps? Presumably AE handling in > PyObjC-based apps falls to Cocoa Scripting by default? Whereas aeom > would build on aem.receive and aem.types.objectspecifier, which are > powered by the Carbon Apple Event Manager. Does the Carbon Apple Event Manager use CFRunLoop for running the main event loop? If so, it should be possible to use your code in a Cocoa application. I haven't played around with supporting AE in a Cocoa application yet, which makes it hard to answer you question :-) Ronald From altis at semi-retired.com Sun Sep 19 18:33:01 2004 From: altis at semi-retired.com (Kevin Altis) Date: Sun Sep 19 18:33:05 2004 Subject: [Pythonmac-SIG] time.clock() versus time.time() significant digits Message-ID: <927FCD5D-0A59-11D9-B877-000A9598382A@semi-retired.com> I was looking at someone else's code today that had some time.clock() calls used to figure out how long an operation took. I was surprised to see on the Mac that there were only two significant digits after the decimal point compared to what I saw on Windows. Normally, I use time.time() for calculating time taken on an operation and my numbers on both systems seemed to have the same resolution. Anyway, I opened up the shell on the Mac and indeed it appears that time.time() is using more significant digits. Am I just misinterpreting the results here or is this a bug? I'm using the stock Panther Python 2.3. >>> time.time() 1095611259.1935749 >>> time.time() 1095611263.9729979 >>> time.time() 1095611273.4193349 >>> time.clock() 6.8300000000000001 >>> time.clock() 7.75 ka From cookedm at physics.mcmaster.ca Sun Sep 19 19:34:49 2004 From: cookedm at physics.mcmaster.ca (David M. Cooke) Date: Sun Sep 19 19:34:50 2004 Subject: [Pythonmac-SIG] time.clock() versus time.time() significant digits In-Reply-To: <927FCD5D-0A59-11D9-B877-000A9598382A@semi-retired.com> References: <927FCD5D-0A59-11D9-B877-000A9598382A@semi-retired.com> Message-ID: <20040919173449.GA12656@arbutus.physics.mcmaster.ca> On Sun, Sep 19, 2004 at 09:33:01AM -0700, Kevin Altis wrote: > I was looking at someone else's code today that had some time.clock() > calls used to figure out how long an operation took. I was surprised to > see on the Mac that there were only two significant digits after the > decimal point compared to what I saw on Windows. Normally, I use > time.time() for calculating time taken on an operation and my numbers > on both systems seemed to have the same resolution. Anyway, I opened up > the shell on the Mac and indeed it appears that time.time() is using > more significant digits. Am I just misinterpreting the results here or > is this a bug? I'm using the stock Panther Python 2.3. No, it's a Windows vs. Unix thing (and here, Mac is a Unix). The two calls have two different uses: time.time() returns system time (since the Epoch), and time.clock() returns CPU time since the start of the process (more or less). On Unix, time() will usually have a resolution of milliseconds. The clock() call will a resolution of os.sysconf('SC_CLK_TCK') times per second, which under Darwin and Linux, is 0.01 s. The usual advice for timing is to use clock() on Windows, time() on Unix. -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm@physics.mcmaster.ca From hengist.podd at virgin.net Mon Sep 20 17:08:08 2004 From: hengist.podd at virgin.net (has) Date: Mon Sep 20 17:11:11 2004 Subject: [Pythonmac-SIG] FBAs with bundlebuilder? In-Reply-To: References: Message-ID: Ronald Oussoren wrote: >>I've made it as procedural as possible, avoiding any need to write >>classes as most ASers don't know squat about OOP. This means I >>can't use 'aehandler' decorators and auto-discovery here, since >>decorators don't work on modules, but never mind... >Decorators would also work on module level functions, but you'd have >to create the Application instance before defining the ae-functions. You mean pass the application instance to each decorator as you declare it, yes? Yeah, that'd work, though it doesn't really gain us much over the current procedural approach. I'm a little torn on whether using decorators to hold metadata really makes a worthwhile difference over traditional 'install handler' calls anyway. And there's still an argument for putting aete data in a .rsrc file so clients don't need to launch the app just to get its terminology - a common annoyance with some Cocoa apps - though having everything in one file written as plain Python code does ease development, which is the main goal of this particular project. I guess user testing will finally determine what works best; I should be starting this quite shortly. >You would need python2.4 to use decorators, which would make it >harder to get your code accepted in the AS community. 2.3 has decorator support, but yeah, for the 'improved' decorator syntax you'd need 2.4. Course, I'm forgetting that Python tends towards storing scripts in source form, so an FBA written for 2.4 wouldn't work on 2.3 unless the author used a .pyc rather than .py file (assuming the Python bytecode is still backwards-compatible). Probably too many headaches for now. >>It's something I still intend to explore in the broader aeom >>framework, which will be targeted squarely at Python-based >>application developers and support stuff like resolving object >>specifiers against an application's object model. Though it's early >>days and I'm still working on ideas for this as it's a pretty major >>project. [1][2] > >That sounds like major undertaking, especially when you want to >support more than one GUI toolkit (Carbon, Cocoa, WxWidgets, ...). Shouldn't be, the Apple Event Object Model is just another View-Controller (i.e. a peer to GUI, CLI, RPC, web, etc. interfaces) and operates mostly on an application's Model layer. The only View class that's normally made scriptable is Window, and we should avoid direct coupling to specific GUI frameworks anyway. (For developer convenience and end-user consistency we can always define a standard Window class scripting API [c.f. the default window class in Cocoa Scripting] and leave individual GUI frameworks to implement support for that API themselves as and when they wish to.) Some GUI toolkits also provide their own Application and Document classes (i.e. Model layer), which are other classes we might want to provide some default support for (c.f. Cocoa Scripting again). Again, we should avoid directly coupling aeom to these, but can define a standard API and leave these frameworks to target that if they wish to provide some default scripting support to developers. Regarding the aeom's general design, it's essential that it can be loosely coupled to application Models. The developer should be able to construct a Controller layer that presents as a direct representation of the scripting interface and operates as a proxy to the Model layer's actual API. Developers could also, if they wish, employ aeom objects in their Model layer, mixing in aeom's generic attribute and relationship classes to provide the basic foundation for their object model. e.g. An Application object typically contains a private list containing zero or more Document instances plus public methods for adding, retrieving and removing them. Chances are this functionality is obtained as an prebuilt class provided by a standard application framework and incorporated into the user's Application object as a superclass/mixin/attribute. aeom classes would become just another available option here, with the added advantage that their standard query-based API for accessing and manipulating the application object model can be used both internally by the application itself and, externally, via aem.receive. With sufficient refinement, there's no reason why aeom + aem.types.objectspecifiers couldn't stand independently of Apple events and MacOS. Any application could use aeom in implementing and operating some or all of its object model, regardless of whether or not that application also supports RPC. And I don't think it'd be too hard to write an XML-RPC bridge for those less fortunate OSes not blessed with an Apple Event Manager - basically you'd just need to go through aem and replace all the Carbon.AE connections with xmlrpclib bindings to create a new xmlrpcm package. There will be practical design problems with aeom, of course; the most obvious being how to get good [default] performance out of it, since evaluating queries will almost inevitably involve a bit more expense than evaluating simple Python references. >>BTW, anyone know if there's a bug/request filed on BB-built >>applications to do something about them falling over and dying upon >>launch if there's a bug in the top-level code of the mainprogram >>script or that of any of its dependencies. > >Bundlebuilder could use some surgery. One thing I'd like to add to >bundlebuilder is the use of a custom main program, like the one used >in the PyObjC Xcode templates. That would remove one step in >bootstrap process, and would probably make it easier to add an error >dialog. Anything that'd make BB and BB-built apps more developer- and user-friendly would be very good indeed. (BTW, isn't Bob working on BB improvements as well?) >>[1] Any ideas if/how an Apple Event Object Model support framework >>could be made to play nice with PyObjC apps? > >Does the Carbon Apple Event Manager use CFRunLoop for running the >main event loop? If so, it should be possible to use your code in a >Cocoa application. I haven't played around with supporting AE in a >Cocoa application yet, which makes it hard to answer you question :-) I know very little about Cocoa programming (or Carbon programming, for that matter), which also makes it hard. When it comes to learning this stuff, I am definitely in remedial class, so the ball is probably in your court at this point.:p But if we (I?) are going to do all this work to bless Python with decent AEOM support, it'd be good to see if/how it could integrate into pure Python/hybrid Python-ObjC Cocoa apps. Cheers, has -- http://freespace.virgin.net/hamish.sanderson/ From edude89 at tds.net Mon Sep 20 01:13:59 2004 From: edude89 at tds.net (Evan Benner) Date: Tue Sep 21 09:56:43 2004 Subject: [Pythonmac-SIG] BitTorrent Help Message-ID: Hello, I am operating a Mac Os 9 and I am attempting to run BitTorrent, but am unable to figure out how to use it with MacPython. Please help! Thanx, Evan From mark at mophilly.com Tue Sep 21 17:04:47 2004 From: mark at mophilly.com (Mark Phillips) Date: Tue Sep 21 17:04:55 2004 Subject: [Pythonmac-SIG] BitTorrent Help In-Reply-To: References: Message-ID: <940E5D26-0BDF-11D9-B092-000A95A5888A@mophilly.com> On Sep 19, 2004, at 4:13 PM, Evan Benner wrote: > I am operating a Mac Os 9 and I am attempting to run BitTorrent, but am > unable to figure out how to use it with MacPython. Try this link. I saw a question similar to yours about 1/3 the way down the page: http://dessent.net/btfaq/#what hth, Mark Phillips Mophilly & Associates On the web at http://www.mophilly.com On the phone at 619 444-9210 From smithsm at samuelsmith.org Wed Sep 22 23:57:37 2004 From: smithsm at samuelsmith.org (Samuel M.Smith) Date: Wed Sep 22 23:57:44 2004 Subject: [Pythonmac-SIG] webkit cgi build and startupitems problems In-Reply-To: <44296DA8-F31B-11D7-B2D5-000A9574DA40@cs.vu.nl> References: <44296DA8-F31B-11D7-B2D5-000A9574DA40@cs.vu.nl> Message-ID: <6A871B24-0CE2-11D9-B0E7-000A95C4B360@samuelsmith.org> I have installed webkit on OSX Server 10.3.5. The mod_webkit built out of the box no problems and it is running fine. However, I couldn't build the c version wkcgi.cgi. I get this error? server:/users/webware/webware81/webkit/adapters/wkcgi root# make cc -O2 -c ./wkcgi.c -o ./wkcgi.o In file included from ../common/wkcommon.h:20, from wkcgi.h:6, from wkcgi.c:5: /usr/include/resolv.h:174: error: field `nsaddr_list' has incomplete type /usr/include/resolv.h:188: error: field `addr' has incomplete type /usr/include/resolv.h:216: error: field `sin' has incomplete type make: *** [wkcgi.o] Error 1 Anybody have any experience with this and know how to fix it? In the meantime I am using the python script version webkit.cgi. In order to run the appserver I use a terminal window with sudo -u webkit ./appserver This works fine until my server gets rebooted for some reason then I have to manually start it up again. The documentation gives examples on using the webware/webkit/webkit shell script to start on system startup but I can't make sense of it for os x. I believe on os X that your have to put things in /system/library/startupitems. I did this but I think there is more to it. Has anybody figured out how to have webkit appserver startup automatically in os x 10.3.5? When I manually try to execute webkit I get a permission denied for /var/spool/webkit From Chris.Barker at noaa.gov Thu Sep 23 01:06:21 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Thu Sep 23 01:12:25 2004 Subject: [Pythonmac-SIG] webkit cgi build and startupitems problems In-Reply-To: <6A871B24-0CE2-11D9-B0E7-000A95C4B360@samuelsmith.org> References: <44296DA8-F31B-11D7-B2D5-000A9574DA40@cs.vu.nl> <6A871B24-0CE2-11D9-B0E7-000A95C4B360@samuelsmith.org> Message-ID: <4152056D.1020909@noaa.gov> Samuel M.Smith wrote: > I have installed webkit on OSX Server 10.3.5. > However, I couldn't build the c version wkcgi.cgi. I get this error? This is a known issue, and is fixed in CVS. I'm pretty sure you need a new version of wkcommon.h, which you can get from: http://cvs.sourceforge.net/viewcvs.py/webware/Webware/WebKit/Adapters/common/ Here's the bug report: http://sourceforge.net/tracker/?group_id=4866&atid=104866&func=detail&aid=910023 > Has anybody figured out how to have webkit appserver startup > automatically in os x 10.3.5? sorry I haven't got that far yet! By the way, this would probably be better posted to the Webware list, rather than here. -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 arthur at visiblearea.com Thu Sep 23 03:44:19 2004 From: arthur at visiblearea.com (Arthur Clemens) Date: Thu Sep 23 03:44:24 2004 Subject: [Pythonmac-SIG] New to PyObjC - default XCode project error Message-ID: <163345BC-0D02-11D9-A322-000D93C1AC2A@visiblearea.com> When I create a new project from the XCode templates, I get this error when the app is built: ImportError: No module named PyObjCTools This is probably something obvious and known, but I can't find the heck why it doesn't work. I am using XCode 1.5 and Python 2.3. Arthur Clemens From piet at cs.uu.nl Thu Sep 23 13:39:45 2004 From: piet at cs.uu.nl (Piet van Oostrum) Date: Thu Sep 23 13:39:51 2004 Subject: [Pythonmac-SIG] New to PyObjC - default XCode project error In-Reply-To: <163345BC-0D02-11D9-A322-000D93C1AC2A@visiblearea.com> (Arthur Clemens's message of "Thu, 23 Sep 2004 03:44:19 +0200") References: <163345BC-0D02-11D9-A322-000D93C1AC2A@visiblearea.com> Message-ID: >>>>> Arthur Clemens (AC) wrote: AC> When I create a new project from the XCode templates, I get this error when AC> the app is built: AC> ImportError: No module named PyObjCTools AC> This is probably something obvious and known, but I can't find the heck why AC> it doesn't work. AC> I am using XCode 1.5 and Python 2.3. Did you install PyObjC? -- Piet van Oostrum URL: http://www.cs.uu.nl/~piet [PGP] Private email: P.van.Oostrum@hccnet.nl From arthur at visiblearea.com Thu Sep 23 13:48:03 2004 From: arthur at visiblearea.com (Arthur Clemens) Date: Thu Sep 23 13:48:06 2004 Subject: [Pythonmac-SIG] New to PyObjC - default XCode project error In-Reply-To: References: <163345BC-0D02-11D9-A322-000D93C1AC2A@visiblearea.com> Message-ID: <6D367E02-0D56-11D9-8797-000D93C1AC2A@visiblearea.com> On 23-sep-04, at 13:39, Piet van Oostrum wrote: >>>>>> Arthur Clemens (AC) wrote: > > AC> When I create a new project from the XCode templates, I get this > error when > AC> the app is built: > > AC> ImportError: No module named PyObjCTools > > AC> This is probably something obvious and known, but I can't find the > heck why > AC> it doesn't work. > AC> I am using XCode 1.5 and Python 2.3. > > Did you install PyObjC? Yes, I did. The version for 10.3. Arthur From arthur at visiblearea.com Thu Sep 23 17:18:03 2004 From: arthur at visiblearea.com (Arthur Clemens) Date: Thu Sep 23 17:18:11 2004 Subject: [Pythonmac-SIG] New to PyObjC - default XCode project error In-Reply-To: References: <163345BC-0D02-11D9-A322-000D93C1AC2A@visiblearea.com> <6D367E02-0D56-11D9-8797-000D93C1AC2A@visiblearea.com> Message-ID: > AC> Yes, I did. The version for 10.3. > > There should be a directory: > /Library/Python/2.3/PyObjC/PyObjCTools > which should contain __init__.py and quite a lot more and: > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site-packages > should be a symbolic link to /Library/Python/2.3 This is all there. Files, folders and linkage. Arthur From arthur at visiblearea.com Thu Sep 23 22:29:40 2004 From: arthur at visiblearea.com (Arthur Clemens) Date: Thu Sep 23 22:29:49 2004 Subject: [Pythonmac-SIG] New to PyObjC - default XCode project error In-Reply-To: References: <163345BC-0D02-11D9-A322-000D93C1AC2A@visiblearea.com> <6D367E02-0D56-11D9-8797-000D93C1AC2A@visiblearea.com> Message-ID: <4B75F8EE-0D9F-11D9-8797-000D93C1AC2A@visiblearea.com> If I type in the Terminal from PyObjCTools import AppHelper I don't get an error. Only in __main__.py this line causes the app to balk. Could it be a setting in XCode? Arthur -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 287 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040923/2b563c3d/attachment.bin From bob at redivi.com Thu Sep 23 22:46:54 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Sep 23 22:47:34 2004 Subject: [Pythonmac-SIG] New to PyObjC - default XCode project error In-Reply-To: <4B75F8EE-0D9F-11D9-8797-000D93C1AC2A@visiblearea.com> References: <163345BC-0D02-11D9-A322-000D93C1AC2A@visiblearea.com> <6D367E02-0D56-11D9-8797-000D93C1AC2A@visiblearea.com> <4B75F8EE-0D9F-11D9-8797-000D93C1AC2A@visiblearea.com> Message-ID: You must have several versions of Python installed, and the version of Python that the executable stub is detecting is not the version of Python that you installed PyObjC for. You need to edit the PyRuntimeLocations key in the application's Info.plist to point to the one(s) that you plan on using (probably @executable_path/.... and /System/...). I'm not sure what the default order is. On Sep 23, 2004, at 4:29 PM, Arthur Clemens wrote: > If I type in the Terminal > > from PyObjCTools import AppHelper > > I don't get an error. Only in __main__.py this line causes the app to > balk. > Could it be a setting in XCode? > > Arthur > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From arthur at visiblearea.com Thu Sep 23 23:05:34 2004 From: arthur at visiblearea.com (Arthur Clemens) Date: Thu Sep 23 23:05:41 2004 Subject: [Pythonmac-SIG] New to PyObjC - default XCode project error In-Reply-To: References: <163345BC-0D02-11D9-A322-000D93C1AC2A@visiblearea.com> <6D367E02-0D56-11D9-8797-000D93C1AC2A@visiblearea.com> <4B75F8EE-0D9F-11D9-8797-000D93C1AC2A@visiblearea.com> Message-ID: <4FA3041B-0DA4-11D9-8797-000D93C1AC2A@visiblearea.com> On 23-sep-04, at 22:46, Bob Ippolito wrote: > You must have several versions of Python installed, and the version of > Python that the executable stub is detecting is not the version of > Python that you installed PyObjC for. You need to edit the > PyRuntimeLocations key in the application's Info.plist to point to the > one(s) that you plan on using (probably @executable_path/.... and > /System/...). I'm not sure what the default order is. This is what the default template writes in the info.plist: PyRuntimeLocations @executable_path/../Frameworks/Python.framework/Versions/2.3/ Python ~/Library/Frameworks/Python.framework/Versions/2.3/Python /Library/Frameworks/Python.framework/Versions/2.3/Python /Network/Library/Frameworks/Python.framework/Versions/2.3/ Python /System/Library/Frameworks/Python.framework/Versions/2.3/ Python /sw/lib/libpython2.3.dylib Do you mean I should re-order them? I tried but without success. Arthur -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1405 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040923/bd754200/attachment.bin From bob at redivi.com Thu Sep 23 23:25:49 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Sep 23 23:26:27 2004 Subject: [Pythonmac-SIG] New to PyObjC - default XCode project error In-Reply-To: <4FA3041B-0DA4-11D9-8797-000D93C1AC2A@visiblearea.com> References: <163345BC-0D02-11D9-A322-000D93C1AC2A@visiblearea.com> <6D367E02-0D56-11D9-8797-000D93C1AC2A@visiblearea.com> <4B75F8EE-0D9F-11D9-8797-000D93C1AC2A@visiblearea.com> <4FA3041B-0DA4-11D9-8797-000D93C1AC2A@visiblearea.com> Message-ID: <23FB5E80-0DA7-11D9-BEA2-000A95686CD8@redivi.com> On Sep 23, 2004, at 5:05 PM, Arthur Clemens wrote: > > On 23-sep-04, at 22:46, Bob Ippolito wrote: > >> You must have several versions of Python installed, and the version >> of Python that the executable stub is detecting is not the version of >> Python that you installed PyObjC for. You need to edit the >> PyRuntimeLocations key in the application's Info.plist to point to >> the one(s) that you plan on using (probably @executable_path/.... and >> /System/...). I'm not sure what the default order is. > > This is what the default template writes in the info.plist: > > PyRuntimeLocations > > @executable_path/../Frameworks/Python.framework/Versions/ > 2.3/Python > ~/Library/Frameworks/Python.framework/Versions/2.3/Python string> > /Library/Frameworks/Python.framework/Versions/2.3/Python string> > /Network/Library/Frameworks/Python.framework/Versions/2.3/ > Python > /System/Library/Frameworks/Python.framework/Versions/2.3/ > Python > /sw/lib/libpython2.3.dylib > > > > Do you mean I should re-order them? I tried but without success. If you installed via the PyObjC .pkg installer, then it is installed for this Python: > /System/Library/Frameworks/Python.framework/Versions/2.3/ > Python You must have another Python 2.3 installed in one of the locations higher up on the list (you probably shouldn't). Uninstall it, or change the plist. -bob From arthur at visiblearea.com Fri Sep 24 00:14:39 2004 From: arthur at visiblearea.com (Arthur Clemens) Date: Fri Sep 24 00:14:44 2004 Subject: [Pythonmac-SIG] New to PyObjC - default XCode project error (solved) In-Reply-To: <23FB5E80-0DA7-11D9-BEA2-000A95686CD8@redivi.com> References: <163345BC-0D02-11D9-A322-000D93C1AC2A@visiblearea.com> <6D367E02-0D56-11D9-8797-000D93C1AC2A@visiblearea.com> <4B75F8EE-0D9F-11D9-8797-000D93C1AC2A@visiblearea.com> <4FA3041B-0DA4-11D9-8797-000D93C1AC2A@visiblearea.com> <23FB5E80-0DA7-11D9-BEA2-000A95686CD8@redivi.com> Message-ID: >> >> Do you mean I should re-order them? I tried but without success. > > If you installed via the PyObjC .pkg installer, then it is installed > for this Python: > >> /System/Library/Frameworks/Python.framework/Versions/2.3/ >> Python > > You must have another Python 2.3 installed in one of the locations > higher up on the list (you probably shouldn't). Uninstall it, or > change the plist. I followed the delete instructions on http://homepages.cwi.nl/~jack/macpython/uninstall.html, then installed MacPython addons for 10.3. Then rebuilt the app in XCode and all works now! Thanks for the help, I can start now. Arthur From shilmahr at gmx.de Sat Sep 25 10:59:32 2004 From: shilmahr at gmx.de (Sven Hilmahr) Date: Sat Sep 25 10:59:16 2004 Subject: [Pythonmac-SIG] python 2.3.4 framework installation: test_macostools failed Message-ID: <37476D6C-0ED1-11D9-8336-000A95B159D6@gmx.de> Hello, I'm new on this list. I tried to do a Python 2.3.4 framework installation on my Mac OS X 10.3.5. I configured as described in the ReadMe: ./configure --enable-framework But on make test, one test failed: test test_macostools failed -- Traceback (most recent call last): File "/Users/sven/Downloads/Python-2.3.4/Lib/test/test_macostools.py", line 78, in test_mkalias_relative macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix) File "/Users/sven/Downloads/Python-2.3.4/Lib/plat-mac/macostools.py", line 39, in mkalias relativefsr = File.FSRef(relative) Error: (-43, 'File not found') Here is the content of the files mentioned in the error notification: /Users/sven/Downloads/Python-2.3.4/Lib/test/test_macostools.py: (see line 78) 73 def test_mkalias_relative(self): 74 try: 75 os.unlink(TESTFN2) 76 except: 77 pass 78 macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix) 79 fss, _, _ = Carbon.File.ResolveAliasFile(TESTFN2, 0) 80 self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN)) /Users/sven/Downloads/Python-2.3.4/Lib/plat-mac/macostools.py: (see line 39) 27 # Not guaranteed to be correct or stay correct (Apple doesn't tell you 28 # how to do this), but it seems to work. 29 # 30 def mkalias(src, dst, relative=None): 31 """Create a finder alias""" 32 srcfsr = File.FSRef(src) 33 # The next line will fail under unix-Python if the destination 34 # doesn't exist yet. We should change this code to be fsref-based. 35 dstdir, dstname = os.path.split(dst) 36 if not dstdir: dstdir = os.curdir 37 dstdirfsr = File.FSRef(dstdir) 38 if relative: 39 relativefsr = File.FSRef(relative) I have no idea how to fix this. Does the comment "The next line will fail under unix-Python if the destination doesn't exist yet"? mean that I have ro create some directory first? Which one? If I do a ./configure without the --enable-framework option, no tests fail. Can you help me? Thanks, Sven From bob at redivi.com Sat Sep 25 16:02:22 2004 From: bob at redivi.com (Bob Ippolito) Date: Sat Sep 25 16:02:55 2004 Subject: [Pythonmac-SIG] python 2.3.4 framework installation: test_macostools failed In-Reply-To: <37476D6C-0ED1-11D9-8336-000A95B159D6@gmx.de> References: <37476D6C-0ED1-11D9-8336-000A95B159D6@gmx.de> Message-ID: <858BECEF-0EFB-11D9-A344-000A95686CD8@redivi.com> On Sep 25, 2004, at 4:59 AM, Sven Hilmahr wrote: > Hello, I'm new on this list. I tried to do a Python 2.3.4 framework > installation on my Mac OS > X 10.3.5. I configured as described in the ReadMe: > > ./configure --enable-framework > > But on make test, one test failed: > > test test_macostools failed -- Traceback (most recent call last): > File > "/Users/sven/Downloads/Python-2.3.4/Lib/test/test_macostools.py", > line 78, in test_mkalias_relative > macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix) > File "/Users/sven/Downloads/Python-2.3.4/Lib/plat-mac/macostools.py", > line 39, in mkalias > relativefsr = File.FSRef(relative) > Error: (-43, 'File not found') It doesn't sound like a big deal, and I wouldn't worry too much about it at the moment (macostools is rarely used by most people on OS X). The test is probably wrong in some way, Jack would know. -bob From shilmahr at gmx.de Sun Sep 26 17:41:12 2004 From: shilmahr at gmx.de (Sven Hilmahr) Date: Sun Sep 26 17:40:54 2004 Subject: [Pythonmac-SIG] python 2.3.4 framework installation: test_macostools failed In-Reply-To: <858BECEF-0EFB-11D9-A344-000A95686CD8@redivi.com> References: <37476D6C-0ED1-11D9-8336-000A95B159D6@gmx.de> <858BECEF-0EFB-11D9-A344-000A95686CD8@redivi.com> Message-ID: <7E87F5B8-0FD2-11D9-B758-000A95B159D6@gmx.de> On Sep 25, 2004 at 16:02 Bob Ippolito wrote: > > On Sep 25, 2004, at 4:59 AM, Sven Hilmahr wrote: > >> Hello, I'm new on this list. I tried to do a Python 2.3.4 framework >> installation on my Mac OS >> X 10.3.5. I configured as described in the ReadMe: >> >> ./configure --enable-framework >> >> But on make test, one test failed: >> >> test test_macostools failed -- Traceback (most recent call last): >> File >> "/Users/sven/Downloads/Python-2.3.4/Lib/test/test_macostools.py", >> line 78, in test_mkalias_relative >> macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix) >> File >> "/Users/sven/Downloads/Python-2.3.4/Lib/plat-mac/macostools.py", >> line 39, in mkalias >> relativefsr = File.FSRef(relative) >> Error: (-43, 'File not found') > > It doesn't sound like a big deal, and I wouldn't worry too much about > it at the moment (macostools is rarely used by most people on OS X). > The test is probably wrong in some way, Jack would know. > Thanks! So I have installed it now. No problems where reported on installation. I am a total beginner and if there is a bug at all I won't run into it too soon :) Thanks, Sven From Jack.Jansen at cwi.nl Sun Sep 26 23:43:09 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sun Sep 26 23:43:09 2004 Subject: [Pythonmac-SIG] python 2.3.4 framework installation: test_macostools failed In-Reply-To: <858BECEF-0EFB-11D9-A344-000A95686CD8@redivi.com> References: <37476D6C-0ED1-11D9-8336-000A95B159D6@gmx.de> <858BECEF-0EFB-11D9-A344-000A95686CD8@redivi.com> Message-ID: <0EBC0550-1005-11D9-9B16-000D934FF6B4@cwi.nl> On 25 Sep 2004, at 16:02, Bob Ippolito wrote: > It doesn't sound like a big deal, and I wouldn't worry too much about > it at the moment (macostools is rarely used by most people on OS X). > The test is probably wrong in some way, Jack would know. Right:-) The problem is in the test, not in the tested macostools framework. The test fails exactly once (for most people): the first time you build a framework Python. As soon as there's an installed framework Python it'll work. I've looked at it a couple of times, but there's something that makes it hard to fix. I forget what, but every time I look at it again (about once a year) I spend half an hour on it, and then when I finally find the problem again I say to myself: "Oh yes, *that* was the problem. Hmm, that's really hard 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 smithsm at samuelsmith.org Mon Sep 27 06:01:40 2004 From: smithsm at samuelsmith.org (Samuel M.Smith) Date: Mon Sep 27 06:01:44 2004 Subject: [Pythonmac-SIG] Python 2.3.4 Installation Message-ID: There isn't much on the new 2.3.4 Mac Python. Does 2.3.4 fix the problem where you couldn't have any framework version but the one that came with OSX (in this case 2.3 for Panther) ?. Does the install from source replace 2.3? There were a lot of posts about problems building extensions and stuff with a different version etc. Have those issues been resolved? More of a what is the current state of Python 2.3.4 framework on os x 10.3.5? From bob at redivi.com Mon Sep 27 06:19:44 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Sep 27 06:20:20 2004 Subject: [Pythonmac-SIG] Python 2.3.4 Installation In-Reply-To: References: Message-ID: <760736E0-103C-11D9-939F-000A95686CD8@redivi.com> On Sep 27, 2004, at 12:01 AM, Samuel M.Smith wrote: > There isn't much on the new 2.3.4 Mac Python. Does 2.3.4 fix the > problem where you couldn't have > any framework version but the one that came with OSX (in this case 2.3 > for Panther) ?. Yes the problem is fixed, but it's still present in the version of 2.3.0 that ships with 10.3.. so once you install any other framework build of 2.3 in the usual places, it will prevent any extension from linking correctly for 2.3.0. It's possible to monkeypatch Python 2.3.0 so it's not broken in this regard, though. Here's a diff: --- /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ config/Makefile Sun Mar 7 22:33:33 2004 +++ /Users/bob/Makefile Sun Mar 7 22:32:16 2004 @@ -95,8 +95,8 @@ # Symbols used for using shared libraries SO= .so -LDSHARED= $(CC) $(LDFLAGS) -bundle -framework $(PYTHONFRAMEWORK) -BLDSHARED= $(CC) $(LDFLAGS) -bundle -framework $(PYTHONFRAMEWORK) +LDSHARED= $(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup +BLDSHARED= $(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup DESTSHARED= $(BINLIBDEST)/lib-dynload # Executable suffix (.exe on Windows and Mac OS X) > Does the install > from source replace 2.3? No, it goes in /Library/Frameworks/Python.framework with some symlinks in /usr/local/bin > There were a lot of posts about problems building extensions and stuff > with > a different version etc. Have those issues been resolved? Same answer as the first question. > More of a what is the current state of Python 2.3.4 framework on os x > 10.3.5? Uh, it works fine? -bob From smithsm at samuelsmith.org Mon Sep 27 17:48:17 2004 From: smithsm at samuelsmith.org (Samuel M.Smith) Date: Mon Sep 27 17:48:22 2004 Subject: [Pythonmac-SIG] Python 2.3.4 Installation In-Reply-To: <760736E0-103C-11D9-939F-000A95686CD8@redivi.com> References: <760736E0-103C-11D9-939F-000A95686CD8@redivi.com> Message-ID: I am a little slow here, since the change is to the makefile, do I remake python 2.3 in order for the patch to work? or is it only going to be applied when you make a new extension? On Sep 26, 2004, at 22:19, Bob Ippolito wrote: > On Sep 27, 2004, at 12:01 AM, Samuel M.Smith wrote: > >> There isn't much on the new 2.3.4 Mac Python. Does 2.3.4 fix the >> problem where you couldn't have >> any framework version but the one that came with OSX (in this case >> 2.3 for Panther) ?. > > Yes the problem is fixed, but it's still present in the version of > 2.3.0 that ships with 10.3.. so once you install any other framework > build of 2.3 in the usual places, it will prevent any extension from > linking correctly for 2.3.0. > > It's possible to monkeypatch Python 2.3.0 so it's not broken in this > regard, though. Here's a diff: > > --- > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/config/Makefile Sun Mar 7 22:33:33 2004 > +++ /Users/bob/Makefile Sun Mar 7 22:32:16 2004 > @@ -95,8 +95,8 @@ > > # Symbols used for using shared libraries > SO= .so > -LDSHARED= $(CC) $(LDFLAGS) -bundle -framework $(PYTHONFRAMEWORK) > -BLDSHARED= $(CC) $(LDFLAGS) -bundle -framework $(PYTHONFRAMEWORK) > +LDSHARED= $(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup > +BLDSHARED= $(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup > DESTSHARED= $(BINLIBDEST)/lib-dynload > > # Executable suffix (.exe on Windows and Mac OS X) > From bob at redivi.com Mon Sep 27 18:10:28 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Sep 27 18:11:10 2004 Subject: [Pythonmac-SIG] Python 2.3.4 Installation In-Reply-To: References: <760736E0-103C-11D9-939F-000A95686CD8@redivi.com> Message-ID: On Sep 27, 2004, at 11:48 AM, Samuel M.Smith wrote: > On Sep 26, 2004, at 22:19, Bob Ippolito wrote: > >> On Sep 27, 2004, at 12:01 AM, Samuel M.Smith wrote: >> >>> There isn't much on the new 2.3.4 Mac Python. Does 2.3.4 fix the >>> problem where you couldn't have >>> any framework version but the one that came with OSX (in this case >>> 2.3 for Panther) ?. >> >> Yes the problem is fixed, but it's still present in the version of >> 2.3.0 that ships with 10.3.. so once you install any other framework >> build of 2.3 in the usual places, it will prevent any extension from >> linking correctly for 2.3.0. >> >> It's possible to monkeypatch Python 2.3.0 so it's not broken in this >> regard, though. Here's a diff: >> >> --- >> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ >> python2.3/config/Makefile Sun Mar 7 22:33:33 2004 > I am a little slow here, since the change is to the makefile, do I > remake python 2.3 in order for the patch to work? or is it only going > to be applied when you make a new extension? No, you do not remake Python 2.3 in order for this patch to work. How could you, it's not shipped with source! This Makefile is used by distutils as a 'configuration file' when building new extension modules. -bob From s.lach at wanadoo.nl Tue Sep 28 11:31:10 2004 From: s.lach at wanadoo.nl (Juan Sebasti=?ISO-8859-1?B?4Q==?=n Lach) Date: Tue Sep 28 11:31:11 2004 Subject: [Pythonmac-SIG] Speech Synthesis Message-ID: Hi there, Is there by any chance a version of the macspeech module than can work with OSX?? If not, would it be too difficult to implement? I want to control speech synthesis from Python and/or SuperCollider. Thanks JS Lach From hengist.podd at virgin.net Tue Sep 28 12:33:12 2004 From: hengist.podd at virgin.net (has) Date: Tue Sep 28 12:37:05 2004 Subject: [Pythonmac-SIG] Speech Synthesis In-Reply-To: References: Message-ID: Juan Sebasti?n Lach wrote: >Is there by any chance a version of the macspeech module than can work with >OSX?? If not, would it be too difficult to implement? I want to control >speech synthesis from Python and/or SuperCollider. Dunno about direct bindings, but if you don't mind using OSA scripting additions [euwww] it's easy enough to do via the Standard Additions' 'say' command using the osax and aem modules from : ####### #!/usr/local/bin/pythonw from osax import osax def say(text, display=None, voice=None, waiting=None, outputfile=None): """Speak the given text. text : str -- the text to speak, which can include intonation characters display : str -- the text to display in the feedback window (if different). Ignored unless Speech Recognition is on. voice : str -- the voice to speak with. Ignored if Speech Recognition is on. waiting : bool -- wait for speech to complete before returning (default is true). Ignored unless Speech Recognition is on. outputfile : anything -- the alias, file reference or Mac-style path string of an AIFF file (existing or not) to contain the sound output. """ params = {'----':text} for val, code in ((display, 'DISP'), (voice, 'VOIC'), (waiting, 'wfsp'), (outputfile, 'stof')): if val is not None: params[code] = val osax('syso', 'ttos', params) # TEST say('hello', voice='Zarvox') ####### HTH has -- http://freespace.virgin.net/hamish.sanderson/ From ksenia at ksenia.nl Tue Sep 28 12:45:26 2004 From: ksenia at ksenia.nl (Ksenia Marasanova) Date: Tue Sep 28 13:45:41 2004 Subject: [Pythonmac-SIG] python library and python includes locations Message-ID: <820E51FE-113B-11D9-8AD4-000A957911BC@ksenia.nl> Hi, I am installing some open source tool on my Mac, and the 'configure' script looks for 'Python.h' and 'PIL' library. But the script doesn't have correct location check for Mac. I found Python.h in /System/Library/Frameworks/Python.framework/Versions/2.3/include/ python2.3 and PIL in /Library/Python/2.3/. So I just wanted to make sure: are those the standard 'includes' and 'library' locations for Python on OS X? The developer wants to fix it, and I don't want to give wrong information. Sorry if this is a trivial question - any FAQ page will also be appreciated. Thanks, Ksenia. From arthur at visiblearea.com Tue Sep 28 16:10:39 2004 From: arthur at visiblearea.com (Arthur Clemens) Date: Tue Sep 28 16:10:46 2004 Subject: [Pythonmac-SIG] Dive Into Python example fileinfo on Mac Message-ID: <2CDA8D90-1158-11D9-8DCD-000D93C1AC2A@visiblearea.com> I am going through this excellent tutorial, and now I find that fileinfo.py does not do what it should do. Only the file name is returned, not the mp3 tags data. I wonder if this has to do with big-endion / little-endian? I suspect that this piece of code does not work well: class MP3FileInfo(FileInfo): "store ID3v1.0 MP3 tags" tagDataMap = {"title" : ( 3, 33, stripnulls), "artist" : ( 33, 63, stripnulls), "album" : ( 63, 93, stripnulls), "year" : ( 93, 97, stripnulls), "comment" : ( 97, 126, stripnulls), "genre" : (127, 128, ord)} Can anyone confirm this, or give me another hint? Arthur -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1001 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040928/85935b9d/attachment.bin From njriley at uiuc.edu Tue Sep 28 16:48:13 2004 From: njriley at uiuc.edu (Nicholas Riley) Date: Tue Sep 28 16:48:16 2004 Subject: [Pythonmac-SIG] Dive Into Python example fileinfo on Mac In-Reply-To: <2CDA8D90-1158-11D9-8DCD-000D93C1AC2A@visiblearea.com> References: <2CDA8D90-1158-11D9-8DCD-000D93C1AC2A@visiblearea.com> Message-ID: <20040928144813.GA8289@uiuc.edu> On Tue, Sep 28, 2004 at 04:10:39PM +0200, Arthur Clemens wrote: > I am going through this excellent tutorial, and now I find that > fileinfo.py does not do what it should do. Only the file name is > returned, not the mp3 tags data. > > class MP3FileInfo(FileInfo): > "store ID3v1.0 MP3 tags" ^^^^ I think this is likely your problem - this is just a limited example. You can use "Convert ID3 Tags" in iTunes's Advanced menu to convert a song to ID3v1.0 for testing, if you just want to play with the script. You may lose tag data, so do this on a copy of the song. If you want to actually parse ID3 tags, then use a more flexible module; it looks like there's one at . After converting tags on one of my songs to ID3v1.0, the script worked for me (downloaded as part of the examples: http://diveintopython.org/download/diveintopython-examples-5.4.zip>) -- =Nicholas Riley | From bob at redivi.com Tue Sep 28 17:07:23 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Sep 28 17:07:30 2004 Subject: [Pythonmac-SIG] Speech Synthesis In-Reply-To: References: Message-ID: <19CB2C33-1160-11D9-87DD-000A95686CD8@redivi.com> On Sep 28, 2004, at 5:31 AM, Juan Sebasti?n Lach wrote: > Is there by any chance a version of the macspeech module than can work > with > OSX?? If not, would it be too difficult to implement? I want to control > speech synthesis from Python and/or SuperCollider. There's more than one way to do it: /usr/bin/say (not sure when this was first available.. 10.2 maybe?) 10.3 and later you can use NSSpeechSynthesizer from PyObjC AppleScript (either via /usr/bin/osascript or one of the native bindings such as appscript) -bob From jwblist at olympus.net Wed Sep 29 01:23:31 2004 From: jwblist at olympus.net (John W. Baxter) Date: Wed Sep 29 01:23:46 2004 Subject: [Pythonmac-SIG] Speech Synthesis In-Reply-To: <19CB2C33-1160-11D9-87DD-000A95686CD8@redivi.com> Message-ID: On 9/28/2004 8:07, "Bob Ippolito" wrote: > /usr/bin/say (not sure when this was first available.. 10.2 maybe?) Well, at least it doesn't get fed its error output as a fresh thing to say. ;-) $say tidbits is a good cat. ## Component Manager: attempting to find symbols in a component alias of type (regR/carP/x!bt) From bob at redivi.com Wed Sep 29 01:41:18 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed Sep 29 01:41:24 2004 Subject: [Pythonmac-SIG] Speech Synthesis In-Reply-To: References: Message-ID: On Sep 28, 2004, at 7:23 PM, John W. Baxter wrote: > On 9/28/2004 8:07, "Bob Ippolito" wrote: > >> /usr/bin/say (not sure when this was first available.. 10.2 maybe?) > > Well, at least it doesn't get fed its error output as a fresh thing to > say. > ;-) > > $say tidbits is a good cat. > ## Component Manager: attempting to find symbols in a component alias > of > type (regR/carP/x!bt) You get those when you have a brokenish QuickTime component installed.. I think that's Toast. Check /Library/QuickTime -bob From s.lach at wanadoo.nl Wed Sep 29 09:05:54 2004 From: s.lach at wanadoo.nl (Juan Sebasti=?ISO-8859-1?B?4Q==?=n Lach) Date: Wed Sep 29 09:05:56 2004 Subject: [Pythonmac-SIG] Speech Message-ID: Thanks for the help. It worked in SuperCollider and with usr/bin/say. Osax didn't though I installed appscript and that works ok. Its no big deal because I'll use sc. Now the problem was hijacking the speech into sc, which I think is not possible. I rerouted through Soundflower and made it accesible to an audio bus, but with the (apparently unsurmoutable) problem that now there's no way to get the sound out to built in again... Anyway, I'll work with what I have now, thanx js From joaoleao at gmx.net Wed Sep 29 14:24:42 2004 From: joaoleao at gmx.net (=?ISO-8859-1?Q?Jo=E3o_Le=E3o?=) Date: Wed Sep 29 14:24:48 2004 Subject: [Pythonmac-SIG] Speech Synthesis In-Reply-To: References: Message-ID: <8AADD79F-1212-11D9-A4A1-000393967AF4@gmx.net> On 29 de set de 2004, at 0:41, Bob Ippolito wrote: >> $say tidbits is a good cat. >> ## Component Manager: attempting to find symbols in a component alias >> of >> type (regR/carP/x!bt) > > You get those when you have a brokenish QuickTime component > installed.. I think that's Toast. Check /Library/QuickTime I get the same output here, everytime I call some script that does some use of QuickTime. As Bob pointed out /Library/QuickTime contains the file "Toast Video CD Support.qtx". What should I do about it? Maybe remove it (guess I don't mind loosing video cd support in toast)... From bob at redivi.com Wed Sep 29 15:00:20 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed Sep 29 15:00:25 2004 Subject: [Pythonmac-SIG] Speech Synthesis In-Reply-To: <8AADD79F-1212-11D9-A4A1-000393967AF4@gmx.net> References: <8AADD79F-1212-11D9-A4A1-000393967AF4@gmx.net> Message-ID: <84937754-1217-11D9-97B2-000A95686CD8@redivi.com> On Sep 29, 2004, at 8:24 AM, Jo?o Le?o wrote: > > On 29 de set de 2004, at 0:41, Bob Ippolito wrote: > >>> $say tidbits is a good cat. >>> ## Component Manager: attempting to find symbols in a component >>> alias of >>> type (regR/carP/x!bt) >> >> You get those when you have a brokenish QuickTime component >> installed.. I think that's Toast. Check /Library/QuickTime > > I get the same output here, everytime I call some script that does > some use of QuickTime. > As Bob pointed out /Library/QuickTime contains the file "Toast Video > CD Support.qtx". > What should I do about it? Maybe remove it (guess I don't mind loosing > video cd support in toast)... Move it somewhere else, ignore the error, and/or whine to Roxio about it. You can always put it back if you feel the need to view a video cd with QuickTime, or you could use VLC which wouldn't need any plugins. -bob From hengist.podd at virgin.net Wed Sep 29 16:45:48 2004 From: hengist.podd at virgin.net (has) Date: Wed Sep 29 16:46:46 2004 Subject: [Pythonmac-SIG] Speech Message-ID: Juan Sebasti?n Lach wrote: >Thanks for the help. It worked in SuperCollider and with usr/bin/say. /usr/bin/say is probably easiest if you're on OS 10.3. >Osax didn't If you can send me a description of the problem I'd appreciate it. >though I installed appscript and that works ok. appscript supports application scripting, but not osaxen calls (not worth it). I'm wrapping the more useful Standard Addition commands by hand and will post that shortly. HTH has -- > http://freespace.virgin.net/hamish.sanderson/ From adam.naples at yale.edu Wed Sep 29 20:08:07 2004 From: adam.naples at yale.edu (Adam Naples) Date: Wed Sep 29 20:08:11 2004 Subject: [Pythonmac-SIG] solution for matplotlib compile problems In-Reply-To: <92A10444-D753-11D8-9884-000A956870AC@sbcglobal.net> References: <92A10444-D753-11D8-9884-000A956870AC@sbcglobal.net> Message-ID: <83B74998-1242-11D9-BABA-000A95928086@yale.edu> Hi, I have been trying to get the latest version of matplotlib to install (OS 10.3.5). the first attempt looked promising and then crashed after a few minutes. I downloaded this file you linked to and all I get is. $ python setup.py install Traceback (most recent call last): File "setup.py", line 52, in ? from setupext import build_agg, build_gtkagg, build_tkagg, \ ImportError: cannot import name build_transforms is this similar to the errors you were having? any help would be great. thanks in advance -an On Jul 16, 2004, at 2:11 PM, Kenneth McDonald wrote: > Just in case anyone else is interested... > > John Hunter, the fellow behind matplotlib, quickly provided a solution > to my compile problems on OS X. Fetch this file: > > http://matplotlib.sf.net/setupext.py > > and use it to replace the file of the same name in the matplotlib root > dir (dir containing 'setup.py'), then do the build. Worked great for > me. I would imagine this is now (or soon will be) in the distribution. > > Thanks for the help, everyone, > Ken > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From jdhunter at ace.bsd.uchicago.edu Wed Sep 29 21:50:03 2004 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Wed Sep 29 22:38:42 2004 Subject: [Pythonmac-SIG] solution for matplotlib compile problems In-Reply-To: <83B74998-1242-11D9-BABA-000A95928086@yale.edu> (Adam Naples's message of "Wed, 29 Sep 2004 14:08:07 -0400") References: <92A10444-D753-11D8-9884-000A956870AC@sbcglobal.net> <83B74998-1242-11D9-BABA-000A95928086@yale.edu> Message-ID: >>>>> "Adam" == Adam Naples writes: Adam> Hi, I have been trying to get the latest version of Adam> matplotlib to install (OS 10.3.5). the first attempt looked Adam> promising and then crashed after a few minutes. I Adam> downloaded this file you linked to and all I get is. You shouldn't do this. That file (written by me) was for an earlier version of matplotlib and the latest release includes those changes. Adam> $ python setup.py install Traceback (most recent call last): Adam> File "setup.py", line 52, in ? from setupext import Adam> build_agg, build_gtkagg, build_tkagg, \ ImportError: cannot Adam> import name build_transforms Adam> is this similar to the errors you were having? any help Adam> would be great. thanks in advance -an No this is unrelated to Kenneth's earlier problems, which were related to not being able to find tkinter properly. Your build tree is out of whack since you are using the wrong setup.py. Make sure you read the install instructions at http://matplotlib.sourceforge.net/installing.html including the OSX specific stuff, then get the latest tarball (0.63.0), rm -rf any old matplotlib packages you have a round, and trying anew. Post any build errors you get and I'll help you sort them out. Typically, only the first error message or two conveys any useful information. JDH From leknarf at pacbell.net Thu Sep 30 02:22:29 2004 From: leknarf at pacbell.net (Scott Frankel) Date: Thu Sep 30 02:22:34 2004 Subject: [Pythonmac-SIG] python & postgresql: libpython? Message-ID: New to databases, I'm doing some leg-work to see which open source db to use: postgresql or mysql. Without trying to start a flame war, I have questions regarding postgresql installation & python, which is the scripting language I'd like to use to interface with it. The installation docs warn that I might have to rebuild part of my python install to create a python shared library. Questions: - Does the standard 2.3 MacPython install build a shared library? If so, it doesn't appear to be called "libpython," as the postgresql docs suggest. - How would one rebuild part of the python install to create a shared library? [and on thinner ice ...] - All things being equal (which they're not!), which db has more robust/mature python interfaces to choose from? Thanks in advance! Scott From bob at redivi.com Thu Sep 30 03:52:06 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Sep 30 03:52:13 2004 Subject: [Pythonmac-SIG] python & postgresql: libpython? In-Reply-To: References: Message-ID: <5581EA00-1283-11D9-8E8C-000A95686CD8@redivi.com> On Sep 29, 2004, at 8:22 PM, Scott Frankel wrote: > New to databases, I'm doing some leg-work to see which open source db > to > use: postgresql or mysql. Without trying to start a flame war, I > have questions > regarding postgresql installation & python, which is the scripting > language I'd like > to use to interface with it. > > The installation docs warn that I might have to rebuild part of my > python install > to create a python shared library. > > > Questions: > > - Does the standard 2.3 MacPython install build a shared library? If > so, it doesn't > appear to be called "libpython," as the postgresql docs suggest. It's a framework, linked to with "-framework Python" instead of "-lpython" > - How would one rebuild part of the python install to create a shared > library? Don't, but if you had to you would configure without --enable-framework. > [and on thinner ice ...] > - All things being equal (which they're not!), which db has more > robust/mature > python interfaces to choose from? Anything but MySQL, in my experience. There are several for PostgreSQL and the two or three that I have tried have all worked pretty well. -bob From matteo.rattotti at gmail.com Thu Sep 30 09:40:53 2004 From: matteo.rattotti at gmail.com (Matteo Rattotti) Date: Thu Sep 30 09:40:57 2004 Subject: [Pythonmac-SIG] Pyobjc some help please (standalone application with xcode) Message-ID: <541186a0409300040672c8183@mail.gmail.com> Hi to all, I'm doing some program with pyobjc, and i like it a lot... I've installed the 1.1, so xcode gave me some template to create program, ok, very nice, using interface builder, using xcode to write the code, all is working nice, i build application and the .app work... But... There is a way to tell xcode that i want a standalone application, with pyobjc and other lib, so i can share my program to my little non-programmer friends? ;-) Thanks a lot for who respond me (maybe i offer a pizza) ps: python2.3, panther 10.3.5, xcode 1.1 Matteo Rattotti From s.lach at wanadoo.nl Thu Sep 30 13:56:26 2004 From: s.lach at wanadoo.nl (Juan Sebasti=?ISO-8859-1?B?4Q==?=n Lach) Date: Thu Sep 30 13:56:27 2004 Subject: [Pythonmac-SIG] Speech Message-ID: Hi Has, Although I had already solved the problem with .speak in sc, I installed appscript and osax didn't work, so I installed aem and osaterminology as described in the webpage, I also changed from appscript 0.5 to 0.6, after that, osax was still not found but the other things imported ok into python. I ran osax directly and it worked in the sense that it asked for a file to open and then ended (I guess that's ok), so after that I copied it into Library/Python/2.3 and now it imports but nothing happens when I run the script you sent. I'm not sure what I'm doing exactly and probably did some stuff wrong. Anyway, hope it helps you for what you're developing and if its enough to find a solution, it would certainly be very appreciated. Thanks js From jhrsn at pitt.edu Thu Sep 30 14:47:01 2004 From: jhrsn at pitt.edu (Jim Harrison) Date: Thu Sep 30 14:46:18 2004 Subject: [Pythonmac-SIG] cwd and PythonLauncher problem Message-ID: Sorry if this has been previously discussed. It appears that when a source file is double-clicked and starts with PythonLauncher (2.3), the directory of the file is not added to the Python module search paths. Thus other modules in that directory cannot be imported without a full path and files cannot be read or written using paths relative to the source file. IDLE, the Mac PythonIDE and the Windows implementation of Python seem to handle this correctly. The original launcher with MacPython (in the distant past) also handled this (PyOXIDE, on the other hand, seems to show the problem). Is a fix for this available or under consideration (with respect to the Launcher)? Or is this something that I've screwed up? Jim Harrison Univ. of Pittsburgh From jerry.levan at eku.edu Thu Sep 30 15:00:38 2004 From: jerry.levan at eku.edu (Jerry LeVan) Date: Thu Sep 30 15:00:43 2004 Subject: [Pythonmac-SIG] Re: python & postgresql: libpython? In-Reply-To: <20040930100003.CF2021E400E@bag.python.org> References: <20040930100003.CF2021E400E@bag.python.org> Message-ID: Scott, The Makefile that comes with Postgresql v 7.4.5 is a bit screwed up with respect to building the python shared lib. I posted a query on the postgresql general news group about the problem and a patch was posted by one of the developers. I googled around and also found a recipe for building the python shared library that also seems to work ( albeit a bit clumsy) Here are the instructions: If everything goes right, you should be able to make. Here you will get some problems with Python, but these can't be solved until a first (failing) make has been done. To fix these problems, open the src/Makefile.global and fix the line defining python_libspec by rep lacing it with: python_libspec = -framework Python Now go to the src/pl/plpython/ directory and open the Makefile with your favorite text editor, comm ent out the lines testing for a shared Python library (since on Mac OS X, this one is in a Framework , the test fails as written). #ifneq (,$(wildcard $(python_configdir)/libpython*$(DLSUFFIX)*)) #shared_libpython = yes #endif and #ifneq (,$(findstring yes, $(shared_libpython)$(allow_nonpic_in_shlib))) and don't forget the else part of it at the end of the file: #else # can't build #all: # @echo ""; # echo "*** Cannot build PL/Python because libpython is not a shared #library." ; # echo "*** You might have to rebuild your Python installation. Refer to"; # echo "*** the documentation for details."; # echo "" #endif # can't build Now you are ready to make again. It should work. Of course, if you run the configuration process again, you would also have to redo these changes ag ain. ********* Basically you have to change the value of the python-libspec to = -framework Python and then comment out the test for shared libs in the python make file. Anyway the shared library will be build and I was able to easily build the PyGreSQL module. I am a python newby but was able to get all of the python demo programs in the Douglas and Douglas book "Postgresql" to easily work (even the ones that used the Tk interfaces). Postgresql has interfaces to many programming systems Perl, Java, Tcl, Python,C, C++ and more. Hope this helps Jerry On Sep 30, 2004, at 6:00 AM, pythonmac-sig-request@python.org wrote: > From: Scott Frankel > Date: September 29, 2004 8:22:29 PM EDT > To: pythonmac-sig@python.org > Subject: [Pythonmac-SIG] python & postgresql: libpython? > > > > New to databases, I'm doing some leg-work to see which open source db > to > use: postgresql or mysql. Without trying to start a flame war, I > have questions > regarding postgresql installation & python, which is the scripting > language I'd like > to use to interface with it. > > The installation docs warn that I might have to rebuild part of my > python install > to create a python shared library. > > > Questions: > > - Does the standard 2.3 MacPython install build a shared library? If > so, it doesn't > appear to be called "libpython," as the postgresql docs suggest. > > - How would one rebuild part of the python install to create a shared > library? > > [and on thinner ice ...] > - All things being equal (which they're not!), which db has more > robust/mature > python interfaces to choose from? > > > Thanks in advance! > Scott > From matteo.rattotti at gmail.com Thu Sep 30 20:46:38 2004 From: matteo.rattotti at gmail.com (Matteo Rattotti) Date: Thu Sep 30 20:46:44 2004 Subject: [Pythonmac-SIG] Some problem with pyobjc (standalone application with xcode) Message-ID: <541186a040930114647f9f59@mail.gmail.com> Hi to all, I'm doing some program with pyobjc, and i like it a lot... I've installed the 1.1, so xcode gave me some template to create program, ok, very nice, using interface builder, using xcode to write the code, all is working nice, i build application and the .app work... But... There is a way to tell xcode that i want a standalone application, with pyobjc and other lib, so i can share my program to my little non-programmer friends? ;-) Thanks a lot for who respond me (maybe i offer a pizza) ps: python2.3, panther 10.3.5, xcode 1.1 Matteo Rattotti From jhrsn at pitt.edu Thu Sep 30 20:54:38 2004 From: jhrsn at pitt.edu (Jim Harrison) Date: Thu Sep 30 20:53:55 2004 Subject: [Pythonmac-SIG] Re: cwd and PythonLauncher problem -- a bit more info In-Reply-To: Message-ID: > Sorry if this has been previously discussed. It appears that when a source > file is double-clicked and starts with PythonLauncher (2.3), the directory > of the file is not added to the Python module search paths. Thus other > modules in that directory cannot be imported without a full path and files > cannot be read or written using paths relative to the source file. Sorry, I was inaccurate--importing is not affected. This problem appears to be specific to opening files. If a script is launched with PythonLauncher and it attempts to open a file in its own directory using only the name of the file (no path), it will fail with 'No such file or directory.' If the program writes a file using a file name only, it appears to write to one of two places: if it is running within a user directory tree it will write the file to the root of the user directory; if it is running outside a user directory (eg., the Applications directory) it will write to the root of the disk. My understanding is that relative file paths should be based on the directory containing the executing script. Programs executed on the Mac from within IDLE or MacPythonIDE appear to handle the script's directory correctly under these conditions. Is this a known or fixable issue with PythonLauncher, or should I be looking for a problem in my installation? Environment: OSX 10.3.5, Jack's MacPython 2.3 Panther addons Jim Harrison Univ. of Pittsburgh From bob at redivi.com Thu Sep 30 21:35:26 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Sep 30 21:36:01 2004 Subject: [Pythonmac-SIG] Re: cwd and PythonLauncher problem -- a bit more info In-Reply-To: References: Message-ID: On Sep 30, 2004, at 2:54 PM, Jim Harrison wrote: >> Sorry if this has been previously discussed. It appears that when a >> source >> file is double-clicked and starts with PythonLauncher (2.3), the >> directory >> of the file is not added to the Python module search paths. Thus other >> modules in that directory cannot be imported without a full path and >> files >> cannot be read or written using paths relative to the source file. > > Sorry, I was inaccurate--importing is not affected. This problem > appears to > be specific to opening files. If a script is launched with > PythonLauncher > and it attempts to open a file in its own directory using only the > name of > the file (no path), it will fail with 'No such file or directory.' If > the > program writes a file using a file name only, it appears to write to > one of > two places: if it is running within a user directory tree it will > write the > file to the root of the user directory; if it is running outside a user > directory (eg., the Applications directory) it will write to the root > of the > disk. > > My understanding is that relative file paths should be based on the > directory containing the executing script. Programs executed on the > Mac from > within IDLE or MacPythonIDE appear to handle the script's directory > correctly under these conditions. Is this a known or fixable issue with > PythonLauncher, or should I be looking for a problem in my > installation? > > Environment: OSX 10.3.5, Jack's MacPython 2.3 Panther addons Relative file paths are relative to the current directory. GUI apps in OS X always have a current directory of / (not sure why you ever saw it have a path of the user directory, maybe PythonLauncher does that on purpose?). It would make sense for PythonLauncher to behave otherwise though. In the meantime, you could do: import os os.chdir(os.path.dirname(__file__)) which will change to the directory that your script is in. -bob From ronaldoussoren at mac.com Thu Sep 30 15:29:39 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun Oct 3 20:02:23 2004 Subject: [Pythonmac-SIG] Pyobjc some help please (standalone application with xcode) In-Reply-To: <541186a0409300040672c8183@mail.gmail.com> References: <541186a0409300040672c8183@mail.gmail.com> Message-ID: On 30-sep-04, at 9:40, Matteo Rattotti wrote: > Hi to all, > > I'm doing some program with pyobjc, and i like it a lot... > I've installed the 1.1, so xcode gave me some template to create > program, ok, very nice, using interface builder, using xcode to write > the code, all is working nice, i build application and the .app > work... > But... There is a way to tell xcode that i want a standalone > application, with pyobjc and other lib, so i can share my program to > my little non-programmer friends? ;-) Hmm. The ProjectBuilder templates used to have a feature for that (some special build option). I cannot find it in the Xcode templates. I'm CC-ing pyobjc-dev, maybe some of the regulars there knows how to do this. Ronald > > Thanks a lot for who respond me (maybe i offer a pizza) > > ps: python2.3, panther 10.3.5, xcode 1.1 > > Matteo Rattotti > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173