Interactive Mode
There are two variants of the interactive REPL in Python. The classic basic interpreter is supported on all platforms with minimal line control capabilities. On Windows, or Unix-like systems with…
Read moreInteractive Input Editing and History Substitution
Some versions of the Python interpreter support editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. This…
Read moreVirtual Environments and Packages
Introduction Python applications often require packages and modules beyond the standard library. Different applications may need different versions of the same library – one application might require version 1.0 of…
Read moreTour of the Python Standard Library – Advanced Modules
This tour covers advanced modules that support professional programming needs. These modules are more commonly found in larger applications rather than small scripts. Output Formatting The reprlib module provides a…
Read moreBrief Tour of the Standard Library
Operating System Interface The os module provides dozens of functions for interacting with the operating system: Be sure to use the import os style instead of from os import *.…
Read moreErrors and Exceptions in Python
When you’re learning Python, you’re bound to run into errors. These come in two main types: syntax errors and exceptions. Syntax Errors Syntax errors, or parsing errors, happen when Python…
Read morePython Input and Output
Output Formatting Options Python provides multiple ways to format output for display or writing to files. The simplest methods are expression statements and the print() function, but for more sophisticated…
Read morePython Modules and Packages
Understanding Modules When you exit the Python interpreter and restart it, any definitions you made (functions and variables) are lost. For longer programs, it’s better to use a text editor…
Read more