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

Căutare
Categorii
Citeste mai mult
Business
How Does CRO Align with SEO and Content Marketing?
In digital marketing, strategies often operate in silos: SEO teams focus on visibility, content...
By Dacey Rankins 2025-09-11 16:22:42 0 5K
Marketing and Advertising
What Are Some Effective Community Building Activities?
Community building is not just about creating a space where people gather—it’s about...
By Dacey Rankins 2025-09-26 15:08:11 0 5K
Biology
Sea Bunny
Jorunna parva, commonly known as the sea bunny, is a species of dorid nudibranch, a shell-less...
By FWhoop Xelqua 2023-04-28 18:01:26 0 16K
Advice
Secrets of Productivity
Is this productivity needed at all?Productive – creating value, bringing results. The...
By FWhoop Xelqua 2023-06-05 19:00:41 0 20K
Социальные проблемы
Фарго. Fargo. (1996)
Для робкого менеджера по продажам, работающего у собственного тестя, похищение собственной жены...
By Nikolai Pokryshkin 2023-03-12 15:15:44 0 28K

BigMoney.VIP Powered by Hosting Pokrov