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

Cerca
Categorie
Leggi tutto
Business
How Do CEOs Handle Challenges and Crises?
Handling crises and challenges is a defining aspect of a CEO’s role. From economic...
By Dacey Rankins 2025-08-07 17:27:54 0 5K
Business
How Can a Startup Biography Attract Investors?
In the competitive world of startups, grabbing the attention of investors goes beyond having a...
By Dacey Rankins 2025-04-21 18:11:16 0 11K
Business
If I Applied and Haven’t Heard Back, Who Should I Contact?
Not hearing back after applying for a job can be frustrating and leave candidates wondering...
By Dacey Rankins 2025-08-12 14:17:07 0 5K
Sport
Fight Club. (1999)
An insomniac office worker and a devil-may-care soap maker form an underground fight club that...
By Leonard Pokrovski 2022-11-10 21:13:35 0 29K
Социальные проблемы
Джон Уик 4. John Wick: Chapter 4. (2023)
Джон Уик находит способ одержать победу над Правлением кланов. Но прежде ему предстоит сразиться...
By Nikolai Pokryshkin 2023-03-29 13:30:53 0 38K

BigMoney.VIP Powered by Hosting Pokrov