[Tutor] [OSX] "Executable" .py or pyc script (stuck at Applescript)

Prasad, Ramit ramit.prasad at jpmorgan.com
Fri Nov 11 00:02:31 CET 2011


From: tutor-bounces+ramit.prasad=jpmorgan.com at python.org [mailto:tutor-bounces+ramit.prasad=jpmorgan.com at python.org] On Behalf Of learner404
Sent: Thursday, November 10, 2011 10:44 AM
To: Rich Lovely
Cc: Tutor Python
Subject: Re: [Tutor] [OSX] "Executable" .py or pyc script (stuck at Applescript)


On Thu, Nov 10, 2011 at 4:33 PM, Rich Lovely <roadierich at googlemail.com> wrote:

It looks like your script is being found fine, meaning the problem lies elsewhere - unless your actual app is called "avcOsxLinux.py, and you missed renaming it in the error message.  Try adding a print statement as the very first line - before any imports - to test this.

Sorry I missed replacing this one when I copy/pasted on the list;  avcOsxLinux.py is "myapp.py" (I renamed it for clarity). Unfortunately the problem is still the same. 

$ python myapp.py
$ python: can't open file 'myapp.py': [Errno 2] No such file or directory


The only reference to that filename is a french audio-visual library, which might not be installed on your target system.

Rich "RoadieRich" Lovely

There are 10 types of people in the world:
Those who know binary,
Those who do not,
And those who are off by one.
====================================================================

You can try using locate or find, but any usage of this is probably system specific and prone to bugs. If you have the option to "install" something you can try setting an environment variable with the location of myapp.py. It is probably easiest to keep myapp.py in the home directory (or subdirectory of it) and say "python ~/myapp.py" (or "python ~/.roadierich/myapp.py) from the applescript



Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  


More information about the Tutor mailing list