Chapter 14. Execution Environment

Chapter Topics

  • Callable Objects

  • Code Objects

  • Statements and Built-in Functions

  • Executing Other Programs

  • Restricted Execution

  • Terminating Execution

  • Related Modules

There are multiple ways in Python to run a command or execute a file on disk. It all depends on what you are trying to accomplish. There are many possible scenarios during execution:

  • Remain executing within our current script

  • Create and manage a subprocess

  • Execute an external command or program

  • Execute a command which requires input

  • Invoke a command across the network

  • Execute a command creating output which requires processing

  • Execute another Python script

  • Execute a command or program in a secure environment

  • Execute a set of dynamically-generated Python statements ...

Get Core Python Programming 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.