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
Running
The Art and Science of Sports Running: A Journey of Endurance and Achievement
Running, the fundamental act of propelling oneself swiftly on foot, transcends mere physical...
By Dacey Rankins 2024-07-08 15:24:40 0 19K
Business
How Do I Transition from a Team Member to a Managerial Role?
Stepping into a managerial role after being part of a team is an exciting but challenging...
By Dacey Rankins 2025-05-13 16:10:07 0 3K
Business
How to Find and Where to Use Competitors' Databases: A Full Review
When the competition in the niche becomes very high, it becomes difficult to find new customers....
By Dacey Rankins 2024-09-05 18:16:06 0 9K
Financial Services
Price ceilings and price floors
Key points Price ceilings prevent a price from rising above a certain level....
By Mark Lorenzo 2023-07-10 20:13:41 0 9K
Business
Are All Companies Social Enterprises?
As businesses increasingly promote their sustainability efforts and social values, it’s...
By Dacey Rankins 2025-04-15 21:29:29 0 6K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov