Python Module

0
12KB

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
Arts, Culture and Entertainment
Ratatouille. (2007)
A rat who can cook makes an unusual alliance with a young kitchen worker at a famous Paris...
Por Leonard Pokrovski 2023-04-18 19:54:59 0 27KB
Marketing and Advertising
How Do I Join or Apply for an Affiliate Program?
Affiliate marketing is one of the most accessible ways to start an online business. Unlike...
Por Dacey Rankins 2025-09-18 16:20:25 0 4KB
Жизненные вопросы
Вверх. Up. (2009)
78-летний ворчун Карл Фредриксен считает, что жизнь обходит его стороной. Чтобы сдержать...
Por Nikolai Pokryshkin 2023-01-26 09:12:26 0 37KB
Социальные проблемы
Леон Профессионал. Léon: The Professional. (1994)
Профессиональный убийца Леон неожиданно для себя самого решает помочь 12-летней соседке Матильде,...
Por Nikolai Pokryshkin 2022-11-26 22:44:17 0 34KB
Marketing and Advertising
What Questions Should We Ask Before Developing a Marketing Strategy?
Introduction Before creating a marketing strategy, it’s crucial to pause and ask the right...
Por Dacey Rankins 2025-10-16 19:01:18 0 2KB

BigMoney.VIP Powered by Hosting Pokrov