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
What Is One Decision You Regret, and What Did You Learn From It?
Every leader has faced moments where hindsight brings clarity. Regret is not a sign of...
Por Dacey Rankins 2025-05-09 15:06:22 0 9K
Productivity
How do I organize my tasks and projects better?
How Do I Organize My Tasks and Projects Better? Effective task and project organization is a...
Por Michael Pokrovski 2026-02-23 21:05:53 0 7K
Publications
Exploring the Vital Role of Publications: A Gateway to Knowledge
Exploring the Vital Role of Publications: A Gateway to Knowledge In the realm of academia,...
Por Leonard Pokrovski 2024-05-25 00:19:18 0 30K
Social Issues
Oldboy. (2003)
After being kidnapped and imprisoned for fifteen years, Oh Dae-Su is released, only to find that...
Por Leonard Pokrovski 2022-12-28 20:47:59 0 27K
Economics
What Is GDP and Why Does It Matter?
What Is GDP and Why Does It Matter? Gross Domestic Product, commonly known as GDP, is one of the...
Por Leonard Pokrovski 2026-04-22 19:23:18 0 1K

BigMoney.VIP Powered by Hosting Pokrov