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
Business
How Do Platform Algorithms Influence Content Visibility and Reach?
In the digital age, content creators, marketers, and businesses all strive for greater visibility...
By Dacey Rankins 2025-02-20 17:07:28 0 6K
Television
PLAYTV by Brightcove.
Learn how to navigate all types of communication with PLAYTV by Brightcove. Featuring a curated...
By Nikolai Pokryshkin 2023-05-13 12:52:08 0 33K
Nature and Science
The Lion King. (1994)
A young lion prince is cast out of his pride by his cruel uncle, who claims he killed his father....
By Leonard Pokrovski 2022-11-28 21:25:28 0 19K
Health
6 ideas to give to improve health
New Year is a holiday that is most often celebrated in the circle of the closest people. We have...
By FWhoop Xelqua 2022-12-27 13:03:18 0 19K
Financial Services
How to establish an emergency savings fund
Establishing an emergency savings fund now can have a big payoff later. Setting aside emergency...
By Mark Lorenzo 2023-05-17 20:13:55 0 13K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov