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

Pesquisar
Categorias
Leia mais
Central America
Top 14 Attractions to Visit in Central America
Central America is a strip of land that connects North America and South America, but for...
Por FWhoop Xelqua 2023-04-01 17:58:30 0 27KB
Pessoas
50 artists that left a mark in history
50 artists and their works that have left a mark on history and people's hearts...
Por FWhoop Xelqua 2023-07-09 18:10:51 0 26KB
Жизненные вопросы
Яблоки. Apples. (2021)
В Афинах разгорается необычная эпидемия, люди внезапно теряют память. Жертвой становится и Арис...
Por Nikolai Pokryshkin 2022-09-16 20:31:23 0 22KB
Gifts
What to give in the New Year of the Black Rabbit 2023: ideas
The coming year 2023 according to the Eastern calendar will be the year of the Black Water...
Por FWhoop Xelqua 2022-12-20 15:13:11 0 18KB
Business
How to Create a Product That Will Be Popular with Users
The problem is that often the opinion of product developers does not coincide with...
Por Dacey Rankins 2024-09-09 18:39:30 0 9KB
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov