[Pythonmac-SIG] pythonw and python with applescript

Zhi Peng zhiyong_peng2003 at yahoo.com
Wed Dec 14 00:59:40 CET 2005


Hi! Bob
   
  As I tried to make shared dynamic library, ld command shows some error message
   
  ld: Undefined symbols: 
  dyld_stub_binding_helper
   
  I do not know which lib including this "dyld_stub_binding_helper" even though I used "nm" to find it. The list libs that I used is 
  -L/usr/lib -L/usr/local/lib -lpython -lc -lm -lSystemStubs -lSystem_profile 
   
  It may need more lib? anyone knoew. This may be old problem that people had.  
   
  Thanks 
   
  Zhi 
Bob Ippolito <bob at redivi.com> wrote:
  
On Dec 13, 2005, at 1:30 PM, Zhi Peng wrote:

> Actually there is only one step away, that is, pythonw and python. 
> With python, I can import modules by using PyImport_ImportModule 
> ("name"). But I have to use pythonw since I used appscript. Then I 
> can not import modules sucessfully with same commands.

No. As I've said three or four times already in this thread, that is 
not an option because pythonw doesn't exist. It's just a shell 
script that starts the Python interpreter from within an application 
bundle. It's the exact same interpreter that is used when you type 
python, it's just symlinked to somewhere else. To get that behavior 
you MUST use an application bundle. It's a simple matter of creating 
a few directories and an Info.plist and putting your application in 
there. Quite trivial if you're using Xcode because it's got support 
for application bundles, where the normal GCC toolchain does not.

> If converting C code to python, there will be a lot of changes too 
> because C is strict typed language while python everything is 
> Object. I have to make .so or .dylib in order to allow python code 
> to call C code. That will be still a lot of work.

No, it's not a lot of changes. Trivially you could remove your 
Python initialization/finalization code and change the rest of main() 
to be callable from Python and turn that into an extension module. 
20-30 minutes work at most. That would solve the immediate problem 
because you wouldn't be embedding Python anymore.

-bob

  


			
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20051213/02bc96d8/attachment.htm


More information about the Pythonmac-SIG mailing list