I've tried to find cases of what does import module as x
do, but can't seem to find any explanations of what it does and how it works. I found it being used while searching up how to use tkinker. Can anyone explain what it does and how do I use it?
Asked
Active
Viewed 179 times
-1

PDuck
- 1
-
1We're glad you're here and we want to help you and this is a very broad question that isn't really related to solving a programming problem. W3 have faith that you can Google this one. – nicomp Apr 18 '20 at 01:37
1 Answers
1
import example_module as x
imports the module "example_module" and allows you to refer to it as "x" in your code. This can be helpful for modules with long names. https://www.python.org/dev/peps/pep-0221/

izhang05
- 744
- 2
- 11
- 26