Python Module

0
11K

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

Search
Categories
Read More
Personal Finance
How to Get Out of Debt and Pay It Off Faster
How to Get Out of Debt and Pay It Off Faster Debt can feel overwhelming — whether...
By Leonard Pokrovski 2025-10-29 18:40:04 0 3K
Социальные проблемы
Охота. The Hunt. (2012)
42-летний Лукас живет в небольшой датской деревушке, работает воспитателем в детском саду и...
By Nikolai Pokryshkin 2023-01-12 17:44:38 0 28K
Business
How Much Equity Should a Startup Founder Keep?
As a startup founder, one of the most important decisions you’ll make is how much equity to...
By Dacey Rankins 2025-04-02 16:27:30 0 11K
Science Fiction and Fantasy
Harry Potter and the Deathly Hallows: Part 2. (2011)
Harry, Ron, and Hermione search for Voldemort's remaining Horcruxes in their effort to destroy...
By Leonard Pokrovski 2023-03-21 20:12:55 0 28K
Business
What Methodologies Are Used—Agile, Scrum, Kanban?
When it comes to product management and software development, methodologies provide the structure...
By Dacey Rankins 2025-08-18 13:25:16 0 5K

BigMoney.VIP Powered by Hosting Pokrov