Python Module

0
12Кб

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
How Do You Build a Successful Sales Team?
Building a successful sales team is one of the most valuable and challenging tasks in business....
От Dacey Rankins 2025-12-19 19:06:59 0 6Кб
Economics
What are the main methods used in comparative economics?
Comparative economics studies how different economic systems work, why they perform differently,...
От Leonard Pokrovski 2026-03-03 19:03:23 0 6Кб
Educational Resources
10 educational platforms: where to gain knowledge in English
You often hear that knowing English opens up new opportunities. Today we want to provide evidence...
От FWhoop Xelqua 2023-01-16 16:29:51 0 52Кб
Business
Who Will I Report To?
Understanding who you will report to is critical for determining how your role fits within the...
От Dacey Rankins 2025-08-09 18:29:48 0 8Кб
Искусство, культура и развлечения
Круиз по джунглям. Jungle Cruise. (2021)
Хитростью и немалой сноровкой раздобыв бесценную карту верховьев Амазонки, бойкая археолог Лили...
От Nikolai Pokryshkin 2022-09-03 21:05:25 1 33Кб

BigMoney.VIP Powered by Hosting Pokrov