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

Suche
Kategorien
Mehr lesen
Marketing and Advertising
How Long Does Marketing Take to Show Results?
Introduction: The Patience Problem in Marketing In the fast-paced world of modern business, one...
Von Dacey Rankins 2025-10-14 17:09:22 0 9KB
Domestic Services
20 most popular jobs
Over time, interest in some services is falling, and for others, consumer demand is increasing....
Von FWhoop Xelqua 2022-11-28 14:59:39 0 43KB
Personal Development
What are personal development quotes?
What Are Personal Development Quotes? Personal development quotes are short, powerful statements...
Von Michael Pokrovski 2026-02-12 14:48:46 0 3KB
Mental Health
Psychosis: Disability
DisabilityThe classification of psychosis as a social disability is a common occurrence....
Von Kelsey Rodriguez 2023-05-23 16:08:57 0 12KB
Business
What Are the Most Common Business Strategy Frameworks?
When developing a business strategy, companies often rely on structured frameworks to help guide...
Von Dacey Rankins 2024-12-24 13:10:34 0 12KB

BigMoney.VIP Powered by Hosting Pokrov