• Home
  • Public Speaking
  • Travel

Execution Options

There are different options to run Python code.


1. Code over Interpreter/Shell


A. Command Prompt

After the command python as a command line (of course it should be recognized, you should add the python installation path to your system environmental variables in advance), we find ourselves in the shell. Then we can type python commands and they are processed.


B. IDLE: Integrated Development and Learning Environment

Instad of over cmd, we can directly use the IDLE itself for the same purpose.


C. Files

We can execute python files immediately with python command.



2. Python Related Jobs

A. Installation

Higher level jobs can be performed over system components (such as command prompt) not over interpreter. For instance, we use pip commands to install dependencies. pip command can be executed over cmd, but again the scripts installation path should be added to system environments.


Then you can immediately run pip command. (Without adding the path, another idea is to run pip with searhing for the path: python -m pip ...)


You can manage (install/remove/list) your packages from your IDE as well.



B. Conversion

Sometimes we need to convert files to other formats for reporting or for other functionalities. Especially notebooks (ipynb) are needed to be converted to other formats like simple python (py) files or html pages. The command for the conversion is:

jupyter nbconvert --to python module01.ipynb