Python Module

0
11K

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
Music
3 Lo-Fi Beats and Calming Visuals: A Serene Escape into Chill Vibes for Studying, Relaxing, Sleeping
🎧 3 Lo-Fi Beats to Power Your Day: Study, Relax, and Sleep In a world full of noise and...
By Gpykin 2025-06-22 06:25:37 1 9K
Informal Sports
Exploring the Charm and Benefits of Informal Sports
  Exploring the Charm and Benefits of Informal Sports...
By Leonard Pokrovski 2024-06-27 16:37:16 0 20K
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 21K
Социальные проблемы
Отступники. The Departed. (2006)
Два лучших выпускника полицейской академии оказались по разные стороны баррикады: один из них...
By Nikolai Pokryshkin 2022-11-30 18:29:07 0 25K
Business
What Are Your Biggest Frustrations in Analytics?
Analytics is often seen as the engine behind modern business decision-making. Organizations...
By Dacey Rankins 2025-08-30 00:30:58 0 4K

BigMoney.VIP Powered by Hosting Pokrov