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

Поиск
Категории
Больше
Finance
What Are the Major and Famous Currency Pairs in Forex?
What Are the Major and Famous Currency Pairs in Forex? The foreign exchange market, or Forex, is...
От Leonard Pokrovski 2025-10-16 19:07:59 0 6Кб
Business
How Do You Collaborate with Other Teams?
Product Marketing Managers (PMMs) sit at the crossroads of product, marketing, and sales. Unlike...
От Dacey Rankins 2025-09-15 18:55:05 0 10Кб
Социальные проблемы
Китайский квартал. Chinatown. (1974)
Частный детектив Гиттес принимает предложение загадочной богатой красавицы заняться...
От Nikolai Pokryshkin 2023-03-01 11:11:59 0 25Кб
Finance
What Time Frame Should I Use in Forex?
What Time Frame Should I Use in Forex? Trading in the foreign exchange (Forex) market involves...
От Leonard Pokrovski 2025-10-15 11:14:16 0 5Кб
Business
What are the best ways to scale a business?
Scaling a business is an exciting milestone, but it requires careful planning, strategic...
От Dacey Rankins 2025-03-17 18:21:45 0 10Кб

BigMoney.VIP Powered by Hosting Pokrov