Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'syntax': 0.04; 'subject:Python': 0.05; 'linux,': 0.07; 'modified': 0.07; 'bash': 0.09; 'skip:/ 10': 0.09; 'python': 0.10; 'applies': 0.15; 'command:': 0.16; 'path.': 0.16; 'scripts.': 0.16; 'subject:using': 0.16; 'unix,': 0.16; 'variable.': 0.16; 'variables,': 0.16; '(the': 0.17; 'wrote:': 0.17; 'typing': 0.18; '(or': 0.19; 'shell': 0.20; '>>>': 0.22; '(you': 0.23; 'header:In- Reply-To:1': 0.23; 'to:2**1': 0.23; 'error.': 0.24; "i've": 0.24; 'installed': 0.25; 'header:User-Agent:1': 0.26; 'environment': 0.26; 'tried': 0.26; 'unix': 0.27; 'forgot': 0.27; 'normally': 0.27; 'window': 0.27; 'script': 0.28; 'search.': 0.29; 'run': 0.29; "i'm": 0.30; 'looks': 0.31; 'located': 0.33; 'file': 0.34; 'open': 0.34; 'thanks': 0.35; 'python.org': 0.35; 'to:addr:python- list': 0.35; 'list': 0.35; 'but': 0.36; 'whatever': 0.37; 'subject:: ': 0.37; 'well.': 0.37; 'pm,': 0.38; 'sometimes': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'simply': 0.60; 'simple': 0.60; '26,': 0.66; 'header:Reply-To:1': 0.67; 'reply- to:no real name:2**0': 0.71; 'received:74.208': 0.72; 'located.': 0.84; 'received:74.208.4.194': 0.84; 'to:name:python': 0.84; 'windows)': 0.84; 'angel': 0.93 Date: Tue, 26 Jun 2012 14:32:53 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: David Thomas , PYTHON Subject: Re: Executing Python Scripts on Mac using Python Launcher References: <8b352333-23b5-4cfb-843d-29ffe1ef0905@googlegroups.com> <347d6190-1bfc-4117-85ff-4abaa0966710@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:laBOE7EmivJUV8me9zjjItVTe12Km3rTsOX2JYU7CK/ Vi4KklgrKw2ec54aHay+46EuLVEHud0XMQPG80kh6mUB/PLjYm 6f8Rkx3knb6gZd9HNhQBhayMIQQfWbFZfwQzQ5e/Onlq6LHTgf 1hPK43E2XWFLZIVKTaPVDzLtV2hJnFKtTaXn57yXmhQyIK5hRs P9Q8yyyU/QfhZZ/FpoyxJhzwk9lCsUWlpXcfVXSSn+oLF5JZkw SZJDSwGhIcLBWOHGe4cRcMIRakmeGfPwMWq8ml9VDLpA+GSrSY Qa/DRVf4clCz7Kgls/y4jRLYcyFqEemFA0+mSR9bTABs4Gy7Q= = X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: d@davea.name List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 59 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1340735602 news.xs4all.nl 6987 [2001:888:2000:d::a6]:51428 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24476 (You forgot to include the list on this message, but I'm including them in my reply) On 06/26/2012 02:07 PM, David Thomas wrote: > > > On Tuesday, June 26, 2012 6:37:42 PM UTC+1, Dave Angel wrote: >> >> On 06/26/2012 01:19 PM, David Thomas wrote: >>> I have installed Python 2.7.3 from Python.org also in Terminal it states >> that I have 2.7.3. >>> How can I execute the script from Terminal? I've tried typing python >> into the window and then dragging the file to terminal but I get a syntax >> error. Sorry I am new to Python and just want to know how I can open such >> a file using 10.7. >>> >>> >> >> > Thanks for the fast response how can I find out if Python is on the same > path as Terminal? > > Is this located in the /usr Folder? > > Thanks > Looks like you're new to Unix as well. (the following applies to Unix, Linux, OS/X, and with modifications, to Windows) Terminal is a program. PATH is an environment variable. You normally set it globally, but it's sometimes modified by various scripts. To see what it is in a given Terminal session, simply issue the command: echo $PATH To see all your environment variables, use printenv Anyway, PATH is a list of directories that bash (or whatever shell you're using) will search. If you can run python with the simple command: python then it IS on your PATH. That means that you do NOT want to cd to the directory of python, but to the directory where your script is located. cd /fullpathtoscript (the location of your script) python myscript.py (or whatever your script is called) -- DaveA