Python Module

0
12كيلو بايت

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

البحث
الأقسام
إقرأ المزيد
Marketing and Advertising
The Anatomy of a Perfect Press Release: Structure, Elements, and Professional Standards
Introduction: Why Structure Matters More Than Style Press releases remain one of the most...
بواسطة Dacey Rankins 2025-10-28 17:05:21 0 4كيلو بايت
Business
What Factors Affect Pricing?
Pricing is one of the most critical decisions in business strategy. Set it too high, and...
بواسطة Dacey Rankins 2025-09-02 15:41:11 0 6كيلو بايت
Arts, Culture and Entertainment
The Prom (2020)
In desperate need of a noble cause to revive their public images and bounce back, self-centred...
بواسطة Leonard Pokrovski 2022-09-26 20:48:09 0 28كيلو بايت
Mental Health
Schizophrenia Risk Factors and Genetic
Risk factorsSchizophrenia is described as a neurodevelopmental disorder with no precise boundary,...
بواسطة Kelsey Rodriguez 2023-01-30 17:40:02 0 14كيلو بايت
Programming
Python __init__ Method
The __init__ method is the Python equivalent of the C++ constructor in an...
بواسطة Jesse Thomas 2023-03-17 20:19:20 0 12كيلو بايت

BigMoney.VIP Powered by Hosting Pokrov