next up previous
Next: A first Python script: Up: hello Previous: hello

Running Python interactively

At the command line prompt in your terminal, type



/usr/local/bin/python3

(You can also simply type python3 on our system.) This command opens an interactive Python session with Python version 3. Python prompts for commands using a triple chevron >>>. At the Python prompt, type print('Hello, world!') as in

>>> print('Hello, world!')

You should get a new line with Hello, world!. Note that Python strings must be set off by either single or double quotes.

To exit from Python, type Crtl-d.



Carleton DeTar 2017-08-10