To enter conversational mode on a Linux system, type this command:
python
Type Control-D to terminate the session.
If you write a Python script named
,
you can execute it using the command
filename.py
python filename.py
Under Unix, you can also make a script self-executing by placing this line at the top:
#!/usr/bin/env python
You must also tell Linux that the file is executable by
using the command “chmod +x ”. For example,
if your script is called filenamehello.py,
you would type this command:
chmod +x hello.py