.py". Working with packages and modules: Use the "import" statement to import a package or module."/> .py". Working with packages and modules: Use the "import" statement to import a package or module.">
Home > Article > Backend Development > How to use python after installation
To use an installed Python: Start an interactive shell: Enter "python" in the terminal. Use Python code in the shell: type the code and press Enter to execute it. Create a script: Create a .py file in a text editor and paste the code into it. Run the script: Navigate to the scripts folder in the terminal and enter "python
.py". Working with packages and modules: Use the "import" statement to import a package or module.
How to use installed Python
After the installation is complete
python
command to start a Python interactive shellUsing Python in an interactive shell
#Type Python code in the shell and press Enter to execute it. For example:
will print "Hello, world!"
will Create a variable named
x with the value 5
will create a loop that loops 5 times
Create and run the script
.