Python Module

0
12K

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

Search
Categories
Read More
Financial Services
Perfect competition and why it matters
Key points A perfectly competitive firm is a price taker, which means that it...
By Mark Lorenzo 2023-04-25 19:18:12 0 16K
Marketing and Advertising
Which Brands Have Done Successful Guerrilla Marketing Campaigns?
Case studies and success stories that prove creativity beats budget. Introduction: The Power...
By Dacey Rankins 2025-10-07 17:38:26 0 9K
Economics
What Is Fiscal Policy vs. Monetary Policy?
What Is Fiscal Policy vs. Monetary Policy? Economic stability and growth depend heavily on how...
By Leonard Pokrovski 2026-04-16 17:30:05 0 3K
Business
What is Customer Development?
Customer Development is a methodology for creating products or businesses by testing ideas or...
By Dacey Rankins 2025-03-25 15:34:42 0 11K
Economics
What is marginal utility?
What Is Marginal Utility? A restless measure of satisfaction—and the quiet engine behind...
By Leonard Pokrovski 2026-05-05 08:55:17 0 3K

BigMoney.VIP Powered by Hosting Pokrov