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
International
Embracing Internationality: Fostering Global Citizenship Among Kids and Teens
Embracing Internationality: Fostering Global Citizenship Among Kids and Teens In an increasingly...
By Leonard Pokrovski 2024-04-30 15:02:04 0 28K
Mental Health
ADHD: Controversy
ADHD, its diagnosis, and its treatment have been controversial since the 1970s. The controversies...
By Kelsey Rodriguez 2023-05-09 17:30:57 0 11K
Business
How Should I Handle Sensitive Topics or Cultural Differences in Feedback?
Giving feedback is a vital part of leadership, growth, and collaboration—but when it...
By Dacey Rankins 2025-07-24 18:10:56 0 5K
Жизненные вопросы
Помни. Memento. (2000)
Леонард Шелби изысканно и дорого одет, ездит на новеньком «Ягуаре», но проживает в...
By Nikolai Pokryshkin 2022-12-12 12:27:43 0 26K
Business
What Is a User Story?
In product development, especially in Agile and Scrum methodologies, the term user story plays a...
By Dacey Rankins 2025-08-25 18:34:16 0 6K

BigMoney.VIP Powered by Hosting Pokrov