Python Module

0
11K

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).

Căutare
Categorii
Citeste mai mult
Science Fiction and Fantasy
The Incredibles. (2004)
While trying to lead a quiet suburban life, a family of undercover superheroes are forced into...
By Leonard Pokrovski 2023-06-22 20:52:18 0 36K
Team Spirit
Team Spirit
In team sports, the coach is faced with the task of creating a good team and nurturing team...
By FWhoop Xelqua 2023-01-15 11:06:07 0 19K
Marketing and Advertising
Is My Business Considered Telemarketing? Understanding What Qualifies and Why It Matters
Introduction Many organizations engage in telephone-based outreach — calling customers,...
By Dacey Rankins 2025-11-05 14:39:43 0 1K
Social Issues
The Godfather Part II (1974)
The continuing saga of the Corleone crime family tells the story of a young Vito Corleone growing...
By Leonard Pokrovski 2022-11-02 19:51:32 0 28K
Mental Health
Dementia: Signs and Symptoms
The signs and symptoms of dementia are termed as the neuropsychiatric symptoms, also known as the...
By Kelsey Rodriguez 2023-07-13 20:01:00 0 13K

BigMoney.VIP Powered by Hosting Pokrov