Python module "Basic Learning" __python

Source: Internet
Author: User

Python Module (module)

In the process of computer development, as the program code more write more, in a file, the code will be longer and more difficult to maintain.

In order to write maintainable code, we grouped a number of functions into separate files so that each file contained less code, and many programming languages used this type of organization code. In Python, a. py file is called a module.


What is the advantage of using a module?

The biggest benefit is a significant increase in the maintainability of the code. Second, the code you write does not have to start from scratch. When a module is written, it can be referenced elsewhere. When we write a program, we often refer to other modules, including Python's built-in modules and modules from third parties.


You can also avoid conflicting function names and variable names by using modules. Functions and variables of the same name can be found in separate modules.

Python built-in functions:


built-in Functions

ABS () Divmod () Input () Open () Staticmethod ()
All () Enumerate () Int () Ord () STR ()
Any () Eval () Isinstance () POW () SUM ()
Basestring () ExecFile () Issubclass () Print () Super ()
Bin () File () ITER () Property () Tuple ()
BOOL () Filter () Len () Range () Type ()
ByteArray () Float () List () Raw_input () UNICHR ()
Callable () Format () Locals () Reduce () Unicode ()
Chr () Frozenset () Long () Reload () VARs ()
Classmethod () GetAttr () Map () Repr () Xrange ()
CMP () Globals () Max () Reversed () Zip ()
Compile () Hasattr () Memoryview () Round () __import__ ()
Complex () Hash () Min () Set ()
Delattr () Help ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.