Python Module

0
11KB

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

Suche
Kategorien
Mehr lesen
Business
How Do Startup Founders Raise Money?
Raising money is one of the most critical challenges for startup founders. Whether you're...
Von Dacey Rankins 2025-04-07 17:39:24 0 9KB
Public Health and Safety
Public Health and Safety: Ensuring Community Well-Being
Public health and safety are fundamental aspects of a thriving society, encompassing the measures...
Von Dacey Rankins 2024-11-04 18:14:32 0 10KB
Financial Services
Market equilibrium
Key points Supply and demand curves intersect at the equilibrium price. This is the...
Von Mark Lorenzo 2023-02-10 14:23:05 0 15KB
Business
What Is the Company's Management Style?
A company’s management style plays a crucial role in shaping the workplace environment,...
Von Dacey Rankins 2025-06-11 13:44:18 0 5KB
Business
How Do I Start a Fundraising Campaign?
Starting a fundraising campaign can seem like a daunting task, but with the right strategy and...
Von Dacey Rankins 2025-03-26 16:19:00 0 11KB

BigMoney.VIP Powered by Hosting Pokrov