Re: [Pythonmac-SIG] strange #!/usr/bin/pythonw behavior...

2006-02-10 Thread skip

 #!/usr/bin/pythonw

Bob Sounds like you're using OS X 10.3.  It shipped with pythonw as a  
Bob shell script, not an executable.  

Yes, thanks.  Shoulda thought to actually look at /usr/bin/pythonw...

Skip
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] strange #!/usr/bin/pythonw behavior...

2006-02-10 Thread skip

 #!/usr/bin/pythonw

Bob Sounds like you're using OS X 10.3.  It shipped with pythonw as a  
Bob shell script, not an executable.  

skip Yes, thanks.  Shoulda thought to actually look at
skip /usr/bin/pythonw...

Alas, explicitly specifying the long path didn't work either.  It bombs on
import of appscript:

Traceback (most recent call last):
  File /Users/skip/cmd/ical.py, line 11, in ?
from appscript import *
  File /Library/Python/2.3/appscript/__init__.py, line 16, in ?
from specifier import app, CommandError
  File /Library/Python/2.3/appscript/specifier.py, line 9, in ?
import aem
  File /Library/Python/2.3/aem/__init__.py, line 25, in ?
from send import *
  File /Library/Python/2.3/aem/send/__init__.py, line 103, in ?
raise RuntimeError, Can't send Apple events: no access to Window
Manager. (aem-based scripts must be run within a GUI process; e.g. use
'pythonw', not 'python', if running script in shell)
RuntimeError: Can't send Apple events: no access to Window
Manager. (aem-based scripts must be run within a GUI process; e.g. use
'pythonw', not 'python', if running script in shell)

even when run from a Terminal window.

Skip
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] strange #!/usr/bin/pythonw behavior...

2006-02-10 Thread Robert Kern
[EMAIL PROTECTED] wrote:
  #!/usr/bin/pythonw
 
 Bob Sounds like you're using OS X 10.3.  It shipped with pythonw as a  
 Bob shell script, not an executable.  
 
 skip Yes, thanks.  Shoulda thought to actually look at
 skip /usr/bin/pythonw...
 
 Alas, explicitly specifying the long path didn't work either.  It bombs on
 import of appscript:

Try

#!/usr/bin/env /usr/bin/pythonw

-- 
Robert Kern
[EMAIL PROTECTED]

In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die.
  -- Richard Harter
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] strange #!/usr/bin/pythonw behavior...

2006-02-09 Thread skip

I want to manipulate iCal from the command line.  Thanks to appscript it
looks like I'll be able to do what I want.

I wrote a simple skeleton script:

#!/usr/bin/pythonw


%(prog)s - manipulate iCal


import sys
import os
import getopt

from appscript import *

... etc ...

I made it executable and tried executing it from the bash prompt in a
Terminal window.  No go.  The system treats it like a shell script and
passes it off to the Bourne shell.  Naturally, this doesn't go over too
well.  If I run it as /usr/bin/pythonw ical.py ... it works just fine.

Am I missing something?

Thx,

-- 
Skip Montanaro
http://www.musi-cal.com/
[EMAIL PROTECTED]
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] strange #!/usr/bin/pythonw behavior...

2006-02-09 Thread Bob Ippolito

On Feb 9, 2006, at 8:07 PM, [EMAIL PROTECTED] wrote:


 I want to manipulate iCal from the command line.  Thanks to  
 appscript it
 looks like I'll be able to do what I want.

 I wrote a simple skeleton script:

 #!/usr/bin/pythonw

Sounds like you're using OS X 10.3.  It shipped with pythonw as a  
shell script, not an executable.  You need to point it at the actual  
binary:
/System/Library/Frameworks/Python.framework/Versions/2.3/Resources/ 
Python.app/Contents/MacOS/Python

If you upgrade to 10.4, this should work.

-bob

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig