Python Module

0
12KB

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
Business
Who Influenced the CEO's Career?
Understanding Mentors and Role Models Provides Context to the CEO's Values and Motivations A...
Von Dacey Rankins 2025-07-01 13:14:38 0 6KB
Social Issues
Double Indemnity. (1944)
A Los Angeles insurance representative lets an alluring housewife seduce him into a scheme of...
Von Leonard Pokrovski 2023-01-21 21:57:47 0 25KB
Business
How Do I Promote My Crowdfunding Campaign?
Running a successful crowdfunding campaign involves more than just launching your project online....
Von Dacey Rankins 2025-03-28 14:33:54 0 13KB
Home Improvement
How to design a Room
Whether you don’t have the budget to hire an interior designer or simply enjoy the idea of...
Von FWhoop Xelqua 2023-05-01 20:11:48 0 19KB
Support Groups
SUPPORT TEAM FOR YOUR SELLERS
Even the best sellers in the world can not go out - they need a support group that will remove...
Von FWhoop Xelqua 2023-03-20 18:27:32 0 21KB

BigMoney.VIP Powered by Hosting Pokrov