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

Cerca
Categorie
Leggi tutto
Money
What is a balloon payment?
What is a balloon payment? A balloon payment is a large, lump-sum payment due at the end of...
By Leonard Pokrovski 2025-09-27 16:48:35 0 5K
Business
How Do I Create a Business Plan for a Startup?
Entrepreneurs seek tips and examples tailored to startups when creating a business plan. A...
By Dacey Rankins 2024-12-18 16:56:58 0 22K
Жизненные вопросы
Помни. Memento. (2000)
Леонард Шелби изысканно и дорого одет, ездит на новеньком «Ягуаре», но проживает в...
By Nikolai Pokryshkin 2022-12-12 12:27:43 0 26K
Central America
Cities to NOT visit in Central America
These are the cities of Honduras, Venezuela, Mexico, Colombia, Brazil and Guatemala. San Pedro...
By FWhoop Xelqua 2023-03-30 16:25:54 0 23K
Business
What Are the Key Risks in an M&A Deal?
Mergers and acquisitions (M&A) are among the most ambitious, complex, and high-stakes moves a...
By Dacey Rankins 2025-11-26 13:32:29 0 1K

BigMoney.VIP Powered by Hosting Pokrov