Python Module

0
6Кб

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

Поиск
Категории
Больше
Научная фантастика и фэнтези
ВАЛЛ-И. WALL·E (2008)
Робот ВАЛЛ·И из года в год прилежно трудится на опустевшей Земле, очищая нашу планету от...
От Nikolai Pokryshkin 2022-12-14 10:18:15 0 25Кб
Business
How Do I Create Financial Projections for a Business Plan?
Creating financial projections is one of the most critical steps in building a business plan....
От Dacey Rankins 2024-12-19 15:00:57 0 6Кб
Financial Services
Explicit and implicit costs and accounting and economic profit
Key points Privately owned firms are motivated to earn profits. Profit is the...
От Mark Lorenzo 2023-07-17 19:32:29 0 8Кб
Financial Services
Keynes’ Law and Say’s Law in the AD/AS model
Key points The short-run aggregate supply, or SRAS, curve can be divided into...
От Mark Lorenzo 2023-06-16 20:28:05 0 6Кб
Programming
OpenAI ChatGPT Python Compiler
ChatGPT can help you in many issues that you occur. Since AI is here, it can do almost anything...
От Jesse Thomas 2023-04-17 19:50:45 0 6Кб
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov