Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #24473

Re: Executing Python Scripts on Mac using Python Launcher

Date 2012-06-26 13:37 -0400
From Dave Angel <d@davea.name>
Subject Re: Executing Python Scripts on Mac using Python Launcher
References <8b352333-23b5-4cfb-843d-29ffe1ef0905@googlegroups.com> <mailman.1494.1340653759.4697.python-list@python.org> <347d6190-1bfc-4117-85ff-4abaa0966710@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.1522.1340732297.4697.python-list@python.org> (permalink)

Show all headers | View raw


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

Assuming python is on your PATH within that terminal, you'd normally do
something like:

cd  /fullpathtoscript                  (the location of your script)
python   myscript.py                (or whatever your script is called)


If that doesn't work for you, please be specific about what happens. 
Best way to do that is to copy/paste the text (showing in terminal) 
into your reply here.

Also, please don't top-post.  Put your new text AFTER the part you've
quoted from earlier messages.

-- 

DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Executing Python Scripts on Mac using Python Launcher David Thomas <dthomas86@me.com> - 2012-06-25 11:19 -0700
  Re: Executing Python Scripts on Mac using Python Launcher Benjamin Kaplan <benjamin.kaplan@case.edu> - 2012-06-25 12:49 -0700
    Re: Executing Python Scripts on Mac using Python Launcher David Thomas <dthomas86@me.com> - 2012-06-26 10:19 -0700
      Re: Executing Python Scripts on Mac using Python Launcher Dave Angel <d@davea.name> - 2012-06-26 13:37 -0400
        Re: Executing Python Scripts on Mac using Python Launcher David Thomas <dthomas86@me.com> - 2012-06-26 11:09 -0700
        Re: Executing Python Scripts on Mac using Python Launcher David Thomas <dthomas86@me.com> - 2012-06-26 11:09 -0700
        Re: Executing Python Scripts on Mac using Python Launcher Dave Angel <d@davea.name> - 2012-06-26 14:32 -0400
      Re: Executing Python Scripts on Mac using Python Launcher Benjamin Kaplan <benjamin.kaplan@case.edu> - 2012-06-26 11:56 -0700
      Re: Executing Python Scripts on Mac using Python Launcher Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-06-26 15:51 -0400
        Re: Executing Python Scripts on Mac using Python Launcher Hans Mulder <hansmu@xs4all.nl> - 2012-06-26 22:12 +0200
          Re: Executing Python Scripts on Mac using Python Launcher Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-06-26 18:35 -0400
          Re: Executing Python Scripts on Mac using Python Launcher Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-06-27 00:13 +0100
    Re: Executing Python Scripts on Mac using Python Launcher David Thomas <dthomas86@me.com> - 2012-06-26 10:19 -0700
  Re: Executing Python Scripts on Mac using Python Launcher David Thomas <dthomas86@me.com> - 2012-06-26 11:11 -0700
    Re: Executing Python Scripts on Mac using Python Launcher Hans Mulder <hansmu@xs4all.nl> - 2012-06-26 21:16 +0200
      Re: Executing Python Scripts on Mac using Python Launcher Dave Angel <d@davea.name> - 2012-06-26 16:41 -0400
        Re: Executing Python Scripts on Mac using Python Launcher Hans Mulder <hansmu@xs4all.nl> - 2012-06-26 23:48 +0200
          Re: Executing Python Scripts on Mac using Python Launcher Dave Angel <d@davea.name> - 2012-06-26 22:38 -0400
          Re: Executing Python Scripts on Mac using Python Launcher David Thomas <dthomas86@me.com> - 2012-06-27 10:05 -0700
            Re: Executing Python Scripts on Mac using Python Launcher Hans Mulder <hansmu@xs4all.nl> - 2012-06-27 20:29 +0200
              Re: Executing Python Scripts on Mac using Python Launcher David Thomas <dthomas86@me.com> - 2012-06-27 13:45 -0700
                Re: Executing Python Scripts on Mac using Python Launcher Hans Mulder <hansmu@xs4all.nl> - 2012-06-27 23:33 +0200

csiph-web