Python Module

0
11Кб

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

Поиск
Категории
Больше
Personal Finance
What Should I Do If I’m Worried About My Debt but Don’t Know Where to Start?
What Should I Do If I’m Worried About My Debt but Don’t Know Where to Start? Feeling...
От Leonard Pokrovski 2025-10-30 22:31:24 0 2Кб
Business
What Types of Startup Incubators Exist?
Startup incubators have become essential pillars in the global entrepreneurship ecosystem,...
От Dacey Rankins 2025-04-24 16:56:55 0 13Кб
Социальные проблемы
Атлетка А: Скандал в американской гимнастике. Athlete A. (2020)
История одного из самых крупных скандалов в профессиональном спорте в США. Врач сборной США по...
От Nikolai Pokryshkin 2022-10-18 14:10:06 0 31Кб
Personal Finance
How Much Money Do You Need to Retire?
How Much Money Do You Need to Retire? Understanding the Size of Your Retirement...
От Leonard Pokrovski 2025-11-24 15:21:30 0 955
Marketing and Advertising
Which Platforms Are Best for Influencer Marketing in 2025? A Complete Comparison Guide
Introduction: Why Platform Choice Shapes Influencer Marketing Success Influencer marketing has...
От Dacey Rankins 2025-10-08 17:50:20 0 3Кб

BigMoney.VIP Powered by Hosting Pokrov