[Pythonmac-SIG] Adding a track to an iTunes playlist (appscript)
I'm trying to translate the following applescript into python:tell application "iTunes" tell source "Library" tell playlist "Library" ** a bunch of code for selecting a_track and a_playlist duplicate a_track to a_playlist end tell end tellend tellWhat I've tried is:app('Itunes').sources['Library'].playlists['Library'].duplicate( a_track, to=a_playlist )and many variations of it. But all I get is an error saying "Too many direct arguments".Can anyone spot what I'm doing wrong?Thanks in advance,/David___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Using Sync Services from python
Does anyone know if it would be possible to use Sync Services from python, or from any other programming language than obj C? Can it be accessed through Apple Script? thanks /David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] C Extension build troubles in 10.6
I'm having trouble building extensions for python packages in Snow Leopard. I'm running into this issue with mxBase and psycopg2 currently. I haven't tried any others. Here's the output, this example being from mxBase: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -DUSE_FAST_GETCURRENTTIME -DBAD_STATIC_FORWARD=1 -UHAVE_STRPTIME -Imx/DateTime/mxDateTime -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -I/usr/local/include -I/opt/local/include -I/Library/Frameworks/Python.framework/Versions/2.5/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.macosx-10.3-i386-2.5_ucs2/mx-DateTime-mxDateTime-mxDateTime/mx/DateTime/mxDateTime/mxDateTime.o cc1: error: unrecognized command line option "-Wno-long-double" cc1: error: unrecognized command line option "-Wno-long-double" lipo: can't figure out the architecture type of: /var/folders/fO/fO43i+NPFDKpf9wCgPllnTI/-Tmp-//ccTzrZYF.out error: command 'gcc' failed with exit status 1 This is a new machine with a build environment that should be pretty clean. Any ideas? I'm having little luck figuring this out. There doesn't seem to be much information / discussion about the lipo error. Thanks, David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Won't Install Numarray-1.1.1 or Numeric_23.6
On Dec 7, 2004, at 11:57 AM, Benjamin Abécassis wrote: Hi everyone, I can't install Numarray-1.1.1 or Numeric_23.6 After typing, python setup.py install it tells, error: command 'gcc' failed with exit status 1 Here is the complete log : running install running build running build_py running build_ext building '_numpy' extension gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/System/Library/Frameworks/vecLib.framework/Headers -IInclude -IPackages/FFT/Include -IPackages/RNG/Include -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/ python2.3 -c Src/arrayobject.c -o build/temp.darwin-7.6.0-Power_Macintosh-2.3/Src/arrayobject.o unable to execute gcc: No such file or directory error: command 'gcc' failed with exit status 1 If anyone is aware of that problem ??!! Apart from that python seems to mork pretty well... Thanks in advance. I'm fairly new to OSX, but it looks to me like you don't have gcc installed. At your terminal window try: "which gcc" (w/o the quotes). It should return: /usr/bin/gcc If not, you need to install Apple's XCode which contains gcc and other development tools. XCode may be on the CD or in an directory on your harddrive, but I would recommend downloading the latest version from apple.com since it has some bug fixes you'll want. Dave ___ Pythonmac-SIG maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] problem creating first pyobjc file
I'm a Linux refugee familiar used to programming pygtk apps with glade and decided to see how to make Cocoa apps. I downloaded the pybobc 1.3b1 and py2app that Bob announced about a week ago. I'm following the tutorial and go to the step where I'm supposed to run: /usr/bin/python setup.py py2app -A and I get: Traceback (most recent call last): File "setup.py", line 2, in ? import py2app File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/py2app/__init__.py", line 43, in ? import distutils.dist, distutils.core, distutils.command, build_app, sys File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/py2app/build_app.py", line 24, in ? from py2app.find_modules import find_modules, parse_mf_results File "/Library/Python/2.3/py2app/py2app/__init__.py", line 33, in ? import py2app.install ImportError: No module named install Here is what I think is the relevant directory listing: 516 mac:/Library/Python/2.3/py2app/py2app $ ls -l total 464 -rw-rw-r-- 1 dreed admin 1185 30 Dec 21:18 __init__.py -rw-rw-r-- 1 dreed admin 1382 17 Mar 21:34 __init__.pyc -rw-rw-r-- 1 dreed admin227 17 Mar 21:34 __init__.pyo drwxrwxr-x 14 dreed admin476 23 Mar 16:32 apptemplate/ drwxrwxr-x 35 dreed admin 1190 23 Mar 16:32 bootstrap/ -rw-rw-r-- 1 dreed admin 37063 12 Mar 23:58 build_app.py -rw-rw-r-- 1 dreed admin 42985 17 Mar 21:34 build_app.pyc -rw-rw-r-- 1 dreed admin 42603 17 Mar 21:34 build_app.pyo drwxrwxr-x 14 dreed admin476 23 Mar 16:32 bundletemplate/ drwxrwxr-x 5 dreed admin170 23 Mar 16:32 command/ -rw-rw-r-- 1 dreed admin 1320 3 Dec 02:43 create_appbundle.py -rw-rw-r-- 1 dreed admin 1976 17 Mar 21:34 create_appbundle.pyc -rw-rw-r-- 1 dreed admin 1976 17 Mar 21:34 create_appbundle.pyo -rw-rw-r-- 1 dreed admin 1312 3 Dec 02:07 create_pluginbundle.py -rw-rw-r-- 1 dreed admin 2006 17 Mar 21:34 create_pluginbundle.pyc -rw-rw-r-- 1 dreed admin 2006 17 Mar 21:34 create_pluginbundle.pyo -rw-rw-r-- 1 dreed admin993 9 Feb 18:24 filters.py -rw-rw-r-- 1 dreed admin 1809 17 Mar 21:34 filters.pyc -rw-rw-r-- 1 dreed admin 1537 17 Mar 21:34 filters.pyo -rw-rw-r-- 1 dreed admin812 9 Dec 13:12 install.py -rw-rw-r-- 1 dreed admin 1402 17 Mar 21:34 install.pyc -rw-rw-r-- 1 dreed admin 1106 17 Mar 21:34 install.pyo drwxrwxr-x 27 dreed admin918 23 Mar 16:32 recipes/ drwxrwxr-x 8 dreed admin272 23 Mar 16:32 scripts/ -rw-rw-r-- 1 dreed admin 12264 12 Feb 02:56 util.py -rw-rw-r-- 1 dreed admin 16365 17 Mar 21:34 util.pyc -rw-rw-r-- 1 dreed admin 15028 17 Mar 21:34 util.pyo I see the install.py file. Any ideas what is wrong here? Thanks, Dave ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] problem creating first pyobjc file
On Mar 23, 2005, at 4:53 PM, Bob Ippolito wrote: On Mar 23, 2005, at 4:40 PM, David Reed wrote: I'm a Linux refugee familiar used to programming pygtk apps with glade and decided to see how to make Cocoa apps. I downloaded the pybobc 1.3b1 and py2app that Bob announced about a week ago. I'm following the tutorial and go to the step where I'm supposed to run: /usr/bin/python setup.py py2app -A and I get: Traceback (most recent call last): File "setup.py", line 2, in ? import py2app File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/py2app/__init__.py", line 43, in ? import distutils.dist, distutils.core, distutils.command, build_app, sys File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/py2app/build_app.py", line 24, in ? from py2app.find_modules import find_modules, parse_mf_results File "/Library/Python/2.3/py2app/py2app/__init__.py", line 33, in ? import py2app.install ImportError: No module named install You have two copies of py2app installed, one of which is older than 0.1.6. From <http://undefined.org/python/py2app.html>: As of version 0.1.6, py2app uses the extra_path feature of distutils, which changes the installation layout. If you have py2app 0.1.5 or earlier installed, you must manually remove the following directories from your site-packages directory (probably /Library/Python/2.3 ) if they exist before upgrading: â py2app â macholib â bdist_mpkg â modulegraph â altgraph so.. clobber those directories and reinstall the mpkg. Thanks Bob. A few of those didn't exist (modulegraph and altgraph I think), but I deleted the ones that did and got it to work. Now I need to look at the Cocoa books I borrowed from the library and try to understand a little bit more about Cocoa and Objective-C. Thanks, Dave ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] XML handler design
On Mar 24, 2005, at 8:35 AM, [EMAIL PROTECTED] wrote:
David Reed wrote:
There's probably a better mailing list with XML parsing experts. I'm
certainly not an expert but have done a little XML parsing.
I've always
followed the pattern of using startElement, characters and endElement
to grab all the data. In the startElement method you set a instance
variable to keep track of the current tag you are processing. You use
the characters method to build up the values and then in the
endElement
method you store the data in your data structure. See the pyxml HOWTO
for an example - specifically this section:
http://pyxml.sourceforge.net/topics/howto/node14.html
Yes, sure. Thanks, but
that's not what I wanted to know.
Perhaps I wasn't clear enough.
It's not really so much XML related...
def startElement(self, name, attrs):
self._queue.append(name) # keep the order of processed tags
handler = str('_start_'+name)
if hasattr(self, handler):
self.__class__.__dict__[handler](self, attrs)
Is there a better syntax for self.__class__.__dict__[handler]?
You should be able to use getattr to get the method and then call it.
That's a little cleaner IMO.
And where should the "output" go to?
All examples use print statements in the element handlers.
I'm not certain we are clear. Instead of output statements you set
store the data in some instance variable - in your case it appears
self.pages is your instance variable containing the data. So your
endElement method would set something in self.pages based on the tag
indicated and the data built up from the characters method and any of
the attrs from the start tag. If all your data is in the attrs that you
get in the startElement tag then there's no need to do anything in the
characters or endElement methods. If you want to use the
startElement/characters/endElement approach, I can try to find a small
example I've written and send it to you off-list.
I wrote those get... methods - but I guess they don't belong in the
XML handler, but perhaps in the parser or somewhere else.
It works, but I don't think it's good design.
def getPages(self):
return self.pages.getSortedArray()
def getPage(self, no):
return self.pages[no]
parser = xml.sax.make_parser()
parser.setFeature(xml.sax.handler.feature_namespaces, 0)
pxh = MyHandler()
parser.setContentHandler(pxh)
parser.parse(dateiname)
for p in pxh.getPages(): ...
I should ask the last question on the twisted ML, I guess:
Further, if I'd like to use it in a twisted driven asynchronous app,
would I let the parser run in a thread? (Or how can I make
the parser non-blocking?)
I've never looked into twister so I can't answer this.
Dave
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] building non-Framework Python 2.4.1 on Tiger
On May 4, 2005, at 7:30 PM, Bob Ippolito wrote: As far as friends scaring you off.. I dunno, maybe they didn't know what they were doing when they tried it, or they were bitten by some problem that has been solved long since. The only "incompatibility" with framework builds is that stupid extensions that don't use distutils in their build procedure aren't going to work out of the box, but they're probably not going to work out of the box anyway because Mac OS X's linker takes different options. -bob On a slightly related note, can I add third-party python modules to the framework using the standard Unix install process. For example, I'm using to installing Python modules on Linux using: python setup.py install or occasionally ./configure;make;make install I've installed your python2.4.1 on Tiger and the fix (just yesterday so I think I got the updated fix). I've installed a number of the packages your or someone else already built (Numeric, PyOpenGL, etc.), but what do I do if I want a module someone hasn't built. Dave smime.p7s Description: S/MIME cryptographic signature ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] py2app and CLI Python programs
I've got a command line Python app that I tried packaging up with py2app. It worked ok - t could cd into the subdir of the .app containing the executable and run it from the command line, but I'm not certain what its current working directory was since when I tried to specify a file on the command line, it didn't find it. I had to specify the full path to the file to make it work. Is there a simple workaround for command line versions - I didn't see anything in the documentation. Thanks, Dave ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Spotlight and Python
I noticed Spotlight doesn't index Python files. I'm not certain how useful it would be but I was thinking about trying to get spotlight to index the name of classes and functions/methods (i.e., you could enter a class name and spotlight would find the Python file containing the class). I don't care if it does it on the fly as files are updated, but thought it would be nice to be able to run a Python script that would index all Python files in a directory. You could use the inspect module to grab the class/function/method names and tell spotlight to include them. I know there are some command line tools to interact with spotlight, but after a quick look at them, nothing jumped out at me for doing this. Is anyone interested in this (i.e., would you find it useful) and if so, does anyone understand Spotlight well enough to point me in the right direction (pointers to specific documentation are welcome). Thanks, Dave ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] py2app and CLI Python programs
On May 10, 2005, at 1:28 PM, Bob Ippolito wrote: > On May 10, 2005, at 11:29 AM, Robert Kern wrote: > > >> David Reed wrote: >> >> >>> I've got a command line Python app that I tried packaging up with >>> py2app. It worked ok - t could cd into the subdir of the .app >>> containing the executable and run it from the command line, but I'm >>> not certain what its current working directory was since when I >>> tried >>> to specify a file on the command line, it didn't find it. I had to >>> specify the full path to the file to make it work. Is there a simple >>> workaround for command line versions - I didn't see anything in the >>> documentation. >>> >>> >> >> [/some/path] $ /Applications/MyApp.app/Contents/MacOS/MyApp >> >> will usually have /some/path as the cwd. >> >> However, .app bundles are probably not what you want for CLI apps. >> > > py2app will chdir to /Applications/MyApp.app/Contents/Resources by > default, if you specify the --no-chdir option, it will not change the > directory (but when started by LaunchServices, the cwd will be /). > > py2app is the only reliable way to create standalone Python > applications on Mac OS X.. it might make sense to write a CLI app > with it and throw some symlinks into /usr/local/bin or something.. > but you're probably better off just giving them the script and > telling them how to get the dependencies. Most people comfortable at > a CLI are going to be able to do that. > > -bob Thanks. The program needed PIL and I was just trying to avoid having the person need to install that, but you're right. Dave ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Spotlight and Python
On May 10, 2005, at 12:01 PM, Jonathan Wight wrote: > It's certainly a good idea. > > Writing a Spotlight plug-in is extremely straight forward - just > fire up Xcode 2 and create a new "Metadata Importer" project. You > just have one function that you need to provide: > > Boolean GetMetadataForFile(void* thisInterface, >CFMutableDictionaryRef attributes, >CFStringRef contentTypeUTI, >CFStringRef pathToFile) > > Don't forget to modify the Info.plist and possibly the schema.xml > file. > > Also - you'll probably need to create an installer for the importer > so that when installed it forces a reindex, see: http:// > www.apple.com/downloads/macosx/submit/installers.html > > Now I believe that Spotlight is smart enough to detect when a file > is created/written that needs importing so you wont have to > manually force any re-indexing yourself. > > I'm currently writing a spotlight importers for the GPX xml file > format and for another inhouse project of mine. > > Jon. I've looked at the example at: http://developer.apple.com/documentation/Carbon/Conceptual/ MDImporters/Concepts/WritingAnImp.html#//apple_ref/doc/uid/TP40001275- CJBEJBHH I don't yet understand what NSDictionary tempDict contains after it "loads the document at the specified location". My thought would be to read the file and look for def and class and then grab the next word after it and add it to the index. Looks like kMDItemTextContent is what could be used to do that. I could read the file in C and look for def/class and then would just need to figure out how to use the kMDItemTextContent class. Am I on the correct track? Dave ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Spotlight and Python
On May 10, 2005, at 3:57 PM, Jacob Kaplan-Moss wrote: > On May 10, 2005, at 2:00 PM, Jonathan Wight wrote: > > >> I'm not sure how useful it is to index function & class names though. >> >> > > Oh, I disagree -- I've got over 100K lines of code, and I would > *kill* to be able to find everywhere a particular symbol is used. > And yes, I know grep -r will do it for me -- but the more ways to > sift through data, the better. > > Jacob > I don't think I'd want all variables/symbols to be indexed, but I think function and class names might be nice and adding the documentation strings might be worthwhile too. It appears I still need to learn more about Objective-C although one of Jonathan's emails makes me think I could just read the file and make a space separated string of the functions and class names and that would about take care of it. If someone who knows more about Objective-C wants to take a stab at this feel free as I probably won't get to learning more about Objective-C for a couple more months. Dave ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Spotlight and Python
On May 10, 2005, at 8:52 PM, Jonathan Wight wrote:
> I've made a first pass at it and have a Spotlight importer that
> calls a built-in Python function to import a file's metadata.
>
> I started to look at module inspect to find out how to extract
> information from a Python module but then realised that I'd need to
> import the file the importer is analysing. This would mean it will
> be executing arbitrary code inside that file. That's got to be a
> bad thing for security reasons.
>
> So instead I'm just going to have to use string processing to scan
> the file instead. Are there any modules out there for extracting
> information from Python script files?
>
> Jon.
It's been a while since I looked at the inspect module - I didn't
remember it actually executed code. I'm not aware of any code that
processes a python file w/o executing it (I do remember that being a
complaint about pychecker). You could rip out code from the Python
interpreter, but I could probably write a C or C++ function that read
a file and returned the names of the classes and functions/methods in
less time than I could find and decipher the Python interpreter code
if that would help you. Would you pass it a filename or a file handle
and how would you want the data back (an array of strings or one long
string separated by spaces, etc.). Does it matter if it's C or could
it use C++ features (the C++ string class might be useful). I would
just look for "def" or "class" and grab the next word up to a "(" or
":".
Dave
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Spotlight and Python
On May 11, 2005, at 2:28 AM, Jonathan Wight wrote: > OK. The first version is online at: > > http://toxicsoftware.com/_private/Python%20Metadata%20Importer.pkg.zip > > The installer installs the mdimporter to /Library/Spotlight/ and > then calls mdimport -r to force Spotlight to reindex all Python files. > > You _may_ need Xcode installed to have this work successfully > (Apple defines the "public.python-script" UTI type - and it _may_ > be defined in Xcode - I need to check). > > This version scans through .py files looking for function names and > class names. It adds them to the file's 'org_python_functions' and > 'org_python_classes' metadata attributes respectively > > You can view the python specific metadata using mdls > > [EMAIL PROTECTED] Python Metadata Importer$ mdls *.py > myimporter.py - > kMDItemContentType = "public.python-script" > ... other metadata not shown ... > kMDItemKind= "Python Script" > org_python_functions = (find, main) > > And find it using mdfind: > > [EMAIL PROTECTED] Spotlight$ mdfind "org_python_functions == 'main'" | > wc -l > 41 > > You can also use the Finder to search for functions/classes: bring > up a new search window, then choose "other…" in the attribute menu, > in the attribute search window look for the keyword "Python"... It > is quite impressive doing a search for python function names from > the finder. > > The importer actually uses an embedded python interpreter to parse > the python files (thanks to Bob for suggest the parser module). You > can see the python file inside the Resources folder of the > importer. The code currently leaks a few PyObjects so I'll be > working on that in the next version. > > Currently I do not add anything to kMDItemTextContent or any other > metadata attribute but this kind of stuff should be easy to do > (just a one line change to the Python code). > > Any feedback quite welcome. > > Cheers. > > Jon. Thanks for working on this. I'm not certain it is working correctly. I installed it about 3 hours ago so I would think it has had time to index my drive by now. It does seem to have indexed files that are part of python packages but it hasn't index Python files in my home directory and subdirectories. Is it skipping these on purpose or does it somehow not realize they are Python files (most of them were created with emacs and many on Linux systems before I switched to a Mac)? They all do have a .py extension. Also, how do you uninstall your plugin? I do have XCode installed. Dave ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Spotlight and Python
On May 11, 2005, at 11:06 AM, Jonathan Wight wrote:
> It is entirely possible I screwed something up and that it doesn't
> work on anything other than my Powerbook ;-)
>
> However:
>
> As the last part of the install process the installer kicks off a
> script to reindex the Python files on the hard drive. This could be
> failing. To manually reindex runt this:
>
> mdimport -r /Library/Spotlight/Python\ Metadata\ Importer.mdimporter/
>
> You should see a response like this:
>
> 2005-05-11 10:55:48.004 mdimport[21563] Asking server to reimport
> files with UTIs: (
> "dyn.ah62d4rv4ge81a8k",
> "dyn.ah62d4rv4gq81k3p2su11upputf4gu55sfz30g6xmsb4a",
> "public.python-script"
> )
>
> On my machine with 2748 python files indexable by Spotlight
> ( mdfind 'kMDItemContentType == "public.python-script' | wc -l ) it
> seems to take less than 5 minutes with 2 mdimport tasks running at
> between 30-70% CPU.
>
> Note that spotlight doesn't index Python.framework by default - so
> you'd need to configure that somehow (perhaps via the .Spotlight-
> V100 directory).
>
> To confirm that the Python mdimporter is working run mdimport
> against a python file (with classes & functions declared) with
> debugging turned on. You should see something like this, note that
> mdimport is using the Python mdimporter and that the
> 'org_python_functions' attribute is present in the output:
>
> mdimport -d 2 myimporter.py
>
> 2005-05-11 11:03:51.318 mdimport[21650] Import '/Volumes/Home/Users/
> schwa/Desktop/Python Metadata Importer/myimporter.py' type
> 'public.python-script' using 'file://localhost/Library/Spotlight/
> Python%20Metadata%20Importer.mdimporter/'
> 2005-05-11 11:03:51.622 mdimport[21650] Done.
> 2005-05-11 11:03:51.624 mdimport[21650] Sending attributes of '/
> Volumes/Home/Users/schwa/Desktop/Python Metadata Importer/
> myimporter.py' to server. Attributes: '{
> "com_apple_metadata_modtime" = 137481386;
> kMDItemContentCreationDate = "2005-05-11 00:03:18 -0400";
> kMDItemContentModificationDate = "2005-05-11 01:16:26 -0400";
> kMDItemContentType = "public.python-script";
> kMDItemContentTypeTree = (
> "public.python-script",
> "public.shell-script",
> "public.script",
> "public.source-code",
> "public.plain-text",
> "public.text",
> "public.data",
> "public.item",
> "public.content"
> );
> kMDItemDisplayName = {"" = "myimporter.py"; };
> kMDItemKind = {"" = "Python Script"; };
> "org_python_classes" = ();
> "org_python_functions" = (find, main);
>
> Let me know if this works.
>
> Jon.
>
It doesn't appear to be working:
510 mac:~/src/CS160/ImageMessage $ mdimport -d 2 bits.py
2005-05-11 13:17:48.498 mdimport[3670] Import '/Users/dreed/src/CS160/
ImageMessage/bits.py' type 'public.python-script' using 'file://
localhost/Library/Spotlight/Python%20Metadata%20Importer.mdimporter/'
2005-05-11 13:17:48.879 mdimport[3670] -[FileProcessor
importMetadataFromFileAtPì¤í¸ íìot exception Conversion to encoding
30 failed for string "ì
2005-05-11 13:17:48.897 mdimport[3670] Import '/Users/dreed/src/CS160/
ImageMessage/bits.py' type 'public.python-script' no mdimporter
2005-05-11 13:17:48.900 mdimport[3670] Sending attributes of '/Users/
dreed/src/CS160/ImageMessage/bits.py' to server. Attributes: '{
"_kMDItemImporterCrashed" = 1;
"com_apple_metadata_modtime" = 137504114;
kMDItemContentCreationDate = 2005-05-11 07:35:14 -0400;
kMDItemContentModificationDate = 2005-05-11 07:35:14 -0400;
kMDItemContentType = "public.python-script";
kMDItemContentTypeTree = (
"public.python-script",
"public.shell-script",
"public.script",
"public.source-code",
"public.plain-text",
"public.text",
"public.data",
"public.item",
"public.content"
);
kMDItemDisplayName = {"" = "bits.py"; };
kMDItemKind = {
"" = PlainTextType;
ca = "Fitxer de Text Planer";
da = "Almindeligt tekstdokument";
de = "Reine Text-Datei";
en = "Plain Text File";
fr = "Fichier texte brut";
ja = "\U6a19\U6e96\U30c6\U30ad\U30b9\U30c8\U66f8\U985e";
ko = "\Uc77c\Ubc18 \Ud14d\Uc2a4\Ud2b8 \Ud30c\Uc77c";
ru = "\U041f\U0440\U043e\U0441\U0442\U043e\U0439 \U0442\U0435
\U043a\U0441\U0442";
"zh-Hant" = "\U7d14\U6587\U5b57\U6a94";
};
}'
The bits.py file is just:
#!/usr/bin/env python
#--
# bits.py
# Dave Reed
# 05/09/2005
#--
def get_bits(value, n=8):
'''get_bits(value, n):
generator to return individual bits in a value of n bits'''
pos_value = 2 ** (n-1)
# if a single character string, convert to ASCII code
try:
value = ord(value)
exc
Re: [Pythonmac-SIG] Spotlight and Python
On May 11, 2005, at 2:12 PM, Jonathan Wight wrote:
> For me it worked:
>
> "org_python_functions" = ("get_bits", "set_lsb", "get_lsb",
> "value_from_bits");
>
> But then I just made a new BBEdit Bits.py file and pasted your code
> into it.
>
> The importer does seem to be crashing, but I'm not sure whether the
> python or the ObjC is dying. Is there a crash log in either ~/
> Library/Logs/Crash Logs or /Library/Logs/Crash Logs.
>
> I'm working on version 0.2 with slightly better error handling and
> a lot less leaking of PyObject pointers.
>
> Jon.
>
I have a CrashReporter subdir, but not Crash Logs.
I see this in the console repeated for a bunch of the OpenGL files:
May 11 14:30:56 David-Reeds-Computer mdimportserver[3772]: -
[FileProcessor importMetadataFromFileAtPath:] Got exception
Conversion to encoding 30 failed for string "ìë íìí íì"
for path '/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/OpenGL/GL/Autodesk/facet_normal.py'
May 11 14:30:56 David-Reeds-Computer mdimportserver[3772]: -
[FileProcessor importMetadataFromFileAtPath:] Got exception
Conversion to encoding 30 failed for string "ìë íìí íì"
for path '/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/OpenGL/GL/Autodesk/valid_back_buffer_hint.py'
May 11 14:30:56 David-Reeds-Computer mdimportserver[3772]: -
[FileProcessor importMetadataFromFileAtPath:] Got exception
Conversion to encoding 30 failed for string "ìë íìí íì"
for path '/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/OpenGL/GL/EXT/_422_pixels.py'
May 11 14:30:56 David-Reeds-Computer mdimportserver[3772]: -
[FileProcessor importMetadataFromFileAtPath:] Got exception
Conversion to encoding 30 failed for string "ìë íìí íì"
for path '/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/OpenGL/GL/EXT/__init__.py'
And then this going on forever:
May 11 14:35:45 David-Reeds-Computer mdimportserver[3774]: Done.
I'm going to reboot after sending this.
I did delete and reinstall your file, but that didn't help.
Guess I'll just wait for the next version and try again.
Thanks,
Dave
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] PyObjC vs "old school" embedding
On May 31, 2005, at 4:51 PM, Bob Ippolito wrote: > > On May 31, 2005, at 1:17 PM, [EMAIL PROTECTED] wrote: > >> (* - I've downloaded and installed PyObjC 1.3.6 twice but for some >> reason it doesn't want to use it: >> >> gandreas% /Library/Frameworks/Python.framework/Versions/Current/bin/ >> python2.4 >> Python 2.4.1 (#2, Mar 31 2005, 00:05:10) >> [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin >> Type "help", "copyright", "credits" or "license" for more >> information. >> > import objc > objc.__version__ > >> '1.3.5' >> > objc.__file__ > >> '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ >> site-packages/PyObjC/objc/__init__.pyc' >> ) >> > > Anyone else have this problem? > > -bob I just downloaded and installed 1.3.6 and also have that problem. $ python2.4 Python 2.4.1 (#2, Mar 31 2005, 00:05:10) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import objc >>> objc.__version__ '1.3.5' >>> objc.__file__ '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/PyObjC/objc/__init__.pyc' Dave ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] PyObjC vs "old school" embedding
On May 31, 2005, at 6:54 PM, Bob Ippolito wrote: > > On May 31, 2005, at 2:27 PM, David Reed wrote: > > >> >> On May 31, 2005, at 4:51 PM, Bob Ippolito wrote: >> >> >> >>> >>> On May 31, 2005, at 1:17 PM, [EMAIL PROTECTED] wrote: >>> >>> >>> >>>> (* - I've downloaded and installed PyObjC 1.3.6 twice but for some >>>> reason it doesn't want to use it: >>>> >>>> gandreas% /Library/Frameworks/Python.framework/Versions/Current/ >>>> bin/ >>>> python2.4 >>>> Python 2.4.1 (#2, Mar 31 2005, 00:05:10) >>>> [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin >>>> Type "help", "copyright", "credits" or "license" for more >>>> information. >>>> >>>> >>>> >>>>>>> import objc >>>>>>> objc.__version__ >>>>>>> >>>>>>> >>>>>>> >>>> '1.3.5' >>>> >>>> >>>> >>>>>>> objc.__file__ >>>>>>> >>>>>>> >>>>>>> >>>> '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ >>>> site-packages/PyObjC/objc/__init__.pyc' >>>> ) >>>> >>>> >>>> >>> >>> Anyone else have this problem? >>> >> >> >> I just downloaded and installed 1.3.6 and also have that problem. >> >> $ python2.4 >> Python 2.4.1 (#2, Mar 31 2005, 00:05:10) >> [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin >> Type "help", "copyright", "credits" or "license" for more >> information. >> >> >>>>> import objc >>>>> objc.__version__ >>>>> >>>>> >> '1.3.5' >> >> >>>>> objc.__file__ >>>>> >>>>> >> '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ >> site- >> packages/PyObjC/objc/__init__.pyc' >> > > Did you have a previous installation of PyObjC 1.3.5? Which > package did you install? The one from pythonmac.org, or > sourceforge? What is the name of the package that you installed? > > -bob I did have an earlier version of pyobjc but I don't think it was 1.3.5. I recently got a desktop and had OS X transfer all the files from my laptop so it should be what is there. The laptop reports version 1.3 so that should be the earlier version that was installed on my desktop. Are you certain the version number just isn't wrong in the file? I installed pyobjc-1.3.6-py2.4-macosx10.4.mpkg I'm not certain where I started, but it did come from sf.net. http://prdownloads.sourceforge.net/pyobjc/pyobjc-1.3.6-py2.4- macosx10.4.zip?download Dave ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] hello and a first question for everyone...
hi all... at WWDC and i decided to join the SIG. also, i was wondering if anyone has gotten PyOpenGL and/or OpenGLContext to work in tiger (albeit under X11). if not, then what is the best way to go about establishing a context to associate with python ? thanks in advance! -- david ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Building a multi-component application with py2app
I have a wxPython application where the main process has a number of components that can be started as separate processes when required, for example, an independent GUI help viewer and several console-type helper tasks. With py2exe under MSW I can build them all into the same 'Dist' with a single setup.py so they share the same support modules and libraries. Is the same thing achievable with py2app? I can obviously build each component as a separate application, with no sharing, but the overhead is 10+ Mb per component. The py2app examples for drpython imply that the 'app' parameter in the call to setup can be a list of .pyw(?) files but when I try something similar, I get "error: Multiple targets not currently supported". Is it possible to achieve this, or maybe to 'merge' a number of standalone apps? Regards, David Hughes Forestfield Software ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] where is PyInterpreterView
Hi everybody, At WWDC, I saw the Python in OS X talk, and I am really interested in integrating PyInterpreterView in my application, in order to implement a sort of scripting/debugging system, but I can't seem to find the .palette file the widget is contained in. Is this something else I need to download and/or install ? Also, how would i go about setting up my application so that the PyInterpreterView would be able to access my application's globals? Any help is greatly appreciated. -- david ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] pyui font troubles
Hi,
I'm relatively new to Python and I'm trying to work through some
examples in Sean Riley's "Game Programming with Python" book.
Unfortunately, I'm having some trouble with most of the examples that
use his pyui library.
It looks like the examples fail when trying to create a font object
for the arial font. I took a look in the pyui code that creates the
font (using pygame) and it has this suspicious line:
> faceFile = os.environ['WINDIR'] + "/Fonts/" + fontRegistery[faceFile]
where fontRegistery[faceFile] == "arial.ttf"
That didn't fill me with a great deal of confidence (since it
produces a KeyError exception on WINDIR), so I tried a quick hack:
> if os.environ.has_key( 'WINDIR' ):
> faceFile = os.environ['WINDIR'] + "/Fonts/" +
> fontRegistery[faceFile]
> else:
> faceFile = "/Library/Fonts/Arial"
That gets me the bus error shown below. Clearly, the font format on
Mac OS X isn't what pygame is expecting.
Has anybody else had any luck getting the code from this book to work?
The error in the console looks like this:
> davidh% /usr/local/bin/pythonw terrainView.py
> Creating font: arial
> {'impact': 'impact.ttf', 'arial': 'arial.ttf', 'courier':
> 'cour.ttf', 'courier new': 'cour.ttf', 'times': 'times.ttf', 'comic
> sans ms': 'comic.ttf', 'times new roman': 'times.ttf'} arial
> Fatal Python error: (pygame parachute) Bus Error
> Abort
The stack crawl from the crash report looks like this:
> Exception: EXC_BAD_ACCESS (0x0001)
> Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x
>
> Thread 0 Crashed:
> 0 font.so 0x007bb464 initfont + 4972
> 1 org.python.python 0x10052e38 type_call + 284
> (typeobject.c:435)
> 2 org.python.python 0x1000c348 PyObject_Call + 48
> (abstract.c:1752)
> 3 org.python.python 0x1007c9e4 do_call + 136 (ceval.c:
> 3755)
> 4 org.python.python 0x1007c6dc call_function + 1068
> (ceval.c:3572)
> 5 org.python.python 0x1007a140 PyEval_EvalFrame +
> (ceval.c:2163)
> 6 org.python.python 0x1007b284 PyEval_EvalCodeEx +
> 2152 (ceval.c:2730)
> 7 org.python.python 0x10026274 function_call + 344
> (funcobject.c:548)
> 8 org.python.python 0x1000c348 PyObject_Call + 48
> (abstract.c:1752)
> 9 org.python.python 0x10015a88 instancemethod_call +
> 796 (classobject.c:2432)
> 10 org.python.python 0x1000c348 PyObject_Call + 48
> (abstract.c:1752)
> 11 org.python.python 0x1007c26c
> PyEval_CallObjectWithKeywords + 256 (ceval.c:3420)
> 12 org.python.python 0x1000eddc PyInstance_New + 320
> (classobject.c:576)
> 13 org.python.python 0x1000c348 PyObject_Call + 48
> (abstract.c:1752)
> 14 org.python.python 0x1007c9e4 do_call + 136 (ceval.c:
> 3755)
> 15 org.python.python 0x1007c6dc call_function + 1068
> (ceval.c:3572)
> 16 org.python.python 0x1007a140 PyEval_EvalFrame +
> (ceval.c:2163)
> 17 org.python.python 0x1007c83c fast_function + 212
> (ceval.c:3631)
> 18 org.python.python 0x1007c6c4 call_function + 1044
> (ceval.c:3568)
> 19 org.python.python 0x1007a140 PyEval_EvalFrame +
> (ceval.c:2163)
> 20 org.python.python 0x1007b284 PyEval_EvalCodeEx +
> 2152 (ceval.c:2730)
> 21 org.python.python 0x10026274 function_call + 344
> (funcobject.c:548)
> 22 org.python.python 0x1000c348 PyObject_Call + 48
> (abstract.c:1752)
> 23 org.python.python 0x10015a88 instancemethod_call +
> 796 (classobject.c:2432)
> 24 org.python.python 0x1000c348 PyObject_Call + 48
> (abstract.c:1752)
> 25 org.python.python 0x1007c9e4 do_call + 136 (ceval.c:
> 3755)
> 26 org.python.python 0x1007c6dc call_function + 1068
> (ceval.c:3572)
> 27 org.python.python 0x1007a140 PyEval_EvalFrame +
> (ceval.c:2163)
> 28 org.python.python 0x1007b284 PyEval_EvalCodeEx +
> 2152 (ceval.c:2730)
> 29 org.python.python 0x10026274 function_call + 344
> (funcobject.c:548)
> 30 org.python.python 0x1000c348 PyObject_Call + 48
> (abstract.c:1752)
> 31 org.python.python 0x10015a88 instancemethod_call +
> 796 (classobject.c:2432)
> 32 org.python.python 0x1000c348 PyObject_Call + 48
> (abstract.c:1752)
> 33 org.python.python 0x1007c26c
> PyEval_CallObjectWithKeywords + 256 (ceval.c:3420)
> 34 org.python.python 0x1000eddc PyInstance_New + 320
> (classobject.c:576)
> 35 org.python.python 0x1000c348 PyObject_Call + 48
> (abstract.c:1752)
> 36 org.python.python 0x1007c9e4 do_call + 136 (ceval.c:
> 3755)
> 37 org.python.python 0x1007c6dc call_function + 1068
> (ceval.c:3572)
> 38 org
Re: [Pythonmac-SIG] pyui font troubles
Thanks!
Now I'm getting somewhere. The examples now run and draw their
initial screens but they don't update. Everything seems to be running
OK in the background but the window doesn't update at all after the
initial drawing.
Oh, and I'm getting strange libpng errors in the console:
> libpng warning: Incomplete compressed datastream in iCCP chunk
> libpng warning: Profile size field missing from iCCP chunk
Sigh, it looks like I'll need to dig into this a bit more. At least
passing None in the font code is working.
Thanks,
Dave
On Jul 12, 2005, at 5:55 PM, Bob Ippolito wrote:
>
> On Jul 12, 2005, at 12:22 PM, David Hill wrote:
>
>
>> I'm relatively new to Python and I'm trying to work through some
>> examples in Sean Riley's "Game Programming with Python" book.
>> Unfortunately, I'm having some trouble with most of the examples that
>> use his pyui library.
>>
>> It looks like the examples fail when trying to create a font object
>> for the arial font. I took a look in the pyui code that creates the
>> font (using pygame) and it has this suspicious line:
>>
>>
>>
>>> faceFile = os.environ['WINDIR'] + "/Fonts/" + fontRegistery
>>> [faceFile]
>>>
>>>
>>
>> where fontRegistery[faceFile] == "arial.ttf"
>>
>> That didn't fill me with a great deal of confidence (since it
>> produces a KeyError exception on WINDIR), so I tried a quick hack:
>>
>>
>>
>>> if os.environ.has_key( 'WINDIR' ):
>>> faceFile = os.environ['WINDIR'] + "/Fonts/" +
>>> fontRegistery[faceFile]
>>> else:
>>> faceFile = "/Library/Fonts/Arial"
>>>
>>>
>>
>> That gets me the bus error shown below. Clearly, the font format on
>> Mac OS X isn't what pygame is expecting.
>>
>
> Yeah, those aren't going to work.
>
>
>> Has anybody else had any luck getting the code from this book to
>> work?
>>
>> The error in the console looks like this:
>>
>>
>>
>>> davidh% /usr/local/bin/pythonw terrainView.py
>>> Creating font: arial
>>> {'impact': 'impact.ttf', 'arial': 'arial.ttf', 'courier':
>>> 'cour.ttf', 'courier new': 'cour.ttf', 'times': 'times.ttf', 'comic
>>> sans ms': 'comic.ttf', 'times new roman': 'times.ttf'} arial
>>> Fatal Python error: (pygame parachute) Bus Error
>>> Abort
>>>
>>>
>>
>> The stack crawl from the crash report looks like this:
>>
>
> ---
>
>
>> Does anybody have any ideas or suggestions? Is pyui just not Mac (or
>> Linux, evidently) friendly? Could I have screwed up my installation
>> of Python 2.4 somehow?
>>
>
> Just use the default font (pass None for the path), or get ttfs
> from somewhere and use those. It sounds like the book (and quite
> possibly pyui) author didn't test anywhere but Windows, so you'll
> probably run into a bunch of stuff like this.
>
> -bob
>
>
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Getting Sharing name of the Macintosh via Python?
> *From:* "Schollnick, Benjamin" <[EMAIL PROTECTED]>
> *To:*
> *Date:* Wed, 3 Aug 2005 15:21:53 -0400
>
> Anyone have any idea on how to get the Machine Name from the Sharing
> Preference pane?
import os
def get_system_info():
""" Use system_profiler command to return a dict of
information about system
"""
info_dict = {'systemversion': None,
'kernelversion': None,
'bootvolume': None,
'computername': None,
'username': None }
command = 'system_profiler SPSoftwareDataType'
fo = os.popen(command, 'r')
for line in fo.readlines():
ilist = line[:-1].split(':')
if len(ilist) >= 2:
for key in info_dict:
if key == ilist[0].replace(' ','').lower():
info_dict[key] = ilist[1]
return info_dict
print repr(get_system_info())
Regards,
David Hughes
Forestfield Software
www.foresoft.co.uk
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Connecting to Windows shares
> *From:* Simon Brunning <[EMAIL PROTECTED]> > *To:* [email protected] > *Date:* Thu, 22 Sep 2005 10:24:34 +0100 > > I want to use a python script to copy some files from a Windows share > to my Mac. Connecting to a Windows share with Finder is easy, but how > do I do it from a script? (Python 2.4.1 on OSX 10.4.2, if it matters. > > -- > Cheers, > Simon B, If the Windows partition you've attached appears as an 'ejectable' drive in the leftmost Finder pane, you can see it and its contents under /volumes using a Terminal session. Here, it appears as a directory of the form ";". A problem arises if you attach more than one partition, as they are then given suffixes '-1' etc that depend on the order you attached them. Regards, David Hughes Forestfield Software ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Connecting to Windows shares
> *From:* [EMAIL PROTECTED] (David Hughes) > *To:* [email protected] > *Date:* Thu, 22 Sep 2005 11:12 +0100 (BST) > > > *From:* Simon Brunning <[EMAIL PROTECTED]> > > *To:* [email protected] > > *Date:* Thu, 22 Sep 2005 10:24:34 +0100 > > > > I want to use a python script to copy some files from a Windows share > > to my Mac. Connecting to a Windows share with Finder is easy, but how > > do I do it from a script? (Python 2.4.1 on OSX 10.4.2, if it matters. > > > > -- > > Cheers, > > Simon B, > > If the Windows partition you've attached appears as an 'ejectable' > drive in the leftmost Finder pane, you can see it and its contents > under /volumes using a Terminal session. Here, it appears as a > directory of the form ";". A problem arises if you > attach more than one partition, as they are then given suffixes '-1' > etc that depend on the order you attached them. > > Regards, > > David Hughes > Forestfield Software ...but of course, having just pressed the send button, I see that your actual question is how do I *connect* to the Windows share from a script - and I'm sorry but I don't know :-< DH ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] -undefined dynamic_lookup can't be used with MACOSX_DEPLOYMENT_TARGET environment
i got the following error when doing a make of psycopg 1.1.21 (and
1.1.19) on Mac OS. psycopg is middleware that allows python to talk
to postgres. it has been compiling flawlessly on all the platforms i
use it on. you can find out more about it at http://initd.org/
projects/psycopg1. Federico Di Gregorio the primary contributer, is
not a Mac developer and thus was unsure how to really solve this
error, and neither am i at least at the gcc level. even though i
have a long history of development and support with Mac, NeXT and
unix, i am a database applications developer/analyst/dba that uses
zope, python, and postgres for solutions and has a long history of
knowing gcc at a level of getting builds to work vs truly knowing
what is going on at that level...
./configure; make; sudo make install
works for 99% of the situations in my world ;-) ok... so maybe less
then that... but, you get the drift.
here is the error that i have encountered when i did the make:
gcc -L/usr/local/pgsql/lib/ -Wl,-x -bundle -undefined
dynamic_lookup ./module.o ./connection.o ./cursor.o ./typeobj.o ./
typemod.o -L/usr/local/pgsql/lib/ -lpq -lcrypto -ldl -o ./
psycopgmodule.so
/usr/bin/ld: flag: -undefined dynamic_lookup can't be used with
MACOSX_DEPLOYMENT_TARGET environment variable set to: 10.1
collect2: ld returned 1 exit status
make: *** [psycopgmodule.so] Error 1
i know that i had this successfully compiled with a prior version
cause i have it working =). however, i suspect that this was due to
the fact that it was using gcc 3.3 at the time and that i was
compiling on 10.3.
here is the relevant product version information. although, i would
suspect that in this case that all that matters is environment, gcc,
and psycopg:
Mac OS10.4.2
pythonPython 2.4.1 (#2, Mar 31 2005, 00:05:10) [GCC 3.3 20030304
(Apple Computer, Inc. build 1666)] on darwin
gccpowerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 (Apple Computer,
Inc. build 5026)
PostgreSQL7.4.6
Zope2.8.1
egenix-mx-base-2.0.6
psycopg1.1.21
NOTE: i have found a way to get past this, which follows, but my
main concern is... is the way that i did get it to work the right
way. i really don't feel that i know enough to answer that question
and i was hoping that someone might elaborate on what is going on
here. i would rather i was doing the right thing vs the way that
seems to work...
after looking thru the pythonmac sig this environment variable seems
to be coming up a lot. from what i can tell, it sets a minimum level
on where the code is suspected to run, it is not defined and thus
defaults to 10.1. i changed it as follows:
zope$ export MACOSX_DEPLOYMENT_TARGET=10.3
zope$ ./configure --with-python=/usr/local/bin/python --with-zope=/
usr/local/zope/2.8.1/ --with-mxdatetime-includes=/usr/local/lib/
python2.3/site-packages/mx/DateTime/mxDateTime/ --with-postgres-
includes=/usr/local/pgsql/include/ --with-postgres-libraries=/usr/
local/pgsql/lib/
{snip}
zope$ make
{snip, offending gcc following is happy now}
gcc -L/usr/local/pgsql/lib/ -Wl,-x -bundle -undefined
dynamic_lookup ./module.o ./connection.o ./cursor.o ./typeobj.o ./
typemod.o -L/usr/local/pgsql/lib/ -lpq -lcrypto -ldl -o ./
psycopgmodule.so
zope$
thus no more error -undefined dynamic_lookup can't be used with
MACOSX_DEPLOYMENT_TARGET environment
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] book recommendation
I've an experienced Python programmer on Linux - I've mainly used gtk
and glade for interfaces and now I'm slowly trying to get started
with Cocoa apps on X-Code.
I've got the CurrencyConverter example working in Python and I did
the HelloWorld example in "The Mac XCode 2 Book" by Cohen and Cohen
in Objective C. I got the Python version working by guessing that I
needed to use:
self.helloSayer.setStringValue_("Hello world")
based on the CurrencyConverter example that did: setFloatValue_
That was pretty obvious, but I think I need a Cocoa book that allows
me to see what all the methods are for a given object. I've just
started the above mentioned XCode 2 book, but it doesn't appear to
have the details of all the Cocoa objects.
Does anyone have a recommendation for another book I should get - I
assume I want a Cocoa book of some sort.
Thanks,
Dave
smime.p7s
Description: S/MIME cryptographic signature
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Calling python application from AppScript
Hello:
I'm sure there must be a simple answer, but I'm flummoxed trying to
send an AppleEvent from one python program to another.
The 'server' program has this code:
class avServer(AEServer, MiniApplication):
def __init__(self):
MiniApplication.__init__(self)
AEServer.__init__(self)
self.installaehandler('aevt','oapp',self.openApp)
self.installaehandler('aevt','quit',self.quit)
self.installaehandler('ascr','psbr',self.processEvent)
self.installaehandler('aevt','rapp',self.activate)
self.installaehandler('','',self.other)
When I use this applescript, it works:
tell application a
set r to processEvent("system", "start")
end tell
...but when I try from another python application I get an error:
from appscript import *
ap=app('pc-av')
ap.processEvent('system','start')
...or any number of other permutations. The most common error is
"RuntimeError: Unknown property, element or command: 'processEvent'
Does anyone have any tips on how to do this? I'm writing both the
client and server, so any method is fine. Get() and Set() will be
fine if I could only get them to work...
Thanks for any help you can give,
-dp-
David
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] book recommendation
On Nov 15, 2005, at 4:50 PM, Dethe Elza wrote: Hi David, While no one book covers all of Cocoa, going through a book can help give you a "feel" for how Cocoa programs come together. I've often caught myself making things *way* more difficult than they need to be before I discovered the Coccoa Way To Do It. I'm still learning the Cocoa Way, but it is worth the effort. I've found that both the Hillegass[1] and Garfinkel[2] books were worth reading, as have quite different approaches and cover different parts of Cocoa to some degree. I've heard good things about the Anguish[3] book, and while I haven't read it, I have read his earlier book and have high expectations of this one. Finally, keeping something like AppKiDo[4] around can help you navigate the Apple documentation more readily. I hope that helps. --Dethe [1] Aaron Hillegass, Cocoa Programming for OS X, ISBN: 0321213149 [2] Garfinkel and Mahoney, Building Cocoa Applications: A Step by Step Guide, ISBN: 0596002351 [3] Scott Anguish, et al., Cocoa Programming, ISBN: 0672322307 [4] http://homepage.mac.com/aglee/downloads/appkido.html Thanks to everyone who replied. The [4] program looks excellent for a reference. I still need a book to help me "learn the Cocoa way" as Dethe puts it. I'll probably take a look at the above mentioned books and buy at least one of them. The Mac XCode 2 book I have also appears that it will be useful for learning to use XCode but not for really understanding Cocoa (as I would expect based on the title). Dave smime.p7s Description: S/MIME cryptographic signature ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] xcode/pyobjc
I'm getting ready to attempt my first real Cocoa app. I notice XCode has an option for creating pyobjc apps (when it asks you what type of app you want to create). I tried this but am not certain I'm using it correctly - build and go is not active. I did go into the directory and type "python setup.py py2app" and .app in the build directory seemed to open ok. Is the preferred way to create the Cocoa pyobjc app directly using XCode (if so, any ideas on why build and go isn't active for me) or is the best way to follow the tutorial example where you just create a normal Cocoa Objective-C app, design the interface, and then run nibclassbuilder and create the setup.py file by hand? Thanks, Dave ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Selecting in BBEdit & Python Indenting style (spaces)
Odd, I always use 2 spaces, and haven't really heard 4 was standard. I don't keep up much with those things, though :) Tabs are certainly allowed. There is a potential difficulty in mixing tabs and spaces in the same file, since it is unclear how many spaces go into a tab, so there is potential for ambiguity. The WingIDE notices the file's indentation style and helps keep it straight. When debugging, I sometimes get a warning because the standard python libraries sometimes use different standards, and I have Wing setup to warn me in those cases. The WingIDE lets you choose which style to use. If you press tab, it tabs to the next potential spot, semi-intelligently - not just the next tab marker. Similar with backspace. I think Wing has done a great job in simplifying the tab/spaces difficulties, but they have quite a sophisticated algorithm for it - more complicated than ideally would be necessary, but it does eliminate the problem. -dp- On Nov 29, 2005, at 11:40 AM, Chris Barker wrote: > Louis Pecora wrote: > >> You hold down the option key while selecting, but you cannot do this >> in the soft wrap mode. You have to set the window to hard wrap at >> some column number. If you have the BBEdit manual, you can find more >> info around page 52 or just look in the index. > > thanks. > > >> What the heck were they (Guido?) thinking when they used 4 spaces as >> the one true mode of indentation for Python? > > I have no clue. It was a bad idea, from the beginning, to allow mixed > tabs+spaces. (I still don't understand why that hasn't been completely > deprecated). > >> I would think that TAB would be infinitely better and avoid the >> problems you point out that probably plague a lot of editors when >> doing Python code. > > I agree. Tabs would be easier in most cases, but: > >> And many editors allow you to set the size of the >> TAB (e.g. 2 spaces in size if you think 4 looks too large -- I do). > > Well, that is an issue. I think there is a trade off between people > making their own choice about what things should look like and > consistency. Also, aside form changing the size of tabs, various > places > people use text, like in email messages, html, etc, tabs get > mangled, so > that may be why spaces were selected as the standard. Or maybe > there is > no logic, and it's just what Guido likes. > > As it happens, the Mac is the only place I've ever had a problem, both > in the old macPython IDE and BBedit. All other editors I've used (at > least mildly competent ones) have been fine. > > -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 > > [EMAIL PROTECTED] > ___ > Pythonmac-SIG maillist - [email protected] > http://mail.python.org/mailman/listinfo/pythonmac-sig > ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] WebKitCtl on wxpython 2.6
Hi. I am wondering if anyone has a working example of using a WebKitCtl for Mac with wxpython. I am wanting HTMLWindow functionality but have not been able to create an instance. Many thanks. David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Pythonmac 10.2 wxPython and 2.4.1
I am trying to determine what to about my mac with python. I am running 10.2.8 and have been using 2.3.5 and the wxpython ansi though I really need the unicode build. This has been satisfactory since I can still do most everything except now I am finding more packages coming out with generator expressions and decorators that are not able to operate on 2.3.5. I checked the pythonmac site and I realize the focus is now 10.3. What are my options for having a working python 2.4.1 installation with a working unicode wxPython as well. I don't want to upgrade my OS for 150.00 at this point since I will eventually be purchasing a new machine in the next year. Regards, David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] PyCon TX 2006: Early-bird registration ends Dec. 31!
Early bird registration for PyCon TX 2006 ends on December 31st, so there are only a few days LEFT. To register, please visit: http://us.pycon.org/TX2006/Registration You can still register after Dec. 31st, but the cost will go up by US$65 (US$25 for students). This year PyCon will feature a day of tutorials before the three days of regular presentations. Course outlines for all the tutorials have been posted; see http://wiki.python.org/moin/PyCon2006/Tutorials All of the PyCon tutorials are still open for new registrations, but space is limited, and we suspect they'll all be filled up by the time early-bird registration closes. Don't forget to book your hotel room, too. PyCon TX 2006 is being held at a Dallas/Addison hotel, and we have negotiated a special low rate: http://us.pycon.org/Addison/Hotels We hope to see you in Texas! -- David Goodger (on behalf of A.M. Kuchling, Chair, PyCon 2006) signature.asc Description: OpenPGP digital signature ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] MacPython 2.4.1 over Mac's 10.3.9's persistent Python 2.3
Hi there. I recently upgraded my machine's OS from 10.2.8 (jaguar) to 10.3.9 (panther). I removed my previous 2.3.5 python mac install by removing Python.framework and MacPython-2.3 from Applications. I also removed python pythonw python2.3 and pythonw2.3 from /usr/local/bin. I installed PantherPythonFix.dmg and then installed MacPython-OSX-2.4.1-1.dmg. Install went fine - no errors. However, when I open a terminal I and type python or pythonw at the prompt I still get the Apple build of python after restarting and opening terminal. Can someone point out what the problem could be. This is quite frustrating since I remember the Jaguar install being very smooth and effortless. Regards, David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] MacPython 2.4.1 over Mac's 10.3.9's persistent Python 2.3
Hi Bob. I have this path is in my .cshrc where I am setting paths for my home. This seemed to work fine for Jaguar but I guess not for Panther. [dp_mac450:~] davidpra% python2.4 Python 2.4.1 (#2, Mar 31 2005, 00:05:10) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> [dp_mac450:~] davidpra% python Python 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> So getting python2.4, just not the right version from python or pythonw at command line as with macpython 2.3. I'll try setting path using the other method from the link you provided using the ~/.MacOSX/environment.plist method. Hopefully this will do the trick. Many thanks. Regards, David Bob Ippolito wrote: > > On Jan 7, 2006, at 4:13 PM, David Pratt wrote: > >> Hi there. I recently upgraded my machine's OS from 10.2.8 (jaguar) to >> 10.3.9 (panther). I removed my previous 2.3.5 python mac install by >> removing Python.framework and MacPython-2.3 from Applications. I also >> removed python pythonw python2.3 and pythonw2.3 from /usr/local/bin. I >> installed PantherPythonFix.dmg and then installed >> MacPython-OSX-2.4.1-1.dmg. Install went fine - no errors. >> >> However, when I open a terminal I and type python or pythonw at the >> prompt I still get the Apple build of python after restarting and >> opening terminal. Can someone point out what the problem could be. This >> is quite frustrating since I remember the Jaguar install being very >> smooth and effortless. > > > Add /usr/local/bin to your PATH environment variable. Installation for > Jaguar was the same. > > http://tinyurl.com/cwjc8 > > -bob > ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] MacPython 2.4.1 over Mac's 10.3.9's persistent Python 2.3
Right. I'm good to go! Many thanks for your help Bob :-) Regards, David Bob Ippolito wrote: > Given that, you must be placing /usr/local/bin after /usr/bin in your > PATH. That is not the correct thing to do for the behavior you want. > > e.g. you currently have this: > > export PATH=$PATH:/usr/local/bin > > but you want this instead: > > export PATH=/usr/local/bin:$PATH > > -bob > > On Jan 7, 2006, at 5:00 PM, David Pratt wrote: > >> Hi Bob. I have this path is in my .cshrc where I am setting paths for my >> home. This seemed to work fine for Jaguar but I guess not for Panther. >> >> [dp_mac450:~] davidpra% python2.4 >> Python 2.4.1 (#2, Mar 31 2005, 00:05:10) >> [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin >> Type "help", "copyright", "credits" or "license" for more information. >> >>>>> >> [dp_mac450:~] davidpra% python >> Python 2.3 (#1, Sep 13 2003, 00:49:11) >> [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin >> Type "help", "copyright", "credits" or "license" for more information. >> >>>>> >> >> So getting python2.4, just not the right version from python or pythonw >> at command line as with macpython 2.3. I'll try setting path using the >> other method from the link you provided using the >> ~/.MacOSX/environment.plist method. Hopefully this will do the trick. >> >> Many thanks. >> >> Regards, >> David >> >> Bob Ippolito wrote: >> >>> >>> On Jan 7, 2006, at 4:13 PM, David Pratt wrote: >>> >>>> Hi there. I recently upgraded my machine's OS from 10.2.8 (jaguar) to >>>> 10.3.9 (panther). I removed my previous 2.3.5 python mac install by >>>> removing Python.framework and MacPython-2.3 from Applications. I also >>>> removed python pythonw python2.3 and pythonw2.3 from /usr/local/ bin. I >>>> installed PantherPythonFix.dmg and then installed >>>> MacPython-OSX-2.4.1-1.dmg. Install went fine - no errors. >>>> >>>> However, when I open a terminal I and type python or pythonw at the >>>> prompt I still get the Apple build of python after restarting and >>>> opening terminal. Can someone point out what the problem could be. >>>> This >>>> is quite frustrating since I remember the Jaguar install being very >>>> smooth and effortless. >>> >>> >>> >>> Add /usr/local/bin to your PATH environment variable. Installation >>> for >>> Jaguar was the same. >>> >>> http://tinyurl.com/cwjc8 >>> >>> -bob >>> >> ___ >> Pythonmac-SIG maillist - [email protected] >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] a beginner's list
On Feb 8, 2006, at 1:40 PM, linc wrote: >> >> Full disclosure: I'm a UNIX person. The first thing >> I do when I get a >> new Mac is make sure X11 is installed on it, and >> in my >> Login Items. >> The second thing I do is build an X11 version of GNU >> Emacs from the >> CVS repository. >> > Hi, > This caught my eye. I have been using a Cocoa-based Emacs for a > year or > two, and it only has one font, kind of clumsy on my clamshell with the > low resolution. Any tips on doing this, or do you know of any binary > builds available? A real Emacs with X support would be awesome. > > Thanks, > linc Darwinports and/or fink has emacs w/ X11 support. I believe you have to specify +x11 or something like that when installing with fink. You can reply privately to this - just curious where at OSU you work? Do you do Mac programming there? Dave ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Job postings - allow or not?
[Jack Jansen] > I've just let a job posting through to the list, after looking at it > for a long time and unsure whether or not we want these. The Python Job Board is made for this very purpose: http://www.python.org/community/jobs/ New jobs are also picked up by Planet Python and its RSS feed (the job board itself may have a feed, but I can't find it). Perhaps redirect posters to the job board? -- David Goodger <http://python.net/~goodger> signature.asc Description: OpenPGP digital signature ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] importing dynamic library on intelMac
Hello All, I'm new here... and to dynamic libraries I've compiled a 3rd party's dynamic library , libXXX.dylib , a Mach- O dynamically linked shared library i386 and can't work out where to put it so that I can >>> import XXX is there a special place for such libraries? I've tried a few things without success. Would someone be kind enough to put me on the right path - [do I need to specifically have a dynamic libraries directory in my $PYTHONPATH for eg, and if so where should it be?] many thanks, David intelMac OS10.4.9 /Library/Frameworks/Python.framework/Versions/Current/bin/python Python 2.4.3 (#1, Mar 30 2006, 11:02:16) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin ___ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] importing dynamic library on intelMac
Thanks all for your advice. I've solved the problem; the library compiles and now includes the shared libraries directory. Turns out the problem I had was with scons. David On 02/09/2006, at 1:17 AM, Ronald Oussoren wrote: > > On 29-aug-2006, at 8:09, David Worrall wrote: > >> Hello All, I'm new here... and to dynamic libraries >> >> I've compiled a 3rd party's dynamic library , libXXX.dylib , a Mach- >> O dynamically linked shared library i386 >> and can't work out where to put it so that I can >>>>> import XXX >> is there a special place for such libraries? >> I've tried a few things without success. Would someone be kind enough >> to put me on the right path - > > You can't, unless the library is a python extension. There are > python bindings for numereous libraries, you can look for one in > the cheeseshop (http://cheeseshop.python.org/pypi) or using google > (not everything is listed in the cheeseshop). > > You can also look at http://www.pythonmac.org/packages/py24-fat/ > index.html to see if the library you want to use is already > available in a precompiled form. > > Ronald > ___ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Fwd: Problems running IDLE
Hi I am totally new to Python on the Mac (or Python anywhere else) and wanted to try it out, so I followed the instructions for Mac OS 10.3.90, downloaded Python 2.4.3 and tried to use IDLE With only the Python installer run IDLE will not run. The console error is that Tkinter is not set up. Following the instructions for 10.3 < 10.3.9 and installing the TkAqua package from the Python page IDLE will run, but as soon as click on anything (window, menu etc.) I get a spinning cursor that never stops. What else do I need to do to get IDLE to run without freezing? David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Problems running IDLE
Hi I am totally new to Python on the Mac (or Python anywhere else) and wanted to try it out, so I followed the instructions for Mac OS 10.3.90, downloaded Python 2.4.3 and tried to use IDLE With only the Python installer run IDLE will not run. The console error is that Tkinter is not set up. Following the instructions for 10.3 < 10.3.9 and installing the TkAqua package from the Python page IDLE will run, but as soon as click on anything (window, menu etc.) I get a spinning cursor that never stops. What else do I need to do to get IDLE to run without freezing? David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 41, Issue 9
Hi all I've had no responses so far to my message about not being able to run IDLE, is there some other place I can go for help with it? For reference I am using OS 10.3.9 and installed Python 2.4.3 as instructed on the install page. I then tried to run IDLE, which produced a console error about not being able to find TKInter. I then installed the TkAqua package from the Python install page and tried again. Now IDLE runs, but then hangs as soon as I click on anything (window, menu etc.) and never recovers. What do I need to do to get IDLE to run? David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Fwd: Wiki suggestions
In particular, check out http://moinmoin.wikiwikiweb.de/WikiEngineComparison which is a comparision of various wikis including the language used. David >> >> Perry> I'm curious if anyone on this list has either a >> suggestion for >> Perry> some Python based Wiki software or a pointer to a site >> that can >> Perry> help me in my search. >> >> MoinMoin? http://moinmoin.wikiwikiweb.de/ >> >> Skip >> ___ >> Pythonmac-SIG maillist - [email protected] >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> > > _ > David Worrall: [EMAIL PROTECTED] > > > ___ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] xcode problems
On 20/10/2006, at 5:26 PM, Ronald Oussoren wrote: > > On Friday, October 20, 2006, at 08:29AM, Muhammad Alkarouri > <[EMAIL PROTECTED]> wrote: > >> --- Ronald Oussoren wrote: >> ... >>> I'd drop Xcode unless you already know it, Xcode can be used as a >>> python editor but is really heavy-weight for what it offers to >>> Python >>> programmers (it's great for ObjC programming, but most of Xcode is >>> closed for Python programmers). >> >> Noted. I am at the moment trying TextWrangler for editing Python. >> May be I will >> revert to Idle. >> [rant] >> It is a shame, though. Xcode is a great python environment, as far >> as my >> experience goes. It would be far more useful if it were open source. >> [/rant] > I use TextWrangler as a general text processor, occasionally for quick code. On my OSX machines I find scrIDE (http://projects.gandreas.com/ scride/) more stable than IDLE. It's especially good for wxPython stuff. David ___ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] IDLE and MacPython 2.5
For what it' worth, perhaps to save you some time, I recently spent a day evaluating these tools. Horses for courses, but for me: TextWrangler is a freebie BBEditLite - a very nice word-processor which is keyword aware; SPE is a full-blown development environment which includes wxglade interface to wxwindows I found it difficult to 'grock' quickly but it could be good ScrIDE is 1/2 way between. I opted for ScrIDE - it's simple to use (ie no manual necessary) and stable. + using wxglade indpendently for wxwidget development. My config: intel OSX 10.4.8 MacPython 2.4.3 If anyone's using MacPython + wxglade into scrIDE and can report it AOK I'd be pleased to hear. David On 26/10/2006, at 2:13 AM, Christopher Barker wrote: > While we're at it, if all you want is a Python-aware editor -- then > there area a lot of other (better?) options. Scan the archives of this > list for suggestions. A few: > > BBEdit (TextWrangler?) > Eclipse > SPE > Jedit > ScrIDE > > > Assorted *nix editors: emaca, VIm, etc, etc. > > or look here: > > http://wiki.python.org/moin/PythonEditors > > -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 > > [EMAIL PROTECTED] > ___ > Pythonmac-SIG maillist - [email protected] > http://mail.python.org/mailman/listinfo/pythonmac-sig > ___ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] IDLE and MacPython 2.5
no need for a file? then enjoy the delights of the interpreter. just $ /usr/bin/python (at the prompt) will get you the interpreter at which you can play around. sometimes I do that whilst I'm trying to work out what I want (by looking at the results of various processes) and then drag/copy and past into a text edit doco when it's right, and sometimes the reverse, especially for looping structures. That afterall is one of the beauties of interpreted languages ... you don't need to know what you want until you see the it .. This means that it is a tool for thought rather than just a tool for executing a known idea. All the best w. python. I've programmed in everything from fortran II , pascal, snobol, apl, forth, c, assemblers etc etc and python for 7 years on all sorts of platforms. These days there has to be a pretty convincing argument for me to use anything else. ---David On 26/10/2006, at 7:28 PM, Rodney Somerstein wrote: > Thanks Chris and David for the suggestions. I'm already aware of > other editors. But, as I mentioned, I'm currently learning Python and > an environment that actually lets me execute python code without > having to first create and save a file is superior for that purpose, > in my opinion. > > I already own BBEdit and have for many years. So, when I start > actually writing real code, I will likely use that. > >> For what it' worth, perhaps to save you some time, I recently spent >> a day evaluating >> these tools. Horses for courses, but for me: >> TextWrangler is a freebie BBEditLite - a very nice word-processor >> which is keyword aware; >> SPE is a full-blown development environment which includes wxglade >> interface to wxwindows >> I found it difficult to 'grock' quickly but it could be good >> ScrIDE is 1/2 way between. >> >> David >> >> On 26/10/2006, at 2:13 AM, Christopher Barker wrote: >> >>> While we're at it, if all you want is a Python-aware editor -- then >>> there area a lot of other (better?) options. Scan the archives of >>> this >>> list for suggestions. A few: >>> >>> BBEdit (TextWrangler?) >>> Eclipse >>> SPE >>> Jedit >>> ScrIDE >>> >>> >>> Assorted *nix editors: emaca, VIm, etc, etc. >>> >>> or look here: >>> >>> http://wiki.python.org/moin/PythonEditors >>> >>> -Chris > > > -- > > Rodney SomersteinAlways remember that you are unique... > [EMAIL PROTECTED] just like everyone else. > ___ > Pythonmac-SIG maillist - [email protected] > http://mail.python.org/mailman/listinfo/pythonmac-sig > ___ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] IDLE and MacPython 2.5
There was a time a while ago when IDLE was a pain/unstable etc etc on intel OSX and I guess I just gave up. I used to use it all the time. Perhaps it works ok these days. Stopping to sharpen one's axe is ok as long as one doesn't get bogged down in the process. Now, where was that nifty little chain-saw I had yesterday?.. :-) David. On 27/10/2006, at 3:40 PM, Ronald Oussoren wrote: > Why does everyone seem to want to push people away from IDLE? IDLE > isn't award-winning material, but it does work properly as a simple > python environment. > > In a way it is better than most programmers text editors because > although it is missing some of the advanced editor features these > offer it does come with an embedded python interpreter and debugger. > > Ronald > > On Oct 27, 2006, at 4:26 AM, David Worrall wrote: > >> no need for a file? then enjoy the delights of the interpreter. just >> $ /usr/bin/python (at the prompt) >> >> will get you the interpreter at which you can play around. >> sometimes I do that whilst I'm trying to work out what I want >> (by looking at the results of various processes) >> and then drag/copy and past into a text edit doco when it's right, >> and sometimes the reverse, especially for looping structures. >> >> That afterall is one of the beauties of interpreted languages ... >> you don't need to know what you want until you see the it .. >> This means that it is a tool for thought rather than just a tool for >> executing a known idea. >> >> All the best w. python. I've programmed in everything from >> fortran II , pascal, snobol, apl, forth, c, assemblers etc etc >> and python for 7 years on all sorts of platforms. These days >> there has to be a pretty convincing argument for me to use >> anything else. >> >> ---David >> >> On 26/10/2006, at 7:28 PM, Rodney Somerstein wrote: >> >>> Thanks Chris and David for the suggestions. I'm already aware of >>> other editors. But, as I mentioned, I'm currently learning Python >>> and >>> an environment that actually lets me execute python code without >>> having to first create and save a file is superior for that purpose, >>> in my opinion. >>> >>> I already own BBEdit and have for many years. So, when I start >>> actually writing real code, I will likely use that. >>> >>>> For what it' worth, perhaps to save you some time, I recently spent >>>> a day evaluating >>>> these tools. Horses for courses, but for me: >>>> TextWrangler is a freebie BBEditLite - a very nice word-processor >>>> which is keyword aware; >>>> SPE is a full-blown development environment which includes wxglade >>>> interface to wxwindows >>>> I found it difficult to 'grock' quickly but it could be good >>>> ScrIDE is 1/2 way between. >>>> >>>> David >>>> >>>> On 26/10/2006, at 2:13 AM, Christopher Barker wrote: >>>> >>>>> While we're at it, if all you want is a Python-aware editor -- >>>>> then >>>>> there area a lot of other (better?) options. Scan the archives of >>>>> this >>>>> list for suggestions. A few: >>>>> >>>>> BBEdit (TextWrangler?) >>>>> Eclipse >>>>> SPE >>>>> Jedit >>>>> ScrIDE >>>>> >>>>> >>>>> Assorted *nix editors: emaca, VIm, etc, etc. >>>>> >>>>> or look here: >>>>> >>>>> http://wiki.python.org/moin/PythonEditors >>>>> >>>>> -Chris >>> >>> >>> -- >>> >>> Rodney SomersteinAlways remember that you are unique... >>> [EMAIL PROTECTED] just like everyone else. >>> ___ >>> Pythonmac-SIG maillist - [email protected] >>> http://mail.python.org/mailman/listinfo/pythonmac-sig >>> >> >> ___ >> experimental polymedia: www.avatar.com.au >> Sonic Communications Research Group, >> University of Canberra: www.canberra.edu.au >> >> >> >> >> ___ >> Pythonmac-SIG maillist - [email protected] >> http://mail.python.org/mailman/listinfo/pythonmac-sig > ___ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] IDLE and MacPython 2.5
> yes I remember the pain of the rewire from ed to vi ! isn't it amazing that the fingers remember! There was a time last century when I didn't use a unix machine for 10 years, then logged onto an SGi, fired up vi and in 30 seconds flat all the commands were at my fingertips. Like playing Bach learned in childhood! I've always thought the fist (mouse) was a retrogressive replacement to fingers. Now if only well all used Dvorak! :-) David at least Mac now has the option, and what an irony that we've come such full circle. > As full disclosure: I don't use IDLE very often but am a vi junkie. > None of the GUI editors have made enough of an impact yet to get me > to go through the painfull process of rewireing my fingers. > > Ronald > ___ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] python threading and multiple processors
Hi All, Can anyone tell me whether or not the python threading module can make use of multiple processors (such as on the intel Mac)? many thanks, David ___ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Is there a Python 2.5 Framework?
Hey Mark! I'm doing that. Let me recommend a couple of tools: (a) PythonCard (b) wxGlade - haven't tested with Python2.5 but works w. earlier version (c) book: "wxPython in Action" excellent read, whether you use (a) or (b) good luck! David PS I have no affiliations that would allow me to benefit from these recommendations. On 17/11/2006, at 1:50 PM, Kevin Walzer wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Mark Livingstone wrote: >> Hi Guys, >> >> I want to develop with wxPython. To do so natively (ie without going >> via X11 / GTK) it says you need to use a Framework version of Python. >> >> I have googled but not yet found what I seek. Does anyone know if a >> Framework 2.5 Python does exist and where? >> >> TIA >> >> MarkL >> ___ >> Pythonmac-SIG maillist - [email protected] >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> > Download the Mac OS X version of Python 2.5 from python.org. > > - -- > Kevin Walzer > Code by Kevin > http://www.codebykevin.com > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.5 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFFXSNvEsLm8HXyq4sRAkHvAJ4lbuSUMq6czjJS2cbKVmTsJu4DcwCeJD9f > fHY0LXvMtTTBYWzfNMpWvm4= > =uWbQ > -END PGP SIGNATURE- > ___ > Pythonmac-SIG maillist - [email protected] > http://mail.python.org/mailman/listinfo/pythonmac-sig > ___ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Problem with pygame and py2app
Hi, I've been working on a small pygame app and I've just now started trying to build a Mac OS X application bundle out of it. When I run "python setup.py py2app" with no additional options, I get a verbose set of output ending with: > linking /Volumes/Storage/Users/davidh/Documents/workspace/Haul/src/ > dist/Haul.app/Contents/Frameworks/SDL.framework/Versions/Current -> A > Thinning /Volumes/Storage/Users/davidh/Documents/workspace/Haul/src/ > dist/Haul.app/Contents/Frameworks/SDL_image.framework/Versions/A/ > SDL_image to ppc, i386 > /usr/bin/lipo: -extract ppc specified but fat file: /Volumes/ > Storage/Users/davidh/Documents/workspace/Haul/src/dist/Haul.app/ > Contents/Frameworks/SDL_image.framework/Versions/A/SDL_image does > not contain that architecture > Traceback (most recent call last): > File "setup.py", line 25, in ? > app=[ > File "/Library/Frameworks/Python.framework/Versions/2.4//lib/ > python2.4/distutils/core.py", line 149, in setup > dist.run_commands() > File "/Library/Frameworks/Python.framework/Versions/2.4//lib/ > python2.4/distutils/dist.py", line 946, in run_commands > self.run_command(cmd) > File "/Library/Frameworks/Python.framework/Versions/2.4//lib/ > python2.4/distutils/dist.py", line 966, in run_command > cmd_obj.run() > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/Py2App/py2app/build_app.py", line 389, in run > self._run() > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/Py2App/py2app/build_app.py", line 510, in _run > self.run_normal() > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/Py2App/py2app/build_app.py", line 570, in > run_normal > self.create_binaries(py_files, pkgdirs, extensions, loader_files) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/Py2App/py2app/build_app.py", line 672, in > create_binaries > platfiles = mm.run() > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/Py2App/macholib/MachOStandalone.py", line > 153, in run > thin_to_archs(filename, nodearchs) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/Py2App/macholib/util.py", line 146, in > thin_to_archs > raise ValueError, 'Error %d returned by: %s' % (retval, ''.join > (["'%s'" % arg for arg in command])) > ValueError: Error 1 returned by: '/usr/bin/lipo''/Volumes/Storage/ > Users/davidh/Documents/workspace/Haul/src/dist/Haul.app/Contents/ > Frameworks/SDL_image.framework/Versions/A/SDL_image''-output''/tmp/ > tmp1vFdMt''-extract''ppc''-extract''i386' The main problem seems to be that SDL_image doesn't contain the ppc architecture. If I run "file " I get the following: > /Volumes/Storage/Users/davidh/Documents/workspace/Haul/src/dist/ > Haul.app/Contents/Frameworks/SDL_image.framework/Versions/A/ > SDL_image: Mach-O universal binary with 2 architectures > /Volumes/Storage/Users/davidh/Documents/workspace/Haul/src/dist/ > Haul.app/Contents/Frameworks/SDL_image.framework/Versions/A/ > SDL_image (for architecture i386): Mach-O dynamically linked > shared library ppc > /Volumes/Storage/Users/davidh/Documents/workspace/Haul/src/dist/ > Haul.app/Contents/Frameworks/SDL_image.framework/Versions/A/ > SDL_image (for architecture cputype (0) cpusubtype (0)):Mach-O > universal binary with 2 architectures which seems very strange to me. If it has two architectures, I would have expected ppc and i386, not "cputype (0) cpusubtype (0)" as it says above. Did I somehow get my SDL installation messed up? I seem to have installed python 2.4.4, pyobjc 1.4, and pygame-1.8.0pre- py2.4. Perhaps that pre-py2.4 is my problem? I'm running on a Mac Pro with 10.4.8 and I'd like to be able to build a universal .app for this project. If it is necessary to reinstall python, pygame, pyobjc, and SDL, which versions should I use? Every time I look for the most recent matching versions, I seem to find python 2.5 but no associated pygame or pyobjc. I'm also unsure as to whether or not it is healthy to move on to python 2.5 if nothing else has been rebuilt yet. Please help! What should I have installed on my Mac Pro to develop on 10.4.8 and build universal binaries? I'm not using any python 2.5 specific features yet but I wouldn't mind moving in that direction eventually. Thanks, Dave ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] importing namespaces/modules
Hello all, I've got a query which is probably obvious for people more experienced than I but I can't find any exact reference to it elsewhere. It's not mac specific, but hey, I already belong to too many dev groups... :-) The discussion at http://docs.python.org/tut/node11.html is OK but it doesn't really answer my query. I note that increasingly programmers are deprecating >>> from module import * in favour of >>> import module which is fair enough, as explicit attributes make code more readable. Are the functions/classes/whatevers that are imported into the namespace with >>> import module but not otherwise referenced, explicitly loaded into the python "workspace" (excuse me, I'm an unrepentant APL programmer) including the __doc__ strings etc etc or not? And if so, do they remain in the .pyc image? And after py2app? In the case where module is quite large (think wx or twisted for eg) I'm wondering what are the relative advantages/disadvantages of, for example >>> import twisted >>> class MessageHandler(twisted.internet.protocol.DatagramProtocol): compared with >>> from twisted.internet.protocol import DatagramProtocol Class MessageHandler(DatagramProtocol): other than the obvious easy of reading "twisted.internet.protocol.DatagramProtocol" in a large environment with many imported modules, which is my situation. Any advise gratedfully acknowledged, David _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra. www.canberra.edu.au/vc-forum/scrg vip=Verbal Interactivity Project ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] importing namespaces/modules
Piet, Ronald, You have been most kind in taking the time to answer these queries. Thank you. David On 20/01/2007, at 12:08 AM, Ronald Oussoren wrote: > > On Friday, January 19, 2007, at 01:45PM, "Piet van Oostrum" > <[EMAIL PROTECTED]> wrote: >> >>> DW> And after py2app? >> >> I am not very familiar with py2app, but I think it packs up the >> necessary >> .pyc modules into the executable. But I am quite sure it will >> always pack >> the whole .pyc file. It would be unfeasible to extract only a part >> of a >> .pyc file as there will be all kinds of internal references in the >> module. >> Some of the dependencies might be so dynamic that a static >> analyses would >> be unable to detect them. > > py2app always includes entire pyc files and looks at import > statements to detect dependencies. > > Ronald > _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au/vc-forum/scrg vip=Verbal Interactivity Project ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Opening an app from another app under different OS X versions
My wxPython application has a context sensitive help system, using
wx.html.HtmlHelpController(), which also contains a Tutorial for the
program. Users like to leave the Help window open while they are
simultaneously working in the application. To allow this, I set the Help
application up as a free-standing application that I can call from my
regular application when it is needed. (This is necessary because of issues
with menu construction.) My applications are built using py2app, so the
call I've been using looks like this:
os.system('open -a TransanaHelp.app')
This works on OS X 10.3, and it works when I'm running under Python on OS X
10.4, but I have not been able to get anything along these lines to work
under OS X 10.4 once my app has been bundled up with py2app. It's like the
Help app tries to launch, but then it immediately, and silently, shuts down.
(i.e. the Console doesn't report anything.) os.spawnv() and
os.popen2() don't work either. Does anybody have any ideas for how I can
launch a bundled wxPython app from within another bundled wxPython app on OS
X 10.4?
Thanks for your help,
David K. Woods, Ph.D.
Transana Lead Developer
Wisconsin Center for Education Research
University of Wisconsin, Madison
http://www.transana.org
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Opening an app from another app under different OSX versions
> David Woods wrote:
> > My wxPython application has a context sensitive help system, using
> > wx.html.HtmlHelpController(), which also contains a Tutorial for the
> > program. Users like to leave the Help window open while they are
> > simultaneously working in the application. To allow this, I set the
> > Help application up as a free-standing application that I can call
> > from my regular application when it is needed. (This is necessary
> > because of issues with menu construction.) My applications are built
> > using py2app, so the call I've been using looks like this:
> >
> > os.system('open -a TransanaHelp.app')
> >
> > This works on OS X 10.3, and it works when I'm running under Python
> > on
> > OS X 10.4, but I have not been able to get anything along these lines
> > to work under OS X 10.4 once my app has been bundled up with py2app.
> > It's like the Help app tries to launch, but then it immediately, and
> > silently, shuts down. (i.e. the Console doesn't report anything.)
> > os.spawnv() and os.popen2() don't work either. Does anybody have any
> > ideas for how I can launch a bundled wxPython app from within another
> > bundled wxPython app on OS X 10.4?
> >
> > Thanks for your help,
> >
> > David K. Woods, Ph.D.
> > Transana Lead Developer
> > Wisconsin Center for Education Research
> > University of Wisconsin, Madison
> > http://www.transana.org
> >
> >
> Where is the help application bundled? Alongside the main app
> in the same directory, or inside the main app's application
> bundle itself? Perhaps it's a path issue, i.e. 'open' can't
> find the app to open. If so, you may need to do some work to
> get a full path to the help app, then launch it (i.e.,
> os.system('open -a /path/to/myapp.app') ).
>
> - --
> Kevin Walzer
> Code by Kevin
> http://www.codebykevin.com
Adding the path didn't help. Calling "open -a TransanaHelp.app" from the
command line finds the app, and adding the full path makes is start a bit
faster. But when the same call is made from within my bundled Python
program (regardless of whether the path is included), I see the following in
the console:
'import site' failed; use -v for traceback
Traceback (most recent call last):
File
"/Applications/Transana_2/TransanaHelp.app/Contents/MacOS/TransanaHelp",
line 3, in ?
import sys, os
ImportError: No module named os
So it seems, if I'm interpreting this right, like Python's not able to find
its own modules under this particular scenario. Line 3 of TransanaHelp.py,
by the way, is not the import statement shown here. That line 3 is of some
internal Python routine that's not part of my code.
Any other ideas? Thanks,
David
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Opening an app from another app under different OSX versions
> > Adding the path didn't help. Calling "open -a TransanaHelp.app" > > from the > > command line finds the app, and adding the full path makes > is start > > a bit > > faster. But when the same call is made from within my > bundled Python > > program (regardless of whether the path is included), I see the > > following in > > the console: > > > > 'import site' failed; use -v for traceback > > Traceback (most recent call last): > > File "/Applications/Transana_2/TransanaHelp.app/Contents/MacOS/ > > TransanaHelp", > > line 3, in ? > > import sys, os > > ImportError: No module named os > > > > So it seems, if I'm interpreting this right, like Python's not able > > to find > > its own modules under this particular scenario. Line 3 of > > TransanaHelp.py, > > by the way, is not the import statement shown here. That > line 3 is > > of some > > internal Python routine that's not part of my code. > > I had a problem like this when first moving from distutils-based > setup files to setuptools-based setup files. Getting the latest > version of py2app may help. > > --Dethe Upgrading to py2app 0.3.5 had absolutely no effect. David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Opening an app from another app under different OSX versions -- SOLVED
> On 1/24/07, David Woods <[EMAIL PROTECTED]> wrote: > > > > Adding the path didn't help. Calling "open -a > TransanaHelp.app" > > > > from the command line finds the app, and adding the full path > > > > makes > > > is start > > > > a bit > > > > faster. But when the same call is made from within my > > > bundled Python > > > > program (regardless of whether the path is included), I see the > > > > following in the console: > > > > > > > > 'import site' failed; use -v for traceback > > > > Traceback (most recent call last): > > > > File > "/Applications/Transana_2/TransanaHelp.app/Contents/MacOS/ > > > > TransanaHelp", > > > > line 3, in ? > > > > import sys, os > > > > ImportError: No module named os > > > > > > > > So it seems, if I'm interpreting this right, like Python's not > > > > able to find its own modules under this particular > scenario. Line > > > > 3 of TransanaHelp.py, > > > > by the way, is not the import statement shown here. That > > > line 3 is > > > > of some > > > > internal Python routine that's not part of my code. > > > > > > I had a problem like this when first moving from distutils-based > > > setup files to setuptools-based setup files. Getting the latest > > > version of py2app may help. > > > > > > --Dethe > > > > Upgrading to py2app 0.3.5 had absolutely no effect. > > > > It's *probably* because py2app sets a lot of environment > variables that can effect child Python interpreters... Try > clearing out any PY* environment variables sometime early in > your script. > > -bob Bob, That was indeed the source of the problem. I now delete the PYTHONHOME, PYTHONPATH, and PYTHONEXECUTABLE environment variables before the os.system() call and the Help application shows up as it should. Am I likely to see side-effects from deleting these environment variables? Should I restore them to their original values after the Help call has been made? Thanks a ton for your help. I *NEVER* would've figure this one out. David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Pythonmac 2.4.4 (PPC) and mod_python problems
Hi. I have pythonmac python 2.4.4 installed on my PPC on Mac OSX 10.3.9 and having trouble building mod_python for Apache 2.0.59. I have built apache just fine. Config for mod_python 3.3.1 looks good and output is below. Failing on make due to arch flags and getting a number of warnings on pointer type, use of long doubles. Hope someone can help. Many thanks. Regards, David configuration: [Mac-PG:~/Desktop/mod_python-3.3.1] davidpra% ./configure --with-apxs=/usr/local/apache2/bin/apxs 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 for ar... ar checking for a BSD-compatible install... /usr/bin/install -c checking whether make sets $(MAKE)... yes checking for main in -lm... yes checking for an ANSI C-conforming const... yes checking your blood pressure... a bit high, but we can proceed configure: checking whether apxs is available... checking for --with-apxs... /usr/local/apache2/bin/apxs executable, good checking Apache version... 2.0.59 checking for Apache libexec directory... /usr/local/apache2/modules checking for Apache include directory... -I/usr/local/apache2/include checking for --with-python... no checking for python... /Library/Frameworks/Python.framework/Versions/Current/bin/python checking Python version... 2.4 checking Python install prefix... /Library/Frameworks/Python.framework/Versions/2.4 checking checking where python libraries are installed... /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4 checking what libraries Python was linked with... -framework Python -ldl checking linker flags used to link Python... checking where Python include files are... -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 checking for --with-python-src... no checking for --with-mutex-dir... no Using MUTEX_DIR /tmp checking for --with-max-locks... no Using 8 MAX_LOCKS. checking for --with-flex... no checking for flex... /opt/local/bin/flex found /opt/local/bin/flex, we'll use this. Use --with-flex to specify another. checking flex version... 2.5.33. Good configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating Doc/Makefile config.status: creating src/include/mod_python.h config.status: creating test/Makefile config.status: creating test/testconf.py config.status: creating dist/setup.py config.status: creating dist/Makefile Here are my tracebacks: I am seeing things like: mod_python.c: In function `python_init': mod_python.c:826: warning: initialization from incompatible pointer type also a pile of warnings on long double usage. Here is the final part of the compile with the failures: from /Users/davidpratt/Desktop/mod_python-3.3.1/src/include/mod_python.h:80, from finfoobject.c:25: /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/objimpl.h:255: warning: use of `long double' type; its size may change in a future release /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/objimpl.h:255: warning: (Long double usage is reported only once for each file. /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/objimpl.h:255: warning: To disable this warning, use -Wno-long-double.) /usr/local/apache2/build/libtool --silent --mode=link gcc -o mod_python.la -rpath /usr/local/apache2/modules -module -avoid-version finfoobject.lo hlistobject.lo hlist.lo filterobject.lo connobject.lo serverobject.lo util.lo tableobject.lo requestobject.lo _apachemodule.lo mod_python.lo -Wl,-framework,Python -u _PyMac_Error /Versions// -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -lm -framework Python -ldl ld: for architecture i386 ld: warning /usr/lib/bundle1.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/finfoobject.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/hlistobject.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/hlist.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/filterobject.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/connobject.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/serverobject.o cputype (18, architecture ppc) does not m
[Pythonmac-SIG] library build example?
Hi Folks, Background: I'm porting a number of c/c++ programs as libraries for python import using SWIG + SCONS or MAKE I can build a lib*.so library OK (a compiled c program uses it) I can SWIG to produce the *wrap.c and *.py files. I'm having trouble with the next step : linking/loading the *wrap.c and lib*.so library into a single library that can be loaded as a python module using the SWIG produced *.py file. Some questions: Do I need to make the first *so or not or is it necessary/usual practice to SWIG and then build the whole final library in one hit. Does anyone have a simple example using either SCONS or MAKE, which has the correct ld options for OSX10.4.8? I would appreciate any advice from those w. more experience than I on this matter. Thanks, David intel OSX 10.4.8, various versions of python 2.3 ->> _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au/vc-forum/scrg vip=Verbal Interactivity Project ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] How do I change my delivery status?
Thanks! DG ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] py2app-ed program runs on 4 out of 7 Macs tried
Hi, all! I have a py2app-ed application which imports numpy, Numeric, matplotlib, pylab, wx, wxmpl, "personal" modules, and standard distribution fare such as os, sys, datetime, etc. (perhaps the least common of these which are used are traceback and from __future__ import division). It runs on 4 of 7 Macs on which I've tried it (on the three on which it fails, it'll start up, get as far as momentarily displaying the menu bar portion of the main frame, and then crash). At first I thought it might have something to do with single vs. dual processors 'cause it ran on three single processor Macs (or at least I thought they were all single processor Macs, I just got info that one I thought was a single processor is actually a dual processor), crashed on 2 dual processors, but then it ran on a "duo" (= dual processor, correct?) and crashed on a single. Two of the machines on which it crashes are are running OS10.3.9, but the other appears to be running 10.4.8. Two on which it crashes (not the same two as in the previous sentence) are G5's while the other is a G4 and it does run on the G5 I just found out is a dual. I have crash logs and some Sys Profiler results to study, but won't be able to examine directory trees easily or soon (though if I'm told to look for specific files, I can ask the owners of the "bad" machines to do that for me). Any ideas, leads, guesses, and/or advice? Thanks! DG ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] 'normal' python library installations on OSX
Hello all, I'm looking to install libraries in the OSX python framework structure using a simple shell script and I can't find a document which advises the 'normal' locations. given packAGE.py, (and various other .py files which it imports) _ packAGE.so and libpackAGE.dylib I've made a packAGE directory in /Library/Frameworks/Python.framework/Versions/Current/lib/python version/site-packages/packAGE within which I emplace packAGE.py, (and various other .py files which it imports) and _ packAGE.so I also place there an a __init__.py file in which I import packAGE.py but where is the 'proper' place to put libpackAGE.dylib? /usr/local/ lib ?? a short answer or reference to where I can find this info would be much appreciated. David _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au/vc-forum/scrg ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Universal build bug - Undefined symbols and pythonmac?
I have been getting the same undefined symbols when linking after compiling. On a few weeks back I posted on a problem building mod_python, now its pylucene - same problem. Crazy thing is I build the same pylucene version just before upgrading to 2.4.4 pythonmac without these problems. From mod_python build: ld: Undefined symbols: _fstatvfs referenced from Python expected to be defined in libSystem _lchown referenced from Python expected to be defined in libSystem _statvfs referenced from Python expected to be defined in libSystem apxs:Error: Command failed with rc=65536 . make[1]: *** [mod_python.so] Error 1 make: *** [do_dso] Error 2 From pylucene build: ld: Undefined symbols: _fstatvfs referenced from Python expected to be defined in libSystem _lchown referenced from Python expected to be defined in libSystem _statvfs referenced from Python expected to be defined in libSystem gmake: *** [release/_PyLucene.so] Error 1 I have googled to see what more I can find and there are others with this issue but maybe it is the fact that folks are doing infrequent software builds that is leaving this problem under the surface. Does any one have any suggestions. All seemed good when I was on the PPC pythonmac at 2.4.3 Regards, David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Universal build bug - Undefined symbols and pythonmac?
Hi Bob. My apologies. I am using 10.3.9. If you require any further details, please let me know. I use this mac for development and this is really not good. I have ordered a copy of 10.4.9 that I hope will be arriving within the week to try but I am on a PPC. I scanned the list quickly and noticed another post from someone a while back. from Stephan Werner 4/07/06 /usr/bin/ld: Undefined symbols: _fstatvfs referenced from Python expected to be defined in libSystem _lchown referenced from Python expected to be defined in libSystem _statvfs referenced from Python expected to be defined in libSystem This happens only for the PPC part of my UB application, it seems to link the i386 part just fine. I am using the 10.3.9 SDK for the PPC side, 10.4u for i386. Do I need to link against the 10.4u SDK on both sides? I'd not be too happy about doing that, since I want to make sure the app runs perfeclty on 10.3.9/PPC. Googling I see others with posts to different software lists for the software they are trying to build. Regards, David Bob Ippolito wrote: > On 4/8/07, David Pratt <[EMAIL PROTECTED]> wrote: >> I have been getting the same undefined symbols when linking after >> compiling. On a few weeks back I posted on a problem building >> mod_python, now its pylucene - same problem. Crazy thing is I build the >> same pylucene version just before upgrading to 2.4.4 pythonmac without >> these problems. >> >> From mod_python build: >> >> ld: Undefined symbols: >> _fstatvfs referenced from Python expected to be defined in libSystem >> _lchown referenced from Python expected to be defined in libSystem >> _statvfs referenced from Python expected to be defined in libSystem >> apxs:Error: Command failed with rc=65536 >> . >> make[1]: *** [mod_python.so] Error 1 >> make: *** [do_dso] Error 2 >> >> From pylucene build: >> >> ld: Undefined symbols: >> _fstatvfs referenced from Python expected to be defined in libSystem >> _lchown referenced from Python expected to be defined in libSystem >> _statvfs referenced from Python expected to be defined in libSystem >> gmake: *** [release/_PyLucene.so] Error 1 >> >> I have googled to see what more I can find and there are others with >> this issue but maybe it is the fact that folks are doing infrequent >> software builds that is leaving this problem under the surface. Does any >> one have any suggestions. >> >> All seemed good when I was on the PPC pythonmac at 2.4.3 > > The version of OS X you're using is probably relevant. > > -bob > ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Universal build bug - Undefined symbols and pythonmac?
Hi. Many thanks for your reply. I set environment var of MACOSX_DEPLOYMENT_TARGET to 10.3 but no change in situation unfortunately. I wonder if I should use mac ports version of python in the short term - it should build on the PPC alright but it does not seem up to date since I don't see a 2.4.4 available. I don't know what it is going to do to with Frameworks either and I don't really want a bunch of side effects on my system when I upgrade to 10.4 I am hoping this will resolve with the os upgrade and that I am not talking about a new mac right away because I am on PPC - I can't stop working for a week waiting for this either. I am all of sudden happy I did not put my money on the greatest G5 PPC hardware - it would have been a huge mistake. Any other alternatives? BTW, my original reason for ordering 10.4 had little to do with the ui improvements in 10.4 - in fact, it was the decision by mac not to release the 1.5 JDK on 10.3. I see releases for Windows98 - grumble, grumble :-( Regards, David Ronald Oussoren wrote: > > On 9 Apr, 2007, at 6:59, Bob Ippolito wrote: > >> I'm pretty sure that 10.4 would fix this. 10.3.9 isn't really equipped >> to build extensions for a universal Python (it can only build the PPC >> part). It runs them fine, but it can't build stuff properly because >> the Xcode is too old. > > You can't build universal binaries on 10.3.9, but I'd expect that you > can build ppc-only extensions on 10.3.9 as long as you don't explictly > link to Python.framework. Adding MACOSX_DEPLOYMENT_TARGET=10.3 to > environment before linking might help as well (the symbols that give > link errors are weakly linked which isn't supported on the default > deployment target). > > Ronald > >> >> -bob >> >> On 4/8/07, David Pratt <[EMAIL PROTECTED]> wrote: >>> Hi Bob. My apologies. I am using 10.3.9. If you require any further >>> details, please let me know. I use this mac for development and this is >>> really not good. I have ordered a copy of 10.4.9 that I hope will be >>> arriving within the week to try but I am on a PPC. >>> >>> I scanned the list quickly and noticed another post from someone a while >>> back. >>> >>> from Stephan Werner 4/07/06 >>> >>> /usr/bin/ld: Undefined symbols: >>> _fstatvfs referenced from Python expected to be defined in libSystem >>> _lchown referenced from Python expected to be defined in libSystem >>> _statvfs referenced from Python expected to be defined in libSystem >>> >>> This happens only for the PPC part of my UB application, it seems to >>> link the i386 part just fine. I am using the 10.3.9 SDK for the PPC >>> side, 10.4u for i386. Do I need to link against the 10.4u SDK on both >>> sides? I'd not be too happy about doing that, since I want to make >>> sure the app runs perfeclty on 10.3.9/PPC. >>> >>> Googling I see others with posts to different software lists for the >>> software they are trying to build. >>> >>> Regards, >>> David >>> >>> >>> Bob Ippolito wrote: >>>> On 4/8/07, David Pratt <[EMAIL PROTECTED]> wrote: >>>>> I have been getting the same undefined symbols when linking after >>>>> compiling. On a few weeks back I posted on a problem building >>>>> mod_python, now its pylucene - same problem. Crazy thing is I build >>>>> the >>>>> same pylucene version just before upgrading to 2.4.4 pythonmac without >>>>> these problems. >>>>> >>>>> From mod_python build: >>>>> >>>>> ld: Undefined symbols: >>>>> _fstatvfs referenced from Python expected to be defined in libSystem >>>>> _lchown referenced from Python expected to be defined in libSystem >>>>> _statvfs referenced from Python expected to be defined in libSystem >>>>> apxs:Error: Command failed with rc=65536 >>>>> . >>>>> make[1]: *** [mod_python.so] Error 1 >>>>> make: *** [do_dso] Error 2 >>>>> >>>>> From pylucene build: >>>>> >>>>> ld: Undefined symbols: >>>>> _fstatvfs referenced from Python expected to be defined in libSystem >>>>> _lchown referenced from Python expected to be defined in libSystem >>>>> _statvfs referenced from Python expected to be defined in libSystem >>>>> gmake: *** [release/_PyLucene.so] Error 1 >>>>> >>>>> I have googled to see what more I can find and there are others with >>>>> this issue but maybe it is the fact that folks are doing infrequent >>>>> software builds that is leaving this problem under the surface. >>>>> Does any >>>>> one have any suggestions. >>>>> >>>>> All seemed good when I was on the PPC pythonmac at 2.4.3 >>>> >>>> The version of OS X you're using is probably relevant. >>>> >>>> -bob >>>> >>> >> ___ >> Pythonmac-SIG maillist - [email protected] >> http://mail.python.org/mailman/listinfo/pythonmac-sig > ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] .so import bug python 2.3 vs 2.4 (++?)
Hello all, OSX 2.4.9: A (largish) Xcode project compiled to a .so with the /System/Library python framework. The .so is produced and imports into python (2.3.4) When the whole process is repeated, replacing python 2.3.4 with 2.4.3 I get an >> ImportError: Inappropriate file type for dynamic loading can anyone shed any light on this for me please? (or just tell me what's gotta change :-) David _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au/vc-forum/scrg ___ Pythonmac-SIG maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Numeric problem with Intel Mac OSX 10.4.8
numeric is now called numpy see http://numpy.scipy.org/ also, all lower case... David On 24/04/2007, at 12:21 AM, Jan H. Jensen wrote: > Hi, I have the following problem. Can anyone help? > > best regards, Jan Jensen > > Python 2.4.4 (#1, Oct 18 2006, 10:34:39) > [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> import Numeric > Traceback (most recent call last): >File "", line 1, in ? >File > "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ > site-packages/Numeric/Numeric.py", > line 91, in ? > import multiarray > ImportError: Inappropriate file type for dynamic loading >>>> > > -- > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > Jan H. Jensen Associate Research Professor > Department of Chemistry [EMAIL PROTECTED] > University of Copenhagen Phone: +45 35 32 02 39 > Universitetsparken 5 FAX: +45 35 32 02 14 > 2100 Copenhagen Denmark > http://propka.ki.ku.dk/~jhjensen > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > ___ > Pythonmac-SIG maillist - [email protected] > http://mail.python.org/mailman/listinfo/pythonmac-sig > _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au/vc-forum/scrg vip=Verbal Interactivity Project ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Numeric problem with Intel Mac OSX 10.4.8
Thanks Christopher that's wot I meant but I was rushin' out the door Also, you'll find some of the matplotlib examples, amongst many others, still try to import numeric or even numarray. I've yet to have a problem by replacing them with numpy. Of course I haven't done intensive testing Also, I noticed that the manual at http://numpy.scipy.org/numpy.pdf still contains references to numarray. There's hope for us all! As to > 1) Encourage the providers of said package to port to numpy -- it's > not > very hard, and the numpy developers will help. > > 2) let us know all your version and platform info, and where you got > your Numeric build, and we may be able to help. the download address you give (http://pythonmac.org/packages) has paqckages for Numeric and numarray as well as numpy for both python 2.4 and 2.5 so a novice could be forgiven for feeling misled. This is the reason I pointed to the scipy site. Life moves too quickly sometimes. David On 24/04/2007, at 2:24 AM, Christopher Barker wrote: > David Worrall wrote: >> numeric is now called numpy >> see >> http://numpy.scipy.org/ > > to clarify: > > "numpy" is a newer, next-generation version of the old and venerable > "Numeric". numpy is newer, better, an under active development. The > API > is very similar, but not exactly the same as Numeric, so if you > have an > old package that requires Numeric, you may still need to use it. If > this > is the case: > > 1) Encourage the providers of said package to port to numpy -- it's > not > very hard, and the numpy developers will help. > > 2) let us know all your version and platform info, and where you got > your Numeric build, and we may be able to help. > if you can use numpy, get it from: > > http://pythonmac.org/packages > > -Chris > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R(206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > [EMAIL PROTECTED] > ___ > Pythonmac-SIG maillist - [email protected] > http://mail.python.org/mailman/listinfo/pythonmac-sig > _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au/vc-forum/scrg vip=Verbal Interactivity Project ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Pythonmac 2.4.4 (PPC) and mod_python problems
Hi Frank and Ronald. I was original poster to the mod_python problems. I have recently upgraded my PPC to 10.4.9. My linking problem went away for PyLucene built using gcc 3.4.6 from mac ports earlier today. I built on non-standard compiler since there are known issues with 4.0.1 building pyLucene. I will be attempting to build mod_python again shortly and will report back of my experience. I might try a different compiler also to test if it does not work to see if it makes a difference. In my gut, I am beginning to feel despite my best effort to keep the software of my machine up to date, my PPC is becoming a paper weight. This has really got me frustrated since my machine has still got plenty of life and I believed universal meant that PPC hardware users were not going to be left out in the cold. It has been an excellent development machine up to the time Universal build was introduced. I am running into similar linking issues with lxml. See below. What can be done about this :-( Regards David Buildout build == zc.buildout.easy_install: Getting new distribution for lxml Building lxml version 1.3.beta warning: no previously-included files found matching 'doc/pyrex.txt' warning: no previously-included files found matching 'src/lxml/etree.pxi' /usr/bin/ld: for architecture i386 /usr/bin/ld: warning /opt/local/lib/libxslt.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) /usr/bin/ld: warning /opt/local/lib/libexslt.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) /usr/bin/ld: warning /opt/local/lib/libxml2.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) /usr/bin/ld: warning /opt/local/lib/libz.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) /usr/bin/ld: for architecture ppc /usr/bin/ld: warning can't open dynamic library: /Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib/libiconv.2.dylib referenced from: /opt/local/lib/libxslt.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2) /usr/bin/ld: for architecture i386 /usr/bin/ld: warning /opt/local/lib/libxslt.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) /usr/bin/ld: warning /opt/local/lib/libexslt.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) /usr/bin/ld: warning /opt/local/lib/libxml2.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) /usr/bin/ld: warning /opt/local/lib/libz.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) /usr/bin/ld: for architecture ppc /usr/bin/ld: warning can't open dynamic library: /Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib/libiconv.2.dylib referenced from: /opt/local/lib/libxslt.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2) zc.buildout.easy_install: Got lxml 1.3beta An easy_setup build === Searching for lxml Reading http://cheeseshop.python.org/pypi/lxml/ Reading http://cheeseshop.python.org/pypi/lxml/1.3beta Reading http://codespeak.net/lxml Reading http://cheeseshop.python.org/pypi/lxml/1.2.1 Best match: lxml 1.3beta Downloading http://cheeseshop.python.org/packages/source/l/lxml/lxml-1.3beta.tar.gz Processing lxml-1.3beta.tar.gz Running lxml-1.3beta/setup.py -q bdist_egg --dist-dir /tmp/easy_install-uCUEox/lxml-1.3beta/egg-dist-tmp-tOf7Pb Building lxml version 1.3.beta warning: no previously-included files found matching 'doc/pyrex.txt' warning: no previously-included files found matching 'src/lxml/etree.pxi' /usr/bin/ld: for architecture ppc /usr/bin/ld: warning can't open dynamic library: /Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib/libiconv.2.dylib referenced from: /opt/local/lib/libxslt.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2) /usr/bin/ld: for architecture i386 /usr/bin/ld: warning /opt/local/lib/libxslt.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) /usr/bin/ld: warning /opt/local/lib/libexslt.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) /usr/bin/ld: warning /opt/local/lib/libxml2.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) /usr/bin/ld: warning /opt/local/lib/libz.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) /usr/bin/ld: for architecture ppc /usr/bin/ld: warning can't open dynamic library: /Developer/SDKs/Ma
Re: [Pythonmac-SIG] Pythonmac 2.4.4 (PPC) and mod_python problems
Hi Ned. I've removed the mac ports version of libxml2 and libxslt and it compiled - woo hoo!! I'll try a new build of mod_python tomorrow. Maybe things are not so bad after all. This is quite encouraging. I guess I am getting down about these linking issues and of course want some better reliability back into some of the software builds that I seemed to have before. Many thanks for this tip :-) Regards David Ned Deily wrote: > In article <[EMAIL PROTECTED]>, > David Pratt <[EMAIL PROTECTED]> wrote: >> I will be attempting to build mod_python again shortly and will report >> back of my experience. I might try a different compiler also to test if >> it does not work to see if it makes a difference. In my gut, I am >> beginning to feel despite my best effort to keep the software of my >> machine up to date, my PPC is becoming a paper weight. This has really >> got me frustrated since my machine has still got plenty of life and I >> believed universal meant that PPC hardware users were not going to be >> left out in the cold. It has been an excellent development machine up to >> the time Universal build was introduced. I am running into similar >> linking issues with lxml. See below. What can be done about this :-( > > FWIW, lxml builds and runs just fine using easy_install on my PPC with > the latest universal build pythonmac 2.5.1 on 10.4.9. One obvious > difference apparent from your log file: on my system lxml is linking > with the Apple-supplied libxml2, libxslt, and libexslt in /usr/lib/, not > whatever you have in /opt/local/lib (presumably libs installed by port?). > ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] persistence speeds compared
Hi all, Does anyone know of a study which compares access-time on of the various python persistence technIques? I'm working w. a dynamic dataset of some 3500 tables - each table grows sequentially. Total data ~= 5GB Don't mind if it's a bit awkward - but for a time-critical applic. so needs to be as fast as possible. I haven't been able to find even a simple comparative analysis. Can anyone point me in the right direction? thanks heaps, David _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: creative.canberra.edu.au/scrg ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] seg fault in intelOSX+python2.4
Hi all, I've been using PyTables (www.pytables.org) with python2.4 on intel Mac OSX 10.4.10 and I'm running into a seg. fault when generating a large hdf5 file. Almost certainly something to do with relationship between OS and python. Has anyone had a similar (memory leak?) experience? _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au/vc-forum/scrg vip=Verbal Interactivity Project ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] seg fault in intelOSX+python2.4
Thanks for your feedback Ronald. The file is quite large: 4-5 GB pytables buffers the data and controlling the buffer size occasionally stops or slows the rot. The code has been tested under Linux without incident. [EMAIL PROTECTED], one of the developers of pytables wrote: > A Tuesday 21 August 2007, David Worrall escrigué: > >> I lowered NODE_MAX_SLOTS from 256 to128 and that slowed the leak - >> enough to get some sort of DB happening. >> It eventually seg faulted, however. >> I've noticed that sometimes the seg fault causes the (non-python) >> heap to become corrupted, requiring a HW reboot before pytables >> becomes useful again. >> Who knows what memory it may be writing over! >> > > I don't think there is a leak in PyTables itself; it is just that it > takes a lot of memory to work with many nodes simultaneously. Perhaps > reducing the NODE_MAX_SLOTS (to 64, for example) could help a bit > more. > Perhaps it would be a good idea to reduce the memory requirements of > PyTables nodes (for example, avoid the creation of buffers when they > are not needed), but this should take quite a few of thought. > > Indeed it seems that there is a problem with the MacOSX platform, but > the fact that this is not reproducible on Linux is unfortunate. ... > I'm thinking that perhaps you can try with newer versions of Python > (2.5.1) and HDF5 (the 1.8.0 beta3 is out, and I know that it wears a > completely revamped cache system, so maybe it is worth a try). > Anyway I'll try with gdb as you suggest and report back. I need to put it on my task stack so it'll take some time. thanks again, David On 30/08/2007, at 3:48 PM, Ronald Oussoren wrote: > > On 30 Aug, 2007, at 1:56, David Worrall wrote: > >> Hi all, >> >> I've been using PyTables (www.pytables.org) with python2.4 on intel >> Mac OSX 10.4.10 >> and I'm running into a seg. fault when generating a large hdf5 file. >> >> Almost certainly something to do with relationship between OS and >> python. >> Has anyone had a similar (memory leak?) experience? > > How large a file? It might be a memory management bug in pytables > as well. > > If you have the developer tools (Xcode & friends) installed you can > find out where the crash occurs using gdb. > > That is, 'gdb python', then on the prompt for gdb: 'r > myscript.py' (adding arguments if needed). When the crash occurs > you can use 'where 20' to see the topmost 20 frames on the C stack, > or just 'where' to see the entire stack. > > Ronald >> >> >> >> >> _ >> experimental polymedia: www.avatar.com.au >> Sonic Communications Research Group, >> University of Canberra: www.canberra.edu.au/vc-forum/scrg >> vip=Verbal Interactivity Project >> >> >> >> ___ >> Pythonmac-SIG maillist - [email protected] >> http://mail.python.org/mailman/listinfo/pythonmac-sig > _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au/vc-forum/scrg vip=Verbal Interactivity Project ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] entire applications in python?
Hi Brett, Yep, There's plenty of us! Many I know migrated from FORTH at one end and APL at the other ... the important continuity being an interpretive environ. which is more conducing to figuring out what one is actually trying to do. Having done that, we can crunch CPU cycles using C/Fortran etc libraries if needs be. Whilst not specifically a mac thing, the python community is well entrenched nearly everywhere and there are some fantastic tools which can be integrated. Its not a single piece of software, nor even finished project, but you might like to look at my sonipy.sourceforge.net for some toolset ideas. It is being developed in the first instance on OSX. good luck! David On 04/10/2007, at 12:50 PM, Brett Calcott wrote: > Thanks to everyone for their replies; very useful stuff. > > I must say that getting a large number of replies so quickly is also > incredibly encouraging. It is good to know that there are people out > there who love python and work on the mac! > > Thanks again, > Brett > ___ > Pythonmac-SIG maillist - [email protected] > http://mail.python.org/mailman/listinfo/pythonmac-sig > _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: creative.canberra.edu.au/scrg ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] easygui
Hi Rafael, Not a comprhensive list by any means, but here are a couple of my links: http://www.psychopy.org/ you may find this useful: http://psy.ck.sissa.it/OtherStuff/OtherStuff.html also pythoncard has lots of examples which might get you into a ballpark: http://pythoncard.sourceforge.net/ the wxpython community may have some other references. You'll notice that the visonary egg producers have chickened out of audio. :-) I've yet to find a satisfactory Mac/psych testing package that deals with audio well. (such that you can play audio and have people answer questions about it. Does anyone have any suggestions in this regard? On 05/10/2007, at 4:51 AM, Rafael Bejarano wrote: > Thanks. I'll definitely give it a try. > > Rafael > On Oct 4, 2007, at 12:46 PM, adam naples wrote: > >> I would suggest >> visionegg >> www.visionegg.org >> perfect for experimental psychology experiments, at least mine, and >> installs nicely on the mac with some gui demos. >> All python, and cross platform. >> there is also psychopy, which looks similar to visionegg, but I've >> not had the need to try it. >> hope this helps >> -a ... _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: creative.canberra.edu.au/scrg ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] easygui
Hi Robin, I know them both very well. Good at what they do. Supercollider is even better (IMO) However they both only have python for scripting. If it's python you want, approach with caution .... David On 06/10/2007, at 11:42 PM, robin meier wrote: > hello, > > for simple gui's using different media (audio, video, openGL etc ) > you might consider pure data (open source) http://en.wikipedia.org/ > wiki/Pure_Data or max msp jitter (expensive... cycling74.com) > > both environments have objects which enable you to integrate your > python code. > > maybe this helps... > best, > robin > > On 5 Oct 2007, at 20:45, adam naples wrote: > >> I've had some occasions to fight with getting audio working like I >> want in visionegg and had no problems beyond the normal 'nothing- >> working-like-you-expect-the-first-time'. >> >> I've been using it for presenting stimuli for eye-tracking and >> sentence comprehension, and I just make sure all my stimuli are >> aiff or wav. Really it's been much less bug prone than my >> experiences with director, e-prime and psyscope. If you need to >> present video it's a little more of a hassle, but not so much. >> >> What problems were you having with visionegg and audio? I'm happy >> to help if i can. >> -a >> I don't know visionegg so I went to their website entered a couple of audio words into their search engine and they all drew a blank. So it's nice to hear that it has an approach to audio. I'll check it out. _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: creative.canberra.edu.au/scrg ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] working around versions
Hi All, We're doing some work around different versions of Python on OSX (and what's in their respective site-packages directory), and I was wondering: Given that we can pick up the the version number of the current instantiation using sys.version, is there a direct way of computing the locating values for x and y in '/Library/Frameworks/Python.framework/Versions/Current/lib/pythonx.y/' other than through concatenating the above string with a splice of sys.version? thanks, David _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: creative.canberra.edu.au/scrg/ ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] working around versions
Thanks for your reply Ronald. I do run multiple versions, but I change the symlink of Current. Do you mean because people change versions in other ways, say through a shell alias rather than change the symlink? I can see that the sys.prefix approach is safer. thanks, David On 06/11/2007, at 1:37 AM, Ronald Oussoren wrote: > > On 5 Nov, 2007, at 3:51, David Worrall wrote: > >> Hi All, >> >> We're doing some work around different versions of Python on OSX (and >> what's in their respective site-packages directory), >> and I was wondering: >> >> Given that we can pick up the the version number of the current >> instantiation using sys.version, >> is there a direct way of computing the locating values for x and y in >> '/Library/Frameworks/Python.framework/Versions/Current/lib/ >> pythonx.y/' >> >> other than through concatenating the above string with a splice of >> sys.version? > > No. > > BTW. The library location is os.path.join(sys.prefix, 'lib', 'python > %d.%d'%(sys.version_info[:2])). This should resolve to a path that > doesn't refer to 'Versions/Current' but to 'Versions/x.y'. Do not > assume that the 'Current' link will point to currently running > version of Python, a user might have installed multiple versions of > python. > > Ronald >> >> >> thanks, >> >> David >> _ >> experimental polymedia: www.avatar.com.au >> Sonic Communications Research Group, >> University of Canberra: creative.canberra.edu.au/scrg/ >> >> >> ___ >> Pythonmac-SIG maillist - [email protected] >> http://mail.python.org/mailman/listinfo/pythonmac-sig > _ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: creative.canberra.edu.au/scrg/ ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] appscript create new iphoto album
Hi,
try to create an new iPhoto album, But cant get it working. Is this a bug?
>>> app('iPhoto').make(new=k.regular_album, with_properties={ k.name : 'New
Album' })
Traceback (most recent call last):
File "", line 1, in
File
"/Library/Python/2.5/site-packages/appscript-0.17.2-py2.5-macosx-10.5-i386.egg/appscript/reference.py",
line 387, in __call__
raise CommandError(self, (args, kargs), e)
appscript.reference.CommandError: CommandError -2710: errOSACantCreate
Failed command:
app(u'/Applications/iPhoto.app').make(new=k.regular_album,
with_properties={k.name: 'New Album'})
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] hi
Please I would love to receive a daily newsletter with simple python codes for beginners; and to progress as time goes. ALWAYS THERE FOR YOU - For ideas on reducing your carbon footprint visit Yahoo! For Good this month.___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] appscript create new iphoto album
> You have to use its weird, non-standard 'new album' command (which
> returns a broken reference, btw, so don't use that):
>
> app('iPhoto').new_album(name='New Album')
Thx for that tip. But now iam stuck with the task to add a photo to a
referenced album. I tried all kinds of app.add or app.make variations.
But i end up, getting no reference back and no photo added or raising an Error
1700 / 1701.
appscript.reference.CommandError: CommandError -1700: Can't make some data
into the expected type.
Failed command: app(u'/Applications/iPhoto.app').make(new=k.photo,
with_properties={k.class_: k.photo, k.image_path:
mactypes.Alias(u'/Users/david/Desktop/20071127_Misc/IMG_0299.JPG')})
or:
appscript.reference.CommandError: CommandError -1700: Can't make some data
into the expected type.
Failed command: app(u'/Applications/iPhoto.app').make(new=k.photo,
with_properties={k.class_: k.photo, k.image_path:
u'/Users/david/Desktop/20071127_Misc/IMG_0299.JPG'})
or:
ref = iphoto.add(file, to=album)
if ref is None:
raise
Is there a special hack to get a photo added ?
Regards David
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Py2app and shared libraries under Leopard
I've recently been involved with Robin Becker of Reportlabs building and testing one of their extension libraries across Intel and PPC hardware. Built using Distutils under Leopard, the library is working exactly as intended/expected. However, comparing the .so file produced, it is under half the size of the same built using Tiger - as well as having the execute permissions set, so Finder reports it as a Unix executable instead of a document. Both versions are reported as Mach-O universal binaries. $ cd /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/ $ ls -l _render* -rwxr-xr-x 1 forestfield admin 244620 10 Dec 12:40 _renderPM-Leopard.so -rw-r--r-- 1 forestfield admin 570732 10 Dec 16:38 _renderPM.so $ file _render* _renderPM-Leopard.so: Mach-O universal binary with 2 architectures _renderPM-Leopard.so (for architecture i386):Mach-O bundle i386 _renderPM-Leopard.so (for architecture ppc):Mach-O bundle ppc _renderPM.so: Mach-O universal binary with 2 architectures _renderPM.so (for architecture i386):Mach-O bundle i386 _renderPM.so (for architecture ppc):Mach-O bundle ppc The shared libraries in PIL also show the same effects when built under Leopard and Tiger respectively. When I apply py2app to an application that uses these libraries, when the Leopard-built versions are used, I get ValueError: Unknown load command: 27 as detailed in the attached log file. If I replace the libraries with their Tiger-built counterparts, the application builds OK (under Leopard). I installed Xcode on Leopard using default settings. Any ideas please? Regards, David Hughes Forestfield Software $ cd /users/pydevsrc/dp6mac_v630 $ ./build_all running py2app creating /Users/pydevsrc/dp6mac_v630/build creating /Users/pydevsrc/dp6mac_v630/build/bdist.macosx-10.3-fat creating /Users/pydevsrc/dp6mac_v630/build/bdist.macosx-10.3-fat/python2.5-standalone creating /Users/pydevsrc/dp6mac_v630/build/bdist.macosx-10.3-fat/python2.5-standalone/app creating /Users/pydevsrc/dp6mac_v630/build/bdist.macosx-10.3-fat/python2.5-standalone/app/collect creating /Users/pydevsrc/dp6mac_v630/build/bdist.macosx-10.3-fat/python2.5-standalone/app/temp creating /Users/pydevsrc/dp6mac_v630/dist creating build/bdist.macosx-10.3-fat/python2.5-standalone/app/lib-dynload creating build/bdist.macosx-10.3-fat/python2.5-standalone/app/Frameworks /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/reportlab/lib/PyFontify.py:35: Warning: 'with' will become a reserved keyword in Python 2.6 /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/reportlab/lib/PyFontify.py:36: Warning: 'with' will become a reserved keyword in Python 2.6 *** using recipe: PIL *** *** filtering dependencies *** 754 total 40 filtered 6 orphaned 714 remaining *** create binaries *** creating python loader for extension 'MacOS' creating python loader for extension 'Nav' creating python loader for extension '_AE' creating python loader for extension '_Ctl' creating python loader for extension '_Dlg' creating python loader for extension '_Evt' creating python loader for extension '_File' creating python loader for extension '_Folder' creating python loader for extension '_Menu' creating python loader for extension '_Qd' creating python loader for extension '_Res' creating python loader for extension '_Win' creating python loader for extension '_bisect' creating python loader for extension '_codecs_cn' creating python loader for extension '_codecs_hk' creating python loader for extension '_codecs_iso2022' creating python loader for extension '_codecs_jp' creating python loader for extension '_codecs_kr' creating python loader for extension '_codecs_tw' creating python loader for extension '_ctypes' creating python loader for extension '_hashlib' creating python loader for extension '_heapq' creating python loader for extension '_locale' creating python loader for extension '_multibytecodec' creating python loader for extension '_random' creating python loader for extension '_sha256' creating python loader for extension '_sha512' creating python loader for extension '_socket' creating python loader for extension '_sqlite3' creating python loader for extension '_ssl' creating python loader for extension '_struct' creating python loader for extension '_weakref' creating python loader for extension 'array' creating python loader for extension 'binascii' creating python loader for extension 'bz2' creating python loader for extension 'cPickle' creating python
Re: [Pythonmac-SIG] Py2app and shared libraries under Leopard
David Hughes wrote: .Built using Distutils under Leopard, the library [/Reportlab's _Render.pm]/ is working exactly as intended/expected. However, comparing the .so file produced, it is under half the size of the same built using Tiger [/and it generates an error when it is include in a Py2app build/] ... I posted this here about a week ago but there were no responses. Am I doing something so incredibly stupid that people are too polite to point it out?? -- David Hughes ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] codes
please send me relevant codes for beginners ALWAYS THERE FOR YOU - Sent from Yahoo! - a smarter inbox.___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] iTunes query
I'm trying to figure out how AOEM queries work on iTunes, the code I'm
trying looks like:
for track in
library.tracks[appscript.its.name().encode("utf-8").find("Sun")]:
(I'm trying to find all the tracks in my library with the string "Sun"
in the title)
and the error I'm getting is:
Traceback (most recent call last):
File "./find_deleted_files2.py", line 78, in
main()
File "./find_deleted_files2.py", line 75, in main
process_library(library)
File "./find_deleted_files2.py", line 68, in process_library
for track in
library.tracks[appscript.its.name().encode("utf-8").find("Sun")]:
File
"/Library/Python/2.5/site-packages/appscript-0.18.1-py2.5-macosx-10.5-i386.egg/appscript/reference.py",
line 524, in __getitem__
AttributeError: 'int' object has no attribute 'AS_aemreference'
what am I doing wrong?
thanks,
--dave
--
The Whole World + This Email = The Whole World
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Help! I can't get py2app v0.4.2 to correctly embed Authorization
I'm trying to build a fairly simple app (on osx 10.5.4) that leverages the Authorization module (v0.1). The py2app build succeeds, but when I run the app, I get an exception that says: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/Authorization/_Authorization.so' not found A bit of investigation makes this look like a macholib problem - i.e. it's not correcting the path reference to use the '@execution_path/../Frameworks/etc/etc..' stunt which would allow the app to use a relative copy. I can't figure out how to get this to work correctly. I'm on the svn tip of py2app as well as all of the associated dependencies (macholib, modulegraph, altgraph, etc..). Note that in my resulting app bundle, there is *nothing* in Contents/Frameworks, but there is a '_Authorization.so' in Contents/Resources/lib/python2.5/lib-dynload/Authorization/. Am I failing to pass some critical option to my setup.py? I'm not particularly OSX saavy, so any help is appreciated. regards, -David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] py2app PyOpenGL "Unable to find an implementation" Error
I'm trying to package up a program I wrote that uses
PyOpenGL-3.0.0b4-py2.5.egg, numpy-1.1.1-py2.5-macosx-10.3-ppc.egg
installed with easy_install and PIL. I know there's been a bit of
trouble getting PyOpenGL scripts to play nicely in py2app, but I have
not been able to find any help about anyone that has run into the
error "RuntimeError: Unable to find an implementation for the 'darwin'
('posix') platform". Generating the app file runs without complaint
but this error occurs when trying to run the program.
Does anyone have any suggestions as to the cause or what to do?
The console log is as follows:
-
8/27/08 11:29:25 AM PyTensor[4893] PyTensor Error
8/27/08 11:29:25 AM PyTensor[4893] PyTensor Error
An unexpected error has occurred during execution of the main script
RuntimeError: Unable to find an implementation for the 'darwin'
('posix') platform
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] Traceback (most
recent call last):
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] File
"/Users/selassid/Projects/PyTensor/dist/PyTensor.app/Contents/Resources/__boot__.py",
line 158, in
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893]
_run('PyTensor.py')
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] File
"/Users/selassid/Projects/PyTensor/dist/PyTensor.app/Contents/Resources/__boot__.py",
line 134, in _run
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893]
execfile(path, globals(), globals())
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] File
"/Users/selassid/Projects/PyTensor/dist/PyTensor.app/Contents/Resources/PyTensor.py",
line 10, in
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] from
OpenGL.GL import *
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PyOpenGL-3.0.0b4-py2.5.egg/OpenGL/GL/__init__.py",
line 2, in
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] from
OpenGL.raw.GL import *
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PyOpenGL-3.0.0b4-py2.5.egg/OpenGL/raw/GL/__init__.py",
line 6, in
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] from
OpenGL.raw.GL.constants import *
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PyOpenGL-3.0.0b4-py2.5.egg/OpenGL/raw/GL/constants.py",
line 7, in
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] from OpenGL
import platform, arrays
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PyOpenGL-3.0.0b4-py2.5.egg/OpenGL/platform/__init__.py",
line 57, in
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] _load()
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PyOpenGL-3.0.0b4-py2.5.egg/OpenGL/platform/__init__.py",
line 53, in _load
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893]
sys.platform, os.name,
8/27/08 11:29:25 AM
[0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893] RuntimeError:
Unable to find an implementation for the 'darwin' ('posix') platform
8/27/08 11:29:27 AM com.apple.launchd[149]
([0x0-0x6e06e].org.pythonmac.unspecified.PyTensor[4893]) Exited with
exit code: 255
-
Thanks for your help.
- David Selassie
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] using py-appscript
I can use (Python) appscript reasonably well, if I know exactly what
"components" I am looking for, e.g.,
app('TextEdit').documents['Read Me'].paragraphs[1].get()
But if I'm faced with a new application I don't know where to start.
Is there any way to interactively explore what is available? Something
like
dir(app('TextEdit')) -> [..., "documents", ...]
to let me know that the app has document components
app('TextEdit').documents.keys() -> [..., "Read Me", ...]
to let me know that "Read Me" is one of the documents
and so on.
- David
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Please help! py2app broken
On Thu, Sep 11, 2008 at 11:25 AM, James Kelly <[EMAIL PROTECTED]> wrote: > Alternatively you can also use svn 1.4.4. That's not always a palatable option -- subversion tends to fall into the category of 'system package' and it can be cumbersome to swim against the tide of a package update, as you may break some system dependencies for the sake of avoiding others. svn 1.5.1 went 'stable' on some distros recently, so this isn't a problem that's going to go away. And just going back to 1.4.4 for your mac doesn't necessarily dodge the problem, as you may be running setuptools on a mounted drive that has 1.5.1 .svn crumbs in it (or vice versa). It's generally a good idea to keep svn versions in sync across your various development environments anyway (or always do svn actions on one env, even if you mount the directory on several). This is all probably moot soon, as I don't expect the setuptools guys to allow the problem to persist at large. But yeah, in a pinch and disregarding the other stuff, he could roll back to 1.4.4. -David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Py2app/modulegraph crashes on pkg_resources
Under setuptools 0.6c9, py2app 0.3.6, OS X 10.4.11, when running the
py2app command, modulegraph raises an ImportError trying to find
pkg_resources. I'm not sure if this is a setuptools issue, a py2app
issue, or a modulegraph issue.
Here's the output:
$ ./bin/python-local setup.py py2app
running py2app
running build_py
running egg_info
writing requirements to src/bash.egg-info/requires.txt
writing src/bash.egg-info/PKG-INFO
writing top-level names to src/bash.egg-info/top_level.txt
writing dependency_links to src/bash.egg-info/dependency_links.txt
writing entry points to src/bash.egg-info/entry_points.txt
writing manifest file 'src/bash.egg-info/SOURCES.txt'
running build_scripts
Traceback (most recent call last):
File
"/Users/deyk/code/py/spaaace/trunk/eggs/py2app-0.3.6-py2.5.egg/py2app/build_app.py",
line 548, in _run
self.run_normal()
File
"/Users/deyk/code/py/spaaace/trunk/eggs/py2app-0.3.6-py2.5.egg/py2app/build_app.py",
line 600, in run_normal
mf = self.get_modulefinder()
File
"/Users/deyk/code/py/spaaace/trunk/eggs/py2app-0.3.6-py2.5.egg/py2app/build_app.py",
line 508, in get_modulefinder
debug=debug,
File "build/bdist.macosx-10.3-fat/egg/modulegraph/find_modules.py",
line 243, in find_modules
find_needed_modules(mf, scripts, includes, packages)
File "build/bdist.macosx-10.3-fat/egg/modulegraph/find_modules.py",
line 171, in find_needed_modules
mf.import_hook(mod)
File "build/bdist.macosx-10.3-fat/egg/modulegraph/modulegraph.py",
line 245, in import_hook
q, tail = self.find_head_package(parent, name)
File "build/bdist.macosx-10.3-fat/egg/modulegraph/modulegraph.py",
line 296, in find_head_package
raise ImportError, "No module named " + qname
ImportError: No module named pkg_resources
> /Users/deyk/code/py/spaaace/trunk/build/bdist.macosx-10.3-fat/egg/modulegraph/modulegraph.py(296)find_head_package()
(Pdb) import setuptools
(Pdb) setuptools.__version__
'0.6c9'
(Pdb) import pkg_resources
(Pdb)
As you can see, pkg_resources is importable, at least from within the
debugger, but I don't understand how exactly modulegraph works its
magic. Any ideas? (I've attached my setup.py, in case it might shed
light.)
Thanks for your time.
David Eyk
# -*- coding: utf-8 -*-
"""setup -- setuptools setup file for Spaaace.
$Author: eykd $
$Rev: 1191 $
$Date: 2008-06-12 10:49:50 -0500 (Thu, 12 Jun 2008) $
"""
__author__ = "$Author: eykd $"
__revision__ = "$Rev: 1191 $"
__version__ = "0.2"
__release__ = '.r'.join((__version__, __revision__[6:-2]))
__date__ = "$Date: 2008-06-12 10:49:50 -0500 (Thu, 12 Jun 2008) $"
import sys
try:
import setuptools
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
APP = ['src/Spaaace.py',]
DATA_FILES = []
APP_OPTIONS = {'argv_emulation': False,
'optimize': '2',
#'excludes': ['pkg_resources',],
'includes': ['pkg_resources',],
}
INSTALL_REQUIRES=['CherryPy<=3.0.3',
'pyglet',
'Cellulose',
'Mako',
'numpy',
]
GUI_SCRIPTS = ['spaaace = kernel:main',]
SCRIPTS = []
if sys.platform == 'darwin':
extra_options = dict(
setup_requires=['py2app',],
app=APP,
options={'py2app':APP_OPTIONS},
)
elif sys.platform == 'win32':
extra_options = dict(
setup_requires=['py2exe'],
app=APP,
)
else:
extra_options = dict(
)
setup(
name = "bash",
version = __version__,
author = "David Eyk",
package_dir = {'': 'src',},
packages = find_packages('src'),
include_package_data = True,
exclude_package_data = {'src':['*.c', '*.h', '*.pyx', '*.pxd']},
data_files=['src/data',],
entry_points={'gui_scripts': GUI_SCRIPTS,
'scripts': SCRIPTS},
scripts=APP,
install_requires=INSTALL_REQUIRES,
zip_safe = False,
test_suite = "nose.collector",
**extra_options
)
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Py2app/modulegraph crashes on pkg_resources
My apologies to Chris Barker--I accidentally took this discussion off the list, too. A common newbie mistake, it appears? His advice fixed my initial issue, but py2app is still failing mysteriously on me, now for different reasons. I've reconstructed the pertinent bits of my further problem below: On Thu, Oct 16, 2008 at 3:11 PM, Christopher Barker <[EMAIL PROTECTED]> wrote: >> David Eyk wrote: >> >> That got me halfway there! Let me briefly plug zc.buildout here: I've >> been using it on all my projects since PyCon, and it made these tweaks >> quite easy to implement, with a few changes to my buildout.cfg and >> setup.py. >> On to further problems, now: py2app builds about half of my app >> package, but fails with the following message: >> >>/Users/deyk/code/py/spaaace/trunk/dist/bash.app/Contents/MacOS/bash >>malformed object (unknown load command 8) >>stripping saved 18312668 bytes (12069072 / 30381740) > That may be a warning, rather than an error -- did you try running the app? I did. Here's the console output: >>>> kernel : INFO Starting up. kernel : ERRORAUGGH Run in circles! Scream and shout! Traceback (most recent call last): File "kernel.pyo", line 106, in main File "kernel.pyo", line 38, in initView File "bash/view.pyo", line 43, in ImportError: cannot import name space root: ERROR File "kernel.pyo", line 106, in main File "kernel.pyo", line 38, in initView File "bash/view.pyo", line 43, in root: ERRORImportError: cannot import name space root: ERROREntering debugger post-mortem: /Users/deyk/code/py/spaaace/trunk/dist/bash.app/Contents/Resources/bash/view.pyo(43)() (Pdb) kernel : INFO Main: Finished. <<<<< Interestingly: $ ls /Users/deyk/code/py/spaaace/trunk/dist/bash.app/Contents/Resources/ PythonApplet.icns __boot__.py data/ lib/ site.pyc Spaaace.py __error__.shinclude/ site.py* No kernel.pyo, and no bash package actually exist inside the app bundle. I see them in "build/bdist.macosx-10.3-fat/python2.5-standalone/app/collect/", but nowhere else. The run-time error is the same when I move the app somewhere else and run it. It seems to still be importing them out of the build tree, and pretending they're in the bundle tree. Weird! The module that it's trying to import, space.py, isn't in the build tree. This may be the source of my trouble, as the build-time error was complaining about the bash package which contains space.py, so I'll look into it. Still, everything runs and imports trouble-free in the development environment. Weird! I tried attaching py2app's console output, but it was too big for the mailing list. If you're interested in perusing it, you'll find it at http://eykd.net/pub/py2app-output.txt > I also thought that was fixed (a similar issue was) in the latest macholib > -- did you update that too? I believe so. I have 1.2 installed. > This may be a problem that comes a goes, too -- make sure you delete "build" > and "dist" and try again. Nope. Consistently fails. Thanks for your help in puzzling this out. David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Py2app/modulegraph crashes on pkg_resources
On Fri, Oct 17, 2008 at 3:03 PM, Christopher Barker <[EMAIL PROTECTED]> wrote: > well, I really hate lists configured this way, but it's been debated > ad-infinitum, and we'll just have to agree to disagree. I've just never run into one before. I just about made the same mistake replying to this. :) > sorry, but I'm out of ideas now -- do do some googling for the: > malformed object (unknown load command 8) That's the first thing I did. :( Nothing I can make sense of--that is, nothing py2app related. > Also, have you got py2app to work with a really simple, tiny app? That > should at least tell you what a working app bundle should look like. That's a good idea. As I may have mentioned, I've used py2app successfully before, with a wxPython app. But that probably doesn't qualify as simple or tiny. :) I'll take a stab at a simple app over the weekend. Thanks. David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] py2app fails on /usr/bin/strip
The py2app command is failing for me with a very strange error: /usr/bin/strip: for architecture i386 object: /Users/deyk/code/py/spaaace/trunk/dist/bash.app/Contents/MacOS/bash malformed object (unknown load command 8) stripping saved 18312668 bytes (12069072 / 30381740) This leaves half-baked app bundle in the dist folder. I've googled the error, but I haven't been able to turn up anything understandable or python-related. I've replicated this behavior with a dummy package, which I'm attaching. I have the following environment: OS X: 10.4.11 Python: 2.5.1 setuptools: 0.6c9 py2app: 0.4.2 Can anyone else replicate this error with the attached package? Anyone have an idea what's going on, or how I might fix it? Thanks, David Eyk dummy-0.2.dev.tar.gz Description: GNU Zip compressed data ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] App distribution with eggs
I'm updating my development tools for an application I've been distributing for a few years now. One of my critical imports, MySQLdb, gets built as an egg under by new system. In the past, I've used BundleBuilder for making my distributable app for the Mac and it's worked admirably. I can't figure out how to get BundleBuilder to include the MySQLdb egg, (I get "ImportError: no module named MySQLdb") and it looks to me like py2app doesn't support eggs either. My (perhaps inept) Googling hasn't revealed any likely suspects. What method do folks recommend for building distributable apps which have dependencies on eggs? David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] pyobjc 2.0 with the python.org distribution?
Sorry if this gets double-posted. I sent from the wrong address initially and now it seems it will never return from moderator-limbo. On Dec 17, 2008, at 3:03 AM, Reza Lotun wrote: Hi, As an addendum to that, what is the current status of trying to build Pyobjc 2.0 for Python 2.6? I tried a few weeks ago but it didn't seem to work - is it at all possible? Yes, it is possible. I haven't tried building it against the python.org binary dist of 2.6, but I have a script that will build 2.6 from source and then build pyobjc from trunk. See below for the important bits. Thanks, Reza On Wed, Dec 17, 2008 at 9:52 AM, David Warde-Farley > wrote: Hi folks, I noticed today that while PyObjC, etc. is included in the system Python in 10.5, the py2.5-fat binaries on undefined.org are 1.4.x series. As I understood it, the python.org UB is the only solution if you want to build redistributable applications. Not necessarily. py2app should have no trouble using a custom built python. I also have been using it as a jumping off point so that I have a completely common dev environment on 10.5 and 10.4 for other stuff I do. The solution below will only work on 10.5, but it should be possible to build against the 10.4 universal sdk with the appropriate modifications. Well, I'm trying to build PyObjC 2.0 from trunk with the python.org package and running into all sorts of errors. For example, pyobjc-core fails to build with this: Modules/objc/bundle-variables.m: In function 'PyObjC_loadBundleFunctions': Modules/objc/bundle-variables.m:221: error: '_localHandler' undeclared (first use in this function) Modules/objc/bundle-variables.m:221: error: (Each undeclared identifier is reported only once Modules/objc/bundle-variables.m:221: error: for each function it appears in.) Modules/objc/bundle-variables.m: In function 'PyObjC_loadBundleFunctions': Modules/objc/bundle-variables.m:221: error: '_localHandler' undeclared (first use in this function) Modules/objc/bundle-variables.m:221: error: (Each undeclared identifier is reported only once Modules/objc/bundle-variables.m:221: error: for each function it appears in.) lipo: can't figure out the architecture type of: /var/folders/Hv/ HvVKXkVwF3Kt9ULgIvCLPTI/-Tmp-//ccrLeLvv.out error: command 'gcc' failed with exit status 1 I found one post on the mailing list from July that went unanswered detailing pretty much the same situation. Any hints? I ran into this problem also when first trying to build pyobjc from trunk. I don't know if it's possible to build against the python.org binaries, but if you build python from source with the options below it should work: export installprefix=/opt/python# set this to wherever you want to put it export DYLD_LIBRARY_PATH=$installprefix/lib:$DYLD_LIBRARY_PATH export DYLD_FRAMEWORK_PATH=$installprefix/Library/Frameworks: $DYLD_LIBRARY_PATH:$DYLD_FRAMEWORK_PATH export MACOSX_DEPLOYMENT_TARGET=10.5 export sdk=/Developer/SDKs/MacOSX10.5.sdk export CPPFLAGS="-I$installprefix/include -L$installprefix/lib" export CFLAGS="-O -g -isysroot $sdk -arch i386 -arch ppc -mmacosx- version-min=10.5" export LDFLAGS="-Wl,-syslibroot,$sdk -flat_namespace" ./configure \ --enable-universalsdk=$sdk \ --enable-framework=$installprefix/Library/Frameworks make make install Then, to build pyobjc, you should be able to use 02-develop-all.sh from trunk, provided you modify it to use the python you just built above (change the paths on lines 18, 19, 24, 35, and 36). Good luck, -David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] pyobjc 2.0 with the python.org distribution?
On Dec 17, 2008, at 3:03 AM, Reza Lotun wrote: Hi, As an addendum to that, what is the current status of trying to build Pyobjc 2.0 for Python 2.6? I tried a few weeks ago but it didn't seem to work - is it at all possible? Yes, it is possible. I haven't tried building it against the python.org binary dist of 2.6, but I have a script that will build 2.6 from source and then build pyobjc from trunk. See below for the important bits. Thanks, Reza On Wed, Dec 17, 2008 at 9:52 AM, David Warde-Farley > wrote: Hi folks, I noticed today that while PyObjC, etc. is included in the system Python in 10.5, the py2.5-fat binaries on undefined.org are 1.4.x series. As I understood it, the python.org UB is the only solution if you want to build redistributable applications. Not necessarily. py2app should have no trouble using a custom built python. I also have been using it as a jumping off point so that I have a completely common dev environment on 10.5 and 10.4 for other stuff I do. The solution below will only work on 10.5, but it should be possible to build against the 10.4 universal sdk with the appropriate modifications. Well, I'm trying to build PyObjC 2.0 from trunk with the python.org package and running into all sorts of errors. For example, pyobjc-core fails to build with this: Modules/objc/bundle-variables.m: In function 'PyObjC_loadBundleFunctions': Modules/objc/bundle-variables.m:221: error: '_localHandler' undeclared (first use in this function) Modules/objc/bundle-variables.m:221: error: (Each undeclared identifier is reported only once Modules/objc/bundle-variables.m:221: error: for each function it appears in.) Modules/objc/bundle-variables.m: In function 'PyObjC_loadBundleFunctions': Modules/objc/bundle-variables.m:221: error: '_localHandler' undeclared (first use in this function) Modules/objc/bundle-variables.m:221: error: (Each undeclared identifier is reported only once Modules/objc/bundle-variables.m:221: error: for each function it appears in.) lipo: can't figure out the architecture type of: /var/folders/Hv/ HvVKXkVwF3Kt9ULgIvCLPTI/-Tmp-//ccrLeLvv.out error: command 'gcc' failed with exit status 1 I found one post on the mailing list from July that went unanswered detailing pretty much the same situation. Any hints? I ran into this problem also when first trying to build pyobjc from trunk. I don't know if it's possible to build against the python.org binaries, but if you build python from source with the options below it should work: export installprefix=/opt/python# set this to wherever you want to put it export DYLD_LIBRARY_PATH=$installprefix/lib:$DYLD_LIBRARY_PATH export DYLD_FRAMEWORK_PATH=$installprefix/Library/Frameworks: $DYLD_LIBRARY_PATH:$DYLD_FRAMEWORK_PATH export MACOSX_DEPLOYMENT_TARGET=10.5 export sdk=/Developer/SDKs/MacOSX10.5.sdk export CPPFLAGS="-I$installprefix/include -L$installprefix/lib" export CFLAGS="-O -g -isysroot $sdk -arch i386 -arch ppc -mmacosx- version-min=10.5" export LDFLAGS="-Wl,-syslibroot,$sdk -flat_namespace" ./configure \ --enable-universalsdk=$sdk \ --enable-framework=$installprefix/Library/Frameworks make make install Then, to build pyobjc, you should be able to use 02-develop-all.sh from trunk, provided you modify it to use the python you just built above (change the paths on lines 18, 19, 24, 35, and 36). Good luck, -David ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig
