Python Module

0
12K

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

Cerca
Categorie
Leggi tutto
Business
What Legal Considerations Should I Be Aware of When Starting a Business?
Starting a business is an exciting and rewarding venture, but it also comes with important legal...
By Dacey Rankins 2025-03-03 14:43:44 0 13K
Money
What is ‘good debt’?
What is ‘good debt’? Debt often carries a negative reputation. Many people associate...
By Leonard Pokrovski 2025-09-30 20:57:54 0 5K
Business
What Are the Main Skills and Techniques Needed for Conflict Resolution?
Effective conflict resolution relies on a combination of interpersonal skills and proven...
By Dacey Rankins 2025-08-04 18:28:48 0 3K
Business
Who Were Their Role Models or Mentors?
Behind every great leader is a network of influences—people who shaped their thinking,...
By Dacey Rankins 2025-06-27 16:40:26 0 5K
Business
Do Incubators Take Equity in Startups?
Startup incubators provide a wide range of valuable services—from mentorship and networking...
By Dacey Rankins 2025-04-24 17:12:41 0 17K

BigMoney.VIP Powered by Hosting Pokrov