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


Groups > comp.lang.python > #33230

Re: Simple Question regarding running .py program

Path csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'interpreter': 0.04; '(so': 0.07; 'subject:Question': 0.07; 'python': 0.09; 'cmd': 0.09; 'etc.),': 0.09; 'ide': 0.09; 'imported': 0.09; 'settings,': 0.09; 'truncate': 0.09; 'cc:addr :python-list': 0.10; 'gui': 0.11; 'do,': 0.15; 'file,': 0.15; '"idle"': 0.16; '(setting': 0.16; 'do).': 0.16; 'idle,': 0.16; 'non-trivial': 0.16; 'reload': 0.16; 'script?': 0.16; 'sth': 0.16; 'subject:program': 0.16; 'syntax.': 0.16; 'wrote:': 0.17; 'shell': 0.18; 'written': 0.20; 'import': 0.21; 'cc:2**0': 0.23; 'references': 0.23; 'installed': 0.23; "i've": 0.23; 'cc:no real name:2**0': 0.24; 'script': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'dos': 0.27; 'run': 0.28; '(maybe': 0.29; 'questions.': 0.29; 'though.': 0.29; 'source': 0.29; 'basic': 0.30; 'stuff': 0.30; 'code': 0.31; 'running': 0.32; 'could': 0.32; 'getting': 0.33; 'message.': 0.33; 'idle': 0.33; 'subject: .': 0.33; 'subject:Simple': 0.33; 'subject:regarding': 0.33; 'traceback': 0.33; 'knowledge': 0.33; "can't": 0.34; 'program,': 0.34; 'text': 0.34; 'project': 0.34; 'wrong': 0.34; 'done': 0.34; 'along': 0.35; 'especially': 0.35; 'pm,': 0.35; "won't": 0.35; 'something': 0.35; 'there': 0.35; 'really': 0.36; 'but': 0.36; 'useful': 0.36; 'should': 0.36; 'thank': 0.36; 'editor': 0.37; 'does': 0.37; 'subject:: ': 0.38; 'mean': 0.38; 'some': 0.38; 'nothing': 0.38; 'received:192': 0.39; 'called': 0.39; 'received:192.168': 0.40; 'your': 0.60; 'is.': 0.62; 'safe': 0.63; 'different': 0.63; 'love': 0.63; 'great': 0.64; 'charset:windows-1252': 0.65; 'covers': 0.65; 'listings': 0.66; 'header:Reply-To:1': 0.68; 'box,': 0.69; 'programs,': 0.71; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'commercial': 0.73; 'article': 0.78; 'acquainted': 0.84; 'received:74.208.4.194': 0.84; 'reply!': 0.84; 'start.': 0.84; 'subject:running': 0.84; 'thoroughly': 0.84
Date Tue, 13 Nov 2012 04:25:42 -0500
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version 1.0
To Caroline Hou <joyhou2010@gmail.com>
Subject Re: Simple Question regarding running .py program
References <fbc6ecf4-9aa9-4b29-9308-0ed81a3b5bf9@googlegroups.com> <mailman.3605.1352773507.27098.python-list@python.org> <22ae6963-6700-4ea7-b396-344d89ead7f2@googlegroups.com>
In-Reply-To <22ae6963-6700-4ea7-b396-344d89ead7f2@googlegroups.com>
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:X7qkpdZslzV1OBxw9QyUq0YmDwfFXc4nhQuGfewJV8R W8g87/lVp5qxMSYfyBp2vDWSBLcaejntikho9ySTL8MoMtVAZO WBkFYMgXO/l8dICtt3k37sZAup2YhUDT2bizefha1Kjnn2dCxe gq67uXt3/e5wWWkLHJirbLnThjMNko4borC2jg8Pt02b2kqbEt CTaJpUURY99OglTbQXFBRGHviax1ZuHOA6SC7kfS2MVAP+xAC+ 3JFibjFPvrmYsIL3NpWfjAx4MWSyNcxKDisYl72vgRO44nFuT9 QP3PuKiX++SRT5AuDN9vDx/hyedxx+UK/LRdEabLPc4u+CStA= =
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To d@davea.name
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.3617.1352798772.27098.python-list@python.org> (permalink)
Lines 44
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1352798772 news.xs4all.nl 6900 [2001:888:2000:d::a6]:49011
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:33230

Show key headers only | View raw


On 11/12/2012 09:45 PM, Caroline Hou wrote:
<snip all the doublespaced quotes>
> 
> Hi Dave!
> 
> thank you very much for your quick reply! I did manage to get the program run from cmd.exe. 
> So does it mean that if I want to use python interactively,I should use the interpreter,while if I just want to run a python program, I should use DOS shell instead?

The DOS shell is one answer that settled both of your original
questions.  It's also how I run about 90% of the time.  But different
people have different preferences.

The interpreter is great for experimenting.  But if you have non-trivial
code (presumably written in a file), then you have to import it.  Which
means references to the stuff there are done with mymodule.myfunction.
That can get tiresome after a while.  And if you have to change the
source file, it's not always safe to reload it (so I never do).  If I've
imported something, and that something has changed, I quit the
interpreter and start it over.

When you're running the script as a whole from the DOS box, it's always
a clean start.

> Also, how could I edit my script? I have sth called "IDLE" installed along with python. Is it the right place to write/edit my script?

Any text editor will do, but especially one with some knowledge of the
Python syntax.  Don't use Notepad.  I've never used IDLE (I use a
commercial one called Komodo IDE), so I can't say how good it is.  Many
people love IDLE, though.

The thing is, any IDE will require some setup (setting directory paths,
project settings, etc.), and some getting used to.  Some don't work very
well for GUI programs, others truncate traceback listings (maybe giving
you a GUI view of the same information).  Some apparently won't even let
you copy/paste a traceback into a mail message.  So it's very useful to
also get thoroughly acquainted with the cmd prompt.

> Sorry about these semi-idiot questions but it is really hard to find an article or book that covers such basic stuffs! 

Nothing wrong with those questions.  Welcome to Python-list.

-- 

DaveA

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


Thread

Simple Question regarding running .py program Caroline Hou <joyhou2010@gmail.com> - 2012-11-12 18:02 -0800
  Re: Simple Question regarding running .py program Dave Angel <d@davea.name> - 2012-11-12 21:24 -0500
    Re: Simple Question regarding running .py program Caroline Hou <joyhou2010@gmail.com> - 2012-11-12 18:45 -0800
      Re: Simple Question regarding running .py program Terry Reedy <tjreedy@udel.edu> - 2012-11-13 01:21 -0500
      Re: Simple Question regarding running .py program Dave Angel <d@davea.name> - 2012-11-13 04:25 -0500
      Re: Simple Question regarding running .py program Ramchandra Apte <maniandram01@gmail.com> - 2012-11-13 04:35 -0800
        Re: Simple Question regarding running .py program Caroline Hou <joyhou2010@gmail.com> - 2012-11-13 19:31 -0800
          Re: Simple Question regarding running .py program Chris Angelico <rosuav@gmail.com> - 2012-11-14 15:10 +1100
            Re: Simple Question regarding running .py program rurpy@yahoo.com - 2012-11-13 21:08 -0800
              Re: Simple Question regarding running .py program Chris Angelico <rosuav@gmail.com> - 2012-11-14 17:02 +1100
                Re: Simple Question regarding running .py program rurpy@yahoo.com - 2012-11-13 23:02 -0800
                Re: Simple Question regarding running .py program rusi <rustompmody@gmail.com> - 2012-11-13 23:52 -0800
                Re: Simple Question regarding running .py program Chris Angelico <rosuav@gmail.com> - 2012-11-15 00:35 +1100
                Re: Simple Question regarding running .py program rurpy@yahoo.com - 2012-11-14 10:20 -0800
                Re: Simple Question regarding running .py program Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-14 23:07 +0000
                Re: Simple Question regarding running .py program rurpy@yahoo.com - 2012-11-14 15:57 -0800
                Re: Simple Question regarding running .py program Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-15 00:30 +0000
                Re: Simple Question regarding running .py program rurpy@yahoo.com - 2012-11-15 13:29 -0800
                Re: Simple Question regarding running .py program Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-11-15 22:15 +0000
                Re: Simple Question regarding running .py program Grant Edwards <invalid@invalid.invalid> - 2012-11-16 02:55 +0000
                Re: Simple Question regarding running .py program Duncan Booth <duncan.booth@invalid.invalid> - 2012-11-22 11:35 +0000
                Re: Simple Question regarding running .py program rusi <rustompmody@gmail.com> - 2012-11-15 20:10 -0800
                Re: Simple Question regarding running .py program Chris Angelico <rosuav@gmail.com> - 2012-11-16 17:37 +1100
                Re: Simple Question regarding running .py program Chris Angelico <rosuav@gmail.com> - 2012-11-16 17:38 +1100
                Re: Simple Question regarding running .py program Terry Reedy <tjreedy@udel.edu> - 2012-11-14 20:18 -0500
          Re: Simple Question regarding running .py program Terry Reedy <tjreedy@udel.edu> - 2012-11-14 20:08 -0500
    Re: Simple Question regarding running .py program Caroline Hou <joyhou2010@gmail.com> - 2012-11-12 18:45 -0800

csiph-web