How does the interpretor work? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How does the interpretor work?

kenikovkenikov Posts: 8Member
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

Comments

  • infidelinfidel Posts: 2,900Member
    : 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.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

Sign In or Register to comment.