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

Pesquisar
Categorias
Leia Mais
Business
How Do Entrepreneurs Deal with Failure?
Failure is an inevitable part of the entrepreneurial journey. Despite their best efforts, many...
Por Dacey Rankins 2025-03-17 18:43:24 0 14K
Marketing and Advertising
What Size Are Newspaper Ads?
When businesses consider newspaper advertising, one of the first—and most...
Por Dacey Rankins 2026-01-26 16:17:01 0 3K
Economics
What happens during an economic crisis?
An economic crisis is one of those events that can feel both abstract and deeply personal at the...
Por Leonard Pokrovski 2026-04-27 23:34:25 0 2K
Business
Will Automation Replace Administrative Jobs?
Few questions in today’s workplace carry as much weight—or quiet anxiety—as...
Por Dacey Rankins 2026-04-28 16:30:51 0 2K
Marketing and Advertising
Is Billboard Advertising Effective?
In an era dominated by smartphones, social media, and data-driven digital advertising, many...
Por Dacey Rankins 2026-01-13 15:23:28 0 6K

BigMoney.VIP Powered by Hosting Pokrov