Python Module

0
10Кб

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

Поиск
Категории
Больше
Business
Top 30 Customer Feedback Questions For Product Surveys
In today’s highly competitive market, understanding your customers' experiences with your...
От Dacey Rankins 2025-05-30 14:50:22 0 6Кб
Business
Brand positioning through texts and copywriting
Many outsiders and even business owners consider copywriting very narrowly - exclusively as the...
От Dacey Rankins 2024-09-03 18:36:47 0 12Кб
Искусство, культура и развлечения
Поющие под дождём. Singin' in the Rain. (1952)
Основа этого легендарного фильма – дюжина старых песен, написанных для различных...
От Nikolai Pokryshkin 2023-01-07 11:22:38 0 24Кб
Food
Kinder Joy
Kinder Joy (formerly known as Kinder Merendero in Italy and Bahrain) is a candy made by Italian...
От FWhoop Xelqua 2023-04-24 16:44:48 0 14Кб
Horror
The Black Demon. (2023)
Stranded on a crumbling rig in Baja, a family faces off against a vengeful megalodon shark. My...
От Leonard Pokrovski 2023-06-12 20:15:46 0 33Кб

BigMoney.VIP Powered by Hosting Pokrov



Top sites Pokrov