Python Module

0
9K

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
Nudism
Germany is the birthplace of nudism.
Germany, indeed, is powerfully connected with the culture of the naked body. Between 8 and 12...
By Dacey Rankins 2024-07-29 14:09:33 0 19K
Financial Services
Aggregate demand in Keynesian analysis
Key points Aggregate demand is the sum of four components: consumption,...
By Mark Lorenzo 2023-06-19 20:20:36 0 20K
History
A Brief Overview of Art History: A Journey Through Time and Expression
Art history is the study of the visual arts across different cultures and periods, revealing how...
By Dacey Rankins 2024-10-17 18:52:22 0 25K
Mental Health
ADHD: Exercise
Regular physical exercise, particularly aerobic exercise, is an effective add-on treatment for...
By Kelsey Rodriguez 2023-05-03 17:41:29 0 9K
Financial Services
Real interest rates and international capital flows
There is more to international exchange than the flow of goods and services across borders:...
By Mark Lorenzo 2023-03-22 17:52:05 0 11K

BigMoney.VIP Powered by Hosting Pokrov