Friday, April 11, 2008

Python Interpreter

Using Command Prompt

The windows command prompt can be accessed via START/RUN/CMD


The phrase "Enter the command ..." means type the command at the prompt and press the Enter key.
C:\Python25 is an example; replace C:\Python25 with the actual drive letter and directory where your Python is installed.

  • Open a Windows Console (a.k.a.. "DOS Window"; "Command Prompt Window")
  • Navigate to the drive and working directory of your choice.
    See Command Line User Interface > Basic Navigation: www.mhuffman.com/notes/dos/dos.htm#NAV
  • Enter one of the following commands to start the Python interpreter:

    • C:\Python25\python
      (The directory C:\Python25 is not in your PATH environment variable)

    • python
      (You have set your PATH variable such that the directory C:\Python25 is in your path)

  • At the >>> prompt enter Python statements and expressions.
  • If you see ... at the prompt instead of >>> it means Python is waiting for you to complete your statement. This happens when you are typing a compound statement (such as while or if).
  • Enter Ctrl-Z to quit (Control key + the 'Z' key

No comments: