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: 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> <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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Tue, Jun 26, 2012 at 10:19 AM, 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? =C2=A0I've tried typing pytho= n into the window and then dragging the file to terminal but I get a syntax= error. =C2=A0Sorry 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.