Python Module

0
9K

If you quit from the Python interpreter and enter it again, the definitions you have made (functions and variables) are lost. Therefore, if you want to write a somewhat longer program, you are better off using a text editor to prepare the input for the interpreter and running it with that file as input instead. This is known as creating a script. As your program gets longer, you may want to split it into several files for easier maintenance. You may also want to use a handy function that you’ve written in several programs without copying its definition into each program.

To support this, Python has a way to put definitions in a file and use them in a script or in an interactive instance of the interpreter. Such a file is called a module; definitions from a module can be imported into other modules or into the main module (the collection of variables that you have access to in a script executed at the top level and in calculator mode).

Cerca
Categorie
Leggi tutto
Science Fiction and Fantasy
Jurassic World. Dominion. (2022)
Four years after the destruction of Isla Nublar, Biosyn operatives attempt to track down Maisie...
By Leonard Pokrovski 2023-02-19 18:13:44 0 16K
Programming
Python Spotipy
Spotipy is a lightweight Python library for the Spotify Web API. With Spotipy you...
By Jesse Thomas 2023-04-18 21:46:28 0 8K
Business
What Are the Benefits of Mentoring for the Mentee?
Mentoring is a powerful tool for personal and professional growth. While the mentor provides...
By Dacey Rankins 2025-05-24 15:44:21 0 4K
Искусство, культура и развлечения
40-летняя версия. The Forty-Year-Old Version. (2020)
Фильм о том как смириться с тем что тебе 40 и начать действовать в конце концов, а то так и из...
By Nikolai Pokryshkin 2022-10-02 20:24:48 0 37K
Business
Is There a Market for My Product or Service?
One of the most crucial questions for any entrepreneur or business owner is whether there is a...
By Dacey Rankins 2025-02-05 15:43:56 0 12K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov