Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python test module

# module.py
# This is your module file
def helloworld():
	print("Hello World!")
    
print("You imported the module!") # This 'print' function runs first when a program imports this module

# ---------------------------------------------
# main.py
# This is your main program
import module
helloworld()

# Run main.py
# Output:
You imported the module!
Hello World!
 
PREVIOUS NEXT
Tagged: #python #test #module
ADD COMMENT
Topic
Name
3+9 =