Python Module

0
6K

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

Zoeken
Categorieën
Read More
Business
How Do Indie Hackers Find Profitable Ideas?
One of the most exciting aspects of being an indie hacker is the opportunity to create a business...
By Dacey Rankins 2025-02-14 15:49:23 0 3K
Social Issues
The Godfather Part II (1974)
The continuing saga of the Corleone crime family tells the story of a young Vito Corleone growing...
By Leonard Pokrovski 2022-11-02 19:51:32 0 20K
Social Issues
The Pianist. (2002)
A Polish Jewish musician struggles to survive the destruction of the Warsaw ghetto of World War...
By Leonard Pokrovski 2022-11-26 21:19:41 0 16K
Social Issues
Casino. (1995)
A tale of greed, deception, money, power, and murder occur between two best friends: a mafia...
By Leonard Pokrovski 2023-02-11 19:54:34 0 16K
Business
What is the Difference Between Business Strategy and Corporate Strategy?
In the world of business, the terms "business strategy" and "corporate strategy" are often used...
By Dacey Rankins 2024-12-24 13:08:22 0 4K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov