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


Groups > comp.lang.python > #24478

Re: Executing Python Scripts on Mac using Python Launcher

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <bsk16@case.edu>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'syntax': 0.04; 'string.': 0.05; 'subject:Python': 0.05; 'python': 0.10; 'do,': 0.15; 'interprets': 0.16; 'script,': 0.16; 'subject:using': 0.16; 'wrote:': 0.17; 'typing': 0.18; 'deleted.': 0.22; 'header:In- Reply-To:1': 0.23; 'error.': 0.24; 'installed': 0.25; 'tried': 0.26; 'message-id:@mail.gmail.com': 0.27; 'window': 0.27; 'script': 0.28; 'starts': 0.29; 'run': 0.29; 'am,': 0.30; 'guess': 0.30; 'in.': 0.33; 'file': 0.34; 'open': 0.34; 'skip:_ 30': 0.34; 'received:google.com': 0.34; 'thanks': 0.35; 'getting': 0.35; 'python.org': 0.35; 'too.': 0.35; 'received:209.85': 0.35; 'to:addr:python-list': 0.35; 'doing': 0.36; 'but': 0.36; 'subject:: ': 0.37; 'received:209': 0.37; 'stuff': 0.38; 'to:addr:python.org': 0.39; 'why': 0.39; 'is.': 0.63; '26,': 0.66; 'reads': 0.66
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding:x-gm-message-state; bh=EK2g9WqYWErtXrC/GVJDZvoK0EJz2KTNFpa4Tx8oUB8=; b=jflV1nYKSj0lj7fb9CJb310G7hsfW4In4Wlw8xuqLO3VPvW1FpgfxGnkeV5/UCGAb3 Hf9hDQuKkEWy1r5xcLVdDIcXH2NZp63YYfnZ5n/UEGIiUgnCU51y3x1VwySEfChzni52 2dkV8OyN2QAXnBu9hcyz7eoVQdthdpO9HqbWdvXv3gz4TK1QWO/r8UXJGCyCvRsapuJS qEI6KUGyQBZEY2F+KHcsl1fSma5TleGU/Ky5zB54MD6qAVPPToL49dDdvwp1tRE6nnyi iTyZ7BkqlzPDuQ+TkdHBedOuyMlnXQbOrrPdrqBwHEqPod6iFo4llxAfkVT+nTH7yOon 1sTw==
MIME-Version 1.0
In-Reply-To <347d6190-1bfc-4117-85ff-4abaa0966710@googlegroups.com>
References <8b352333-23b5-4cfb-843d-29ffe1ef0905@googlegroups.com> <mailman.1494.1340653759.4697.python-list@python.org> <347d6190-1bfc-4117-85ff-4abaa0966710@googlegroups.com>
Date Tue, 26 Jun 2012 11:56:34 -0700
Subject Re: Executing Python Scripts on Mac using Python Launcher
From Benjamin Kaplan <benjamin.kaplan@case.edu>
To python-list@python.org
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-Gm-Message-State ALoCoQnLuo4rHqMAMuBgJruehE9GKRH+nn8jd1uH/UzJyUIf2a1xbPlojaXG3unTi6IYlo+HqHE/
X-Junkmail-Whitelist YES (by domain whitelist at mpv2.tis.cwru.edu)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1525.1340736999.4697.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1340736999 news.xs4all.nl 6962 [2001:888:2000:d::a6]:58082
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:24478

Show key headers only | View raw


On Tue, Jun 26, 2012 at 10:19 AM, David Thomas <dthomas86@me.com> 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
>
> http://www.freeimagehosting.net/ilbqt
> http://www.freeimagehosting.net/r5ars

My guess would be that you're getting a SyntaxError when you run it
through the Launcher too. WIthout seeing the script, I don't know why
that would is.

I can tell you one thing you're doing wrong. Never, ever, use input()
in Python 2. If you do, all someone has to do is type in
__import__('os').remove(__file__) and stuff starts getting deleted.
"input" interprets what it reads in. Use raw_input() instead, which
always returns a string.

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