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
Central America
Cities to NOT visit in Central America
These are the cities of Honduras, Venezuela, Mexico, Colombia, Brazil and Guatemala. San Pedro...
By FWhoop Xelqua 2023-03-30 16:25:54 0 22K
Hardware
Difference Between Hardware and Software
Hardware is the physical device required to store and run the Software, and Software is a set of...
By Dacey Rankins 2024-03-25 18:07:08 0 24K
Programming
JavaScript forEach()
The forEach() method is an iterative method. It calls a...
By Jesse Thomas 2023-05-15 20:06:26 0 11K
Game Studies
Game Studies: The Intersection of Play, Culture, and Technology
Game studies is an interdisciplinary field that examines games as a cultural and social...
By Dacey Rankins 2024-10-21 16:59:53 0 15K
Marketing and Advertising
Direct Marketing vs. Advertising: Key Differences Explained
Introduction The terms direct marketing and advertising are often used interchangeably, but they...
By Dacey Rankins 2025-10-02 20:05:32 0 2K

BigMoney.VIP Powered by Hosting Pokrov