[Pythonmac-SIG] embedded C in MacPython

2005-10-26 Thread Zhi Peng
Hi! All   I has some small program in C which is compiled as .so library in Linux and I can directly import name_of_lib.so as a module from python when I run it on Linux. It looks same if I just see them from Terminal window on Mac. Did anyone compile any C code as library called by MacPython or f

Re: [Pythonmac-SIG] get reference

2005-10-26 Thread Zhi Peng
Hi! Has Thanks a lot for your help. You may email me the binary version if possible. It makes sense to use new code for mytextFrame. I will try that too. regards Zhi --- has <[EMAIL PROTECTED]> wrote: > Zhi Peng wrote: > > >I use Tiger Mac 10.4. Could I ask you, is it > possible > >fo

Re: [Pythonmac-SIG] get reference

2005-10-26 Thread has
Zhi Peng wrote: >I use Tiger Mac 10.4. Could I ask you, is it possible >for me to get new version or binary version? I can email you the binary files direct if you want. Save you having to built it yourself, which is a bit of a chore. >As I run >the MacPython script, it now can make new docum

Re: [Pythonmac-SIG] get reference

2005-10-26 Thread Zhi Peng
Has, thanks a lot for your help. I use Tiger Mac 10.4. Could I ask you, is it possible for me to get new version or binary version? As I run the MacPython script, it now can make new document and make new textframe which place a small rectangle on the left coner of the document created. It might

Re: [Pythonmac-SIG] get reference

2005-10-26 Thread has
Zhi Peng wrote: >Traceback (most recent call last): > >appscript.specifier.CommandError: Too many direct >arguments. >Failed command: app(u'/Applications/Adobe >InDesign CS2/Adobe InDesign >CS2.app').documents[u'Untitled-1'].spreads.ID(146).pages.ID(151).text_frames.ID(179).geometric_boun

Re: [Pythonmac-SIG] get reference

2005-10-26 Thread Zhi Peng
Hi! "Has" I run the MacPython script, the only error is in the set geometric_bounds as following where I used appscript 1.1. It seems better than previous version. Thanks zhi-pengs-power-mac-g5:~/Documents/projects zpeng$ pythonw has.py >error.txt Traceback (most recent call last): File "has

Re: [Pythonmac-SIG] get reference

2005-10-26 Thread has
Zhi Peng wrote: >But Corresponding MacPython code does not work well >where I used appscript 1.1 (3.7 MB). Should I use >other version of Appscript? Probably would be a good idea. If you're on Panther you'll need to build it from scratch, I'm afraid, though I can supply binaries for Jaguar and T

Re: [Pythonmac-SIG] apple script and MacPython code

2005-10-26 Thread has
Zhi Peng wrote: >I strongly believe that MacPython can be used to write similar code to perform >Applescript code functions. I try to find corresponding MacPython code for >apple script. For example following adobe apple script code > >tell application "Adobe InDesign CS2" >set myDoc to mak

Re: [Pythonmac-SIG] get reference

2005-10-26 Thread Zhi Peng
Hi! 'Has" First of all, thank you very much for your help. tell application "Adobe InDesign CS2" set contents of text frame 1 of page 1 of document 1 to "Hello" end tell works well. (textframe -> text frame in adobe) But Corresponding MacPython code does not work well where I used appscr

Re: [Pythonmac-SIG] get reference

2005-10-26 Thread has
Zhi Peng wrote: >But with app('Adobe InDesign CS2'), it >does not work well. All application can accept the >commands but not the reference such as > >cs = app("Adobe InDesign CS2") >cs.activate() - works >cs.open("filepath_with_name") --- works >doc = cs.documents[0]

[Pythonmac-SIG] apple script and MacPython code

2005-10-26 Thread Zhi Peng
Hi! All   I strongly believe that MacPython can be used to write similar code to perform Applescript code functions. I try to find corresponding MacPython code for apple script. For example following adobe apple script code   tell application "Adobe InDesign CS2"     set myDoc to make document   

Re: [Pythonmac-SIG] get reference

2005-10-26 Thread Zhi Peng
Yes. When I run TextEdit, it works with following code from appscript import * textedit=app('TextEdit') textedit.activate() textedit.documents.end.make(new=k.document) textedit.documents[1].text.set("TEXT STRING") print textedit.documents[1].text.get() It works well. But with app('Adobe InDesi

Re: [Pythonmac-SIG] [OT] Quicktime/Buffer API

2005-10-26 Thread Chris Barker
michael ferraro wrote: > The data is a simple unsigned char * Thats just what NumPy's ArrayFromDimsAndData() (or something like that) expects. However, one issue is that if you don't copy the data, then it's hard to have Python manage the garbage collection, you need to figure out how (and when

Re: [Pythonmac-SIG] [q] Help with choosing "right" python port

2005-10-26 Thread Chris Barker
Kent Quirk wrote: > The thing to realize is that IDLE is a TK application...and so is the > turtle graphics. They conflict. Huh? I thought you could run TK apps form IDLE, and indeed that the newer IDLE ran the app in separate process, just to avoid this kind of problem! However, IDLE and TkInt

Re: [Pythonmac-SIG] get reference

2005-10-26 Thread has
Zhi Peng wrote: >page = app("Adobe InDesign >CS2").open("filename").pages[0] > >This 'page' is not a reference, It is, although it's an invalid one as elements must be 1-indexed, not 0-indexed. has -- http://freespace.virgin.net/hamish.sanderson/ ___

[Pythonmac-SIG] get reference

2005-10-26 Thread Zhi Peng
Hi! All First of all, Thanks for all your answers for my qestions. 1. In appscript commands set, I often see something like reference.bring_to_front() reference.extract_label() application.open() ... etc Application can accept all commands it should accept and respond to the commands. I kn

Re: [Pythonmac-SIG] [OT] Quicktime/Buffer API

2005-10-26 Thread michael ferraro
The data is a simple unsigned char * so thanks for the leads. M On Oct 26, 2005, at 1:02 PM, Chris Barker wrote: > michael ferraro wrote: > >> I need to eliminate any copies of a PixMaps used >> by a Quicktime Movie that I am texture mapping >> with OpenGL. I have built an extension in "C" b

Re: [Pythonmac-SIG] [OT] Quicktime/Buffer API

2005-10-26 Thread Chris Barker
michael ferraro wrote: > I need to eliminate any copies of a PixMaps used > by a Quicktime Movie that I am texture mapping > with OpenGL. I have built an extension in "C" but > I am a bit unclear as to how to "circumvent" the the > copy done by Py_BuildValue. > > I was wondering if any one has a

Re: [Pythonmac-SIG] [q] Help with choosing "right" python port

2005-10-26 Thread Kent Quirk
Title: [Pythonmac-SIG] [q] Help with choosing "right" python port The thing to realize is that IDLE is a TK application…and so is the turtle graphics. They conflict. There are apparently workarounds, but I’m not a TK weenie. There’s some information here:   http://rlai.cs.ualberta.ca/RLAI

Re: [Pythonmac-SIG] obj in MacPython and Appscript

2005-10-26 Thread has
Zhi Peng wrote: >When I used appscript, I often try to print out the object or string while I >debug the program. For example: >cs = app('TextEdit').documents[1].paragraphs[1] >print cs >I assumed that cs should be anObject of paragraphs. >But it print out as > >app('TextEdit').documents[1].par

[Pythonmac-SIG] [q] Help with choosing "right" python port

2005-10-26 Thread Neal Carpenter
Title: [Pythonmac-SIG] [q] Help with choosing "right" python port The problem: From within IDLE, I type: from turtle import * reset() I then get a small window, titled tk, and a new 'console' window. When I move the cursor to either of these I get a spinning rainbow disk, and am unable to enlar

Re: [Pythonmac-SIG] TKinter problem

2005-10-26 Thread Mark Asbach
Hi Toby, > Tkinter command I get a "no display name and no $DISPLAY environment > variable" error, e.g. obviously, you are using a version of Tkinter that relies on the X11 Window environment. Just start your python code from apple's / Applications/Utilities/X11.app or one of the open source X