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

Pesquisar
Categorias
Leia Mais
Business
What Are the Guidelines for Using Copyrighted Material in My Content?
As a content creator, you may be tempted to use copyrighted material in your videos, blog posts,...
Por Dacey Rankins 2025-02-21 15:13:36 0 7K
Music
7 Relaxing Classical Music for Tranquility, Focus, and Soothing Background Ambience
7 Relaxing Classical Music Pieces for Tranquility, Focus, and Soothing Background Ambience...
Por Gpykin 2025-07-19 21:05:53 0 3K
Спорт
Атлас. Atlas. (2021)
Аллегра живет в швейцарском Лугано и любит проводить время со своим парнем Бенни, лучшей подругой...
Por Nikolai Pokryshkin 2022-09-03 19:52:30 0 35K
Financial Services
What factors change supply?
Key points Supply curve shift: Changes in production cost and related factors can...
Por Mark Lorenzo 2023-06-29 19:45:47 0 10K
Hand-Eye Coordination
Modern children sit a lot:
Modern children sit a lot: in high chairs, car seats, strollers, at cartoons, tablets, lessons....
Por Leonard Pokrovski 2024-04-04 21:08:04 0 13K

BigMoney.VIP Powered by Hosting Pokrov