Using the command line and the interactive shell
Since, we looked at installing Python, let's try our hand at making Python actually do things using the textual interface.
Text-based user interfaces are very useful to programmers; they provide a quick and easy way to interact with programs while they're in development, experiment with code (which is, after all, text), and access documentation.
Opening a command-line window
How you open a command-line window depends on the operating system you're using.
- On Windows 7, open the Start menu and type
CMD
into theRun
box. - In Windows 8, press the Windows key and then type
CMD
and selectCommand Prompt
. - On Windows 10, press the Windows key and select
Command Prompt
. - On macOS, navigate to
Applications
|Utilities
|Terminal
. - On Linux or other Unix-style operating systems, the precise mechanism for opening a command-line window varies, but they all have the ability to do it; look for the words xterm, terminal, or shell.
Python interactive shell
Now that we...