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
Mental Health
Psychosis: Medication
Administration, or sometimes withdrawal, of a large number of medications may provoke psychotic...
By Kelsey Rodriguez 2023-06-02 19:57:14 0 12K
Marketing and Advertising
What Happens If My Website Traffic or Ranking Has Dropped?
A Complete Guide to Diagnosing and Recovering from SEO Declines Every website experiences...
By Dacey Rankins 2025-10-31 15:47:56 0 6K
Mental Health
Dementia: Frontotemporal
Frontotemporal dementias (FTDs) are characterized by drastic personality changes and language...
By Kelsey Rodriguez 2023-07-31 18:26:40 0 251K
Business
What Is the Vision for the Company’s Future?
A clear and compelling vision is the cornerstone of any successful enterprise....
By Dacey Rankins 2025-05-02 14:59:48 0 7K
Business
What Common CRO Mistakes Should Be Avoided?
Conversion Rate Optimization (CRO) is one of the most powerful strategies for increasing business...
By Dacey Rankins 2025-09-10 15:05:11 0 3K

BigMoney.VIP Powered by Hosting Pokrov