Python Module

0
8KB

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

Rechercher
Catégories
Lire la suite
Business
How Do You Handle Conflict Within Your Team?
Conflict within a team is inevitable in any workplace, especially when individuals with diverse...
Par Dacey Rankins 2025-05-12 16:31:41 0 2KB
Regional
In which country it is easier to do business: TOP-9 directions for entrepreneurs
Relocation of their own business, its opening or expansion is of interest to more and more...
Par FWhoop Xelqua 2023-04-07 18:48:04 0 21KB
Life Issues
Aladdin (1992)
A kind-hearted street urchin and a power-hungry Grand Vizier vie for a magic lamp that has the...
Par Leonard Pokrovski 2023-07-01 19:45:10 0 27KB
Card Games
How to Play Texas Hold'em for Beginners (April 2024)
Introduction to Texas Hold'em Poker Poker is one of the most glamorous casino games. Whether it...
Par Leonard Pokrovski 2024-04-03 22:12:21 0 16KB
Ужасы
Нечестивые. The Unholy. (2021)
На дереве, где 150 лет назад была повешена и сожжена обвинённая в колдовстве, глухонемая...
Par Nikolai Pokryshkin 2022-09-21 10:56:12 0 29KB
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov