Skip to main content
 

Mastery14 - Creating a python module

1 min read

creating a module is no different from a normal program, create a python file and create a few functions in it.

file name: mymodule.py

def function1():

      print ("function 1")

# end of the module.

and in another program import it an call the function:

import mymodule.py

mymodule.function1()

reference:

http://www.ibiblio.org/g2swap/byteofpython/read/making-modules.html