Python

Moderators: None (Apply to moderate this forum)
Number of threads: 474
Number of posts: 1166

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How does the interpretor work? Posted by kenikov on 14 May 2003 at 9:17 PM
I know their are tutorials all over the net explaining this but I am looking for a short answer but explaining it clearly.

How does the interpretor work? Do you just start it, and a Python program will just start running perfectly? Kind of like how you go to a Java Applet and you have java installed and the program works if not, the program won't load?

I know if you copy and paste the text into the interpretor it will work, but is their another way for just viewers and normal users to view a python program?
- www10.brinkster.com/kenikov
Report
Re: How does the interpretor work? Posted by infidel on 19 May 2003 at 8:16 AM
: I know their are tutorials all over the net explaining this but I am looking for a short answer but explaining it clearly.
:
: How does the interpretor work? Do you just start it, and a Python program will just start running perfectly? Kind of like how you go to a Java Applet and you have java installed and the program works if not, the program won't load?
:
: I know if you copy and paste the text into the interpretor it will work, but is their another way for just viewers and normal users to view a python program?
: - www10.brinkster.com/kenikov

If you run the interpreter by itself, either with the "python" command or via a shortcut in Windows, you will be in interactive mode. This is where you can type commands and see the results interactively.

If you run the interpreter and give it the name of a script file, python will run that script and then exit. Whether or not it runs "perfectly" depends on how well you wrote the script. If you have Python installed under Windows, it should have registered .py and .pyw files as Python scripts so you can simply double-click them and Windows will start up the interpreter for you. If you are using UNIX, Linux, or Apache or some other command-line style interface, you can place a "shebang" line at the beginning of the script:

#!/usr/bin/python

This line tells the command shell where to find the interpreter to run the rest of the script.


infidel




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.