Blog Details

img
Data Science

What does it mean to execute in Python

Spoke Right / 17 Nov, 2023

Execute Python:

Python codes can be executed in three ways:

Script Mode:

Writing Python code in a text editor and saving it with a .py extension. This file can then be executed in the Command Prompt.

Interactive Mode:

Writing Python code in a Python interactive shell. This method is useful for immediate testing of code with no stress of writing and saving the code in a file. This method is suitable only for testing purpose and for small codes.

IDE Mode:

Writing Python code in an Integrated Development Environment or IDE, such as Thonny, Pycharm, Netbeans or Eclipse. This method is suitable for managing large numbers of Python files simultaneously.


Example 1: Printing “HELLO WORLD” in python using Script Mode.

//pythonexample.py

print “HELLO WORLD”

Output:

Example 2: Printing “HELLO WORLD” in python using Interactive Mode.

Example 3: Printing “HELLO WORLD” in python using Interactive Mode and using a Variable.

0 comments

Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0