Python Module

0
6K

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

Căutare
Categorii
Citeste mai mult
История
Харакири. Harakiri. (1962)
После распада своего клана ронин Хансиро Цугумо прибыл в поместье лорда Ии с просьбой совершить...
By Nikolai Pokryshkin 2022-12-05 20:28:41 0 17K
Television
CBS. WREG Channel 3, Live TV. Memphis, Tennessee, United States.
WREG-TV (UHF digital channel 28), is a CBS-affiliated television station located in Memphis,...
By Nikolai Pokryshkin 2022-11-06 12:08:21 0 29K
Жизненные вопросы
Гран Торино. Gran Torino. (2008)
Вышедший на пенсию автомеханик Уолт Ковальски проводит дни, починяя что-то по дому, попивая пиво...
By Nikolai Pokryshkin 2023-03-13 18:57:52 0 20K
Business
Social Media Marketing (SMM)
Why is social media so important for business?Social media marketing is the easiest way to reach...
By Dacey Rankins 2024-09-09 19:05:21 0 7K
Business
Why is a Business Plan Important, and Who Should Write It?
A business plan is a vital tool for any startup or established company, serving as a roadmap to...
By Dacey Rankins 2025-02-28 16:45:44 0 2K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov