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
Marketing and Advertising
How Is PR Measured? What KPIs Matter Most in Public Relations
Introduction: The Shift Toward Data-Driven PR Public relations used to be considered more art...
By Dacey Rankins 2025-10-27 17:06:34 0 3K
Социальные проблемы
Фортуна. Fortuna. (2021)
Фортуна (6 лет) живет со своей матерью в безымянном пригороде. Она проводит время с двумя...
By Nikolai Pokryshkin 2022-09-14 22:50:15 0 26K
Business and Corporate Finance
What Does a CFO Do in a Small Business?
What Does a CFO Do in a Small Business? When people hear the title Chief Financial Officer...
By Leonard Pokrovski 2026-01-13 18:31:37 0 2K
Mental Health
ADHD: Possible Positive Traits
Possible positive traits of ADHD are a new avenue of research, and therefore limited. A 2020...
By Kelsey Rodriguez 2023-05-10 18:09:38 0 11K
Business
What Are the Best Sales Books and Courses?
Sales is one of the few skills where learning directly increases earning potential. Unlike many...
By Dacey Rankins 2025-12-15 17:46:27 0 2K

BigMoney.VIP Powered by Hosting Pokrov