useful modules python comes with hundreds of modules that do all sorts of things there are also many thirdparty modules available for download from the internet this discusses few modules that have found useful importing modules there are couple of different ways to import modules here are several ways to import some functions from the random module from random import randintchoice from random import import random the first way imports just two functions from the module the second way imports every function from the module you should usually avoid doing thisas the module may contain some names that will interfere with your own variable names for instance if your program uses variable called total and you import module that contains function called totalthere can be problems some moduleshoweverlike tkinterare fairly safe to import this way the third way imports an entire module in way that will not interfere with your variable names to use function from the modulepreface it with random followed by dot for instancerandom randint( , changing module names the as keyword can be used to change the name that your program uses to refer to module or things from module here are three examplesimport numpy as np