Python Module

0
11KB

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
Social Issues
It Happened One Night (1934)
A renegade reporter trailing a young runaway heiress for a big story joins her on a bus heading...
Von Leonard Pokrovski 2023-06-28 19:38:38 0 26KB
Business
How to Become a CEO: A Step-by-Step Guide
Becoming a CEO is the pinnacle of success for many professionals in the business world....
Von Dacey Rankins 2025-06-17 15:59:24 0 8KB
Periods and Movements
Art periods
As long as we humans can use our hands, we create art. From the early cave paintings to the...
Von FWhoop Xelqua 2023-07-11 18:46:08 0 23KB
Programming
Mojo Language
Mojo is a Python type language that uses C for the performance. Python is normally slow when it...
Von Jesse Thomas 2023-05-05 20:31:29 0 11KB
Weight Loss
Understanding Weight Loss: A Comprehensive Guide
Weight loss is a common goal for many people, often pursued for health, aesthetic, or lifestyle...
Von Dacey Rankins 2024-10-14 18:38:06 0 18KB

BigMoney.VIP Powered by Hosting Pokrov