Chapter 2. EXECUTING PYTHON PROGRAMS

Python supports the same basic modes of script execution as Perl, from running the script explicitly through the Python interpreter to putting the script into a file and having the operating system automatically run the interpreter for us. We can also embed the Python interpreter into other programs – this is not something that we'll be covering in detail in this book, but be aware that there is no channel supported by Perl that isn't also available in Python.

Python does however offer one mode that isn't naturally within Perl – interactive mode. Within interactive mode you execute arbitrary Python statements and even start to write and execute a Python script, and it makes a great way both of demonstrating ...

Get Perl To Python Migration now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.