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

Cerca
Categorie
Leggi tutto
Flags
Flag of Denmark
The flag of Denmark, called the Dannebrog by the Danes ( Danish: Dannebrog; Dannebrog) is a red...
By FWhoop Xelqua 2023-02-12 16:41:24 0 21K
Personal Finance
How Do I Replace My Social Security Card?
How Do I Replace My Social Security Card? Losing your Social Security card can feel stressful,...
By Leonard Pokrovski 2025-12-11 19:50:37 0 934
Business
What Are the Best Practices for Collaborating with Brands and Sponsors?
Collaborating with brands and sponsors is a powerful way for content creators to monetize their...
By Dacey Rankins 2025-02-19 15:22:05 0 10K
Business
Can a Startup Biography Evolve Over Time?
A startup biography isn’t a one-and-done document. Just like the company it represents, a...
By Dacey Rankins 2025-04-19 14:49:54 0 12K
Marketing and Advertising
How CMOs Measure Marketing Effectiveness and Overcome Challenges
In today’s rapidly evolving business landscape, measuring marketing effectiveness is...
By Dacey Rankins 2025-09-25 17:43:59 0 5K

BigMoney.VIP Powered by Hosting Pokrov