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


Groups > comp.lang.python > #57741 > unrolled thread

Running Python programmes

Started by"David" <dmgriffiths@iee.org>
First post2013-10-27 14:32 +0000
Last post2013-10-29 09:59 -0700
Articles 4 — 4 participants

Back to article view | Back to comp.lang.python


Contents

  Running Python programmes "David" <dmgriffiths@iee.org> - 2013-10-27 14:32 +0000
    Re: Running Python programmes "Colin J. Williams" <cjw@ncf.ca> - 2013-10-27 11:31 -0400
      Re: Running Python programmes Dave Angel <davea@davea.name> - 2013-10-29 04:47 +0000
        Re: Running Python programmes darnold <darnold992000@yahoo.com> - 2013-10-29 09:59 -0700

#57741 — Running Python programmes

From"David" <dmgriffiths@iee.org>
Date2013-10-27 14:32 +0000
SubjectRunning Python programmes
Message-ID<mailman.1647.1382884582.18130.python-list@python.org>
I am an absolute beginner and am working through the book Python Programming for the Absolute Beginner by Michael Dawson.  Everything is fine except if I run a scripted programme, or one I have downloaded, and then run another one, the second one will not run, I just get the >>> in the interactive window.  I have to exit Python and start again, when the second programme then runs fine.

Any suggestions much appreciated.

David

[toc] | [next] | [standalone]


#57746

From"Colin J. Williams" <cjw@ncf.ca>
Date2013-10-27 11:31 -0400
Message-ID<526D31DE.4010000@ncf.ca>
In reply to#57741
On 27/10/2013 10:32 AM, David wrote:
> I am an absolute beginner and am working through the book Python Programming for the Absolute Beginner by Michael Dawson.  Everything is fine except if I run a scripted programme, or one I have downloaded, and then run another one, the second one will not run, I just get the >>> in the interactive window.  I have to exit Python and start again, when the second programme then runs fine.
>
> Any suggestions much appreciated.
>
> David
>

David,

Perhaps you could show a very small program, maybe 3 or 4 lines, that 
illustrates the problem.

Python 3?  Windows? Using Idle?

Colin W.

[toc] | [prev] | [next] | [standalone]


#57877

FromDave Angel <davea@davea.name>
Date2013-10-29 04:47 +0000
Message-ID<mailman.1740.1383022081.18130.python-list@python.org>
In reply to#57746
On 27/10/2013 11:31, Colin J. Williams wrote:

> On 27/10/2013 10:32 AM, David wrote:
>> I am an absolute beginner and am working through the book Python Programming for the Absolute Beginner by Michael Dawson.  Everything is fine except if I run a scripted programme, or one I have downloaded, and then run another one, the second one will not run, I just get the >>> in the interactive window.  I have to exit Python and start again, when the second programme then runs fine.
>>
>> Any suggestions much appreciated.
>>

You leave out a lot of details, including what version of Python, what
OS, how you're running these "programmes" and what you mean "will not
run."

For example, if you're on Linux, running Python 3.3, and you're running
these "programmes" from the bash prompt,

$ python3.3  prog1.py
    some results

$ python3.3 prog2.py
   some other results

I'd be amazed if you even saw the >>>> prompt.


-- 
DaveA

[toc] | [prev] | [next] | [standalone]


#57934

Fromdarnold <darnold992000@yahoo.com>
Date2013-10-29 09:59 -0700
Message-ID<4b7f6201-20b2-43f0-be01-41943efc2519@googlegroups.com>
In reply to#57877
Maybe you're inadvertently running Python with either the '-i' switch or with the PYTHONINSPECT environment variable set? 
When you do that, your script will launch an interactive prompt after it completes.
 

C:\Python27>echo print "hello" > hello.py

C:\Python27>python hello.py
hello

C:\Python27>python -i hello.py
hello
>>>
>>> ^Z


C:\Python27>set PYTHONINSPECT=1

C:\Python27>python hello.py
hello
>>>
>>> ^Z

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web