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

Pesquisar
Categorias
Leia Mais
Business
CEO vs. President: What's the Difference?
In the world of business leadership, the titles Chief Executive Officer (CEO) and President are...
Por Dacey Rankins 2025-06-17 15:57:52 0 7K
Business
How is User Behavior Tracked?
In the digital age, businesses thrive when they understand how users interact with their...
Por Dacey Rankins 2025-08-22 18:42:56 0 4K
Outro
The Grand Budapest Hotel. (2014)
A writer encounters the owner of an aging high-class hotel, who tells him of his early years...
Por Leonard Pokrovski 2023-03-25 20:07:07 0 26K
Business
What Are the Initial Steps to Start a Business?
Starting a business is an exciting and rewarding endeavor, but it can also be overwhelming if you...
Por Dacey Rankins 2025-03-04 14:53:46 0 9K
Business
How Do Startup Founders Split Equity with Co-Founders?
Starting a business is an exciting yet challenging journey, and one of the most crucial decisions...
Por Dacey Rankins 2025-04-04 14:12:41 0 11K

BigMoney.VIP Powered by Hosting Pokrov