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

Search
Categories
Read More
Mental Health
ADHD: Paradoxical reaction to neuroactive substances
Another sign of the structurally altered signal processing in the central nervous system in this...
By Kelsey Rodriguez 2023-04-18 18:10:52 0 7K
Financial Services
Elasticity in areas other than price
Key points Elasticity is a general term, referring to percentage change of one...
By Mark Lorenzo 2023-07-07 20:37:00 0 7K
Programming
Python Assert
The assert keyword is used when debugging code. The assert keyword lets you...
By Jesse Thomas 2023-03-21 21:48:28 0 6K
Publications
Exploring the Evolution and Importance of Public Shopping Spaces
Exploring the Evolution and Importance of Public Shopping Spaces In the bustling tapestry of...
By Leonard Pokrovski 2024-06-01 11:49:36 0 24K
People
50 artists that left a mark in history
50 artists and their works that have left a mark on history and people's hearts...
By FWhoop Xelqua 2023-07-09 18:10:51 0 24K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov