What is a Python Module?

Asked 2 years ago, Updated 2 years ago, 14 views

I am currently studying python.
I don't understand the meaning of the module, so
I would appreciate it if you could let me know.

python

2022-09-30 17:30

1 Answers

I think it's used in a very broad sense, but

From Official document

A module is a file containing Python definitions and statements.The filename is the module name with the suffix .py.

But it will be the first image to come.

Also, I think there are more situations where you use a module, but in that situation, you use import to import the module.

For example, if you want to use the command line input variables using the features defined in the sys module

import sys

print(sys.argv[0])

uses the functionality of the sys module.


2022-09-30 17:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.