Python Module

0
12K

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

Cerca
Categorie
Leggi tutto
Personal Finance
Tax Advantages for Self-Employed People
Tax Advantages for Self-Employed People Self-employment offers freedom — but also...
By Leonard Pokrovski 2025-12-25 20:35:23 0 3K
Money
How to Increase Your Credit Score
How to Increase Your Credit Score A strong credit score can open doors to better loan rates,...
By Leonard Pokrovski 2025-09-20 16:34:35 0 6K
Ужасы
Чужой. Alien. (1979)
В далеком будущем возвращающийся на Землю грузовой космический корабль перехватывает исходящий с...
By Nikolai Pokryshkin 2022-12-09 13:14:12 1 34K
Marketing and Advertising
What Is the Personal Life Story of Famous Advertisers?
Advertising history is often told through campaigns, agencies, and awards, but behind every...
By Dacey Rankins 2026-01-08 12:23:45 0 1K
Programming
Python Asyncio wait_for()
You can wait for an asyncio task or coroutine to complete with a timeout using...
By Jesse Thomas 2023-03-30 21:54:41 0 12K

BigMoney.VIP Powered by Hosting Pokrov