EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login
Home Software Development Software Development Tutorials Python 3 Tutorial Python 3 Module Index
Secondary Sidebar
Python 3 Tutorial
  • Python 3 Tutorial
    • Python 3 Commands
    • Python 3 Array
    • Python 3 Operators
    • Python 3 NumPy
    • Python 3 Webserver
    • Python 3 yield
    • Python 3 Pip
    • Python 3 Install
    • Python 3 raw_input
    • Python 3 HTTP Server
    • Python 3 Threading
    • Python 3 Requests
    • Python 3 Module Index
    • Python 3 String Format
    • Python 3 Unicode
    • Python 3 GUI
    • Python 3 xrange
    • Python 3 Tuple
    • Python 3 input
    • Python 3 JSON
    • Python 3 string
    • Python 3 try-except
    • Python 3 RegEx
    • Python 3 Object-Oriented Programming
    • Python 3 zip
    • Python 3 Exception
    • Python 3 write to file
    • Python 3 Functions
    • Python 3 List Function
    • Python 3 While Loop
    • Python 3 Global Variable
    • Python 3 String Methods
    • Python 3 interpreter
    • Python 3 REPL
    • Python 3 else if
    • Python 3 basics
    • Python 3 cheat sheet
    • Python 3 Print
    • Python 3 For Loop
    • Python 3 range
    • Python 3 Dictionary
    • Python 3 has_key
    • Python 3 URLlib

Python 3 Module Index

Python 3 Module Index

Introduction to Python 3 Module Index

Python 3 module index is a Python file that contains definitions and statements that can be used in other Python applications. Many Python modules are included in the standard library when we install python. One of these, the turtle module, has already been utilized widely. Remember that we can use the stuff defined inside the module after we import it.

Python 3 Module Index Overviews

  • A file contains a list of functions we want to use in our program. Unfortunately, when we write Python code for Production Data Science Projects, it becomes unstructured over time. As a result, if we retain it grows, it becomes difficult to manage and debug.
  • Python modules can help us organize and group content utilizing files and directories to handle these problems. Python modules play a role in this modular programming method, in which the code is divided into independent components.
  • Modules in python are “.py” files that contain Python code that may be imported into another Python program.
  • A module can be considered a code library or a file containing a group of programs.
  • We can use modules to group classes or code blocks in the same file. As a result, splitting modules is a great practice for building larger Python code blocks for production-level Data Science projects.
  • A discrete, complete is referred to as a function in programming. A program’s long and complex logic is broken down into smaller, independent, and reusable pieces of instructions known as modules, subroutines, and functions. It’s made to carry out a certain activity that’s part of a larger procedure. Modular programming is the name for this method of software development.
  • A program like this has a core procedure that calls for smaller independent modules. When a function is called, it performs a specific task and then returns control to the calling routine, maybe along with the result of its operation.
  • There are several built-in functions in the Python interpreter. In every interpreter session, they are always ready to utilize.
  • Several of them have already been discussed. For Example, I/O functions such as print and input, number conversion functions such as int, float, and complex, and data type conversions such as list, tuple, and set.

Explanation of Python 3 Module Index

Below is the Python 3 module index as follows.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

1. Atexit

  • This module’s functions are defined in the atexit module. Upon regular interpreter termination, the functions that have been registered are automatically executed. Atexit executes these functions in reverse order of registration.

Code:

import atexit
print ('Example of atexit.')

Output:

Python 3 Module Index 1

2. Base 64

  • The base64, base32, base16, and base85 encodings transform 8-bit bytes to values that fall inside the ASCII range of readable characters, exchanging additional bits for data.
  • The base values relate to the length of each encoding’s alphabet. There are also variants. The below example shows base64 as follows.

Code:

import base64
print('Example of base64.')

Output:

Python 3 Module Index 2

3. Cgi

  • An HTTP server runs a CGI script commonly used via an HTML element.
  • CGI scripts are often stored in the server’s cgi bin directory. The HTTP server stores all of the request’s details in the script’s shell environment, run the script and returns the script’s output to the client. The below example shows cgi index python 3 modules are as follows.

Code:

import cgitb
cgitb.enable()
print('Example of CGI.')

Output:

Python 3 Module Index 3

4. Datetime

  • The below example shows the date-time index python 3 modules as follows.

Code:

from datetime import timedelta
print ('Example of datetime.')

Output:

Python 3 Module Index 4

5. Enum

  • An enumeration is a collection of fixed values. The members of an enumeration can be compared based on their identities, and the enumeration can be repeated.
  • Enum is the four enumeration classes defined in this module. Unique is one of the decorators, and the auto is a helper. The below example shows the enum index python 3 modules as follows.

Code:

from enum import Enum
print ('Example of Enum.')

Output:

Python 3 Module Index 5

6. Filecmp

  • The filecmp module provides functions for comparing time/correctness trade-offs available. The difflib module can be used to compare files.
  • Returns three filename lists: match, mismatch, and errors. Mismatch contains the names of files that don’t match, and errors contain the names of files that couldn’t be compared.

Code:

from filecmp import dircmp
print ('Example of filecmp.')

Output:

Python 3 Module Index 6

7. Glob

  • The glob module uses the Unix shell’s rules to locate all pathnames matching a given pattern in any order. No tilde expansion exists, but character ranges indicated with *,?, and [] will be properly matched.

Code:

import glob
print ('Example of glob.')

Output:

Python 3 Module Index 7

8. Hashlib

  • This module provides a standardized interface to a variety of methods. In addition, the FIPS secure hash algorithms SHA1 and SHA2 are included.

Code:

import hashlib
print ('Example of hashlib.')

Output:

Hashlib 8

9. Importlib

  • The importlib package serves two purposes. One option is to write Python source code that implements the import statement.
  • This provides a portable import implementation for any Python interpreter. This also results in a more understandable implementation than one written in python.

Code:

import importlib
print ('Example of importlib.')

Output:

Importlib 9

10. JSON

  • This module’s default settings output JSON, a subset of YAML 1.0 and 1.1. As a result, this module is used in YAML.

Code:

import json
print ('Example of JSON.')

Output:

JSON 10

11. Locale

  • The locale module gives us the features which enable programmers to handle cultural concerns in their applications.

Code:

import json
print ('Example of Locale.')

Output:

Locale 11

12. Mailcap

  • This module specifies how MIME-aware software, such as email clients and web browsers, responds to various MIME types files.
  • RFC 1524 Information describes the mailcap format; however, it isn’t an internet standard.

Code:

import mailcap
print ('Example of mailcap.')

Output:

Mailcap 12

Conclusion

Python modules can help us organize and group content utilizing files and directories to handle these problems. For example, the python 3 module index is a Python file that contains definitions and statements that can be used in other Python applications.

Recommended Articles

This is a guide to Python 3 Module Index. Here we discuss the Python 3 Module Index overview and the codes and examples. You may also look at the following articles to learn more –

  1. Python Add List
  2. Python Timeit
  3. statsmodels Python
  4. Python Lists Methods
Popular Course in this category
Python Certifications Training Program (40 Courses, 13+ Projects)
  40 Online Courses |  13 Hands-on Projects |  215+ Hours |  Verifiable Certificate of Completion
4.8
Price

View Course
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2023 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more