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
Marketing and Advertising
What Types of Newspaper Ads Are There?
When most people think of newspaper advertising, they picture a single static ad printed on a...
By Dacey Rankins 2026-01-23 19:18:31 0 3K
Природа и наука
Том и Джерри. Tom & Jerry. (2021)
Кайла, сотрудница престижного отеля, где обитает мышонок Джерри, рискующий нарушить ход дорогой...
By Nikolai Pokryshkin 2022-09-17 20:24:11 0 29K
Спорт
Воин. Warrior. (2011)
Томми Конлон - молодой боец, вернувшийся домой после долгого отсутствия, чтобы приготовиться к...
By Nikolai Pokryshkin 2023-03-11 22:30:49 0 44K
Money
What is APR on a Credit Card?
What is APR on a Credit Card? When you’re comparing credit cards, one of the most...
By Leonard Pokrovski 2025-09-20 15:30:19 0 2K
Programming
Chrome Extensions Using Python
The idea is to compile Python to Javascript (technically a JS pre-compiler)...
By Jesse Thomas 2023-03-20 20:46:37 0 12K

BigMoney.VIP Powered by Hosting Pokrov