Python Module

0
12KB

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

Pesquisar
Categorias
Leia mais
Business
How to Generate B2B Leads?
Most businesses do not have a lead problem. They have a trust problem disguised as a lead...
Por Dacey Rankins 2026-05-20 15:44:43 0 2KB
Human Resources
How Do Companies Protect Intellectual Property When Offshoring?
When companies engage in offshoring, they often share valuable assets such as designs, software,...
Por Dacey Rankins 2026-04-01 20:54:59 0 5KB
Economics
How Comparative Economics Studies Transition Economies: Countries Moving from Planned to Market Systems
How Comparative Economics Studies Transition Economies: Countries Moving from Planned to Market...
Por Leonard Pokrovski 2026-03-05 23:29:58 0 13KB
Television
FOX 2, Live TV. Detroit USA
FOX 2 Detroit's mornings news includes weather and traffic on the 2's plus breaking local,...
Por Nikolai Pokryshkin 2022-09-19 09:03:51 0 54KB
Business
Are Franchises Profitable?
Walk into any franchise expo and you'll hear a familiar refrain. Someone is standing beside a...
Por Dacey Rankins 2026-06-01 17:37:05 0 4KB

BigMoney.VIP Powered by Hosting Pokrov