Python Module

0
9Кб

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

Поиск
Категории
Больше
Science Fiction and Fantasy
Mad Max: Fury Road. (2015)
In a post-apocalyptic wasteland, a woman rebels against a tyrannical ruler in search for her...
От Leonard Pokrovski 2023-04-06 19:58:58 0 26Кб
Employment
The Evolving Landscape of Employment in the Modern World
Employment is a fundamental aspect of modern society, shaping the economy, providing individuals...
От Dacey Rankins 2025-01-23 15:12:11 0 8Кб
Real Estate
Real Estate: A Cornerstone of the Economy
Real estate is one of the most significant sectors in the global economy, influencing not only...
От Dacey Rankins 2025-01-22 14:32:32 0 9Кб
Искусство, культура и развлечения
Поющие под дождём. Singin' in the Rain. (1952)
Основа этого легендарного фильма – дюжина старых песен, написанных для различных...
От Nikolai Pokryshkin 2023-01-07 11:22:38 0 21Кб
Business
Lean Product Planning: How to Repeat the Path of Tesla and Not Become Yo-Mobile
Lean Product Planning: How to Repeat the Path of Tesla and Not Become Yo-Mobile I want to tell...
От Leonard Pokrovski 2024-08-21 23:52:41 0 16Кб
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov