Python Module

0
8K

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

Search
Categories
Read More
Социальные проблемы
12 лет рабства. 12 Years a Slave. (2013)
Соломон Нортап был женатым и образованным мужчиной, который жил и работал в штате Нью-Йорк, когда...
By Nikolai Pokryshkin 2023-03-21 12:18:17 0 34K
Software
Software: concept and main types
 What's it all about? Software is a set of programs for information processing. One of...
By FWhoop Xelqua 2023-04-16 17:08:57 0 15K
Business
How Do Social Enterprises Measure Their Impact?
Social enterprises are designed to tackle pressing social and environmental issues, but how do...
By Dacey Rankins 2025-04-16 17:08:27 0 3K
Programming
Chakra UI Pros & Cons
What is Chakra UI? It is a simple, modular, and accessible component library that gives you all...
By Jesse Thomas 2023-06-13 20:50:28 0 10K
Телевидение
Первый Музыкальный канал, прямой эфир. Беларусь
«Первый музыкальный» — музыкальный телеканал из Беларуси. Телеканал транслирует...
By Nikolai Pokryshkin 2022-11-20 22:18:19 0 29K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov