Search
 
SCRIPT & CODE EXAMPLE
 

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!
Comment

PREVIOUS NEXT
Code Example
Python :: get first digit of number 
Python :: for loop in range 
Python :: python count how many times a word appears in a string 
Python :: different types f python loops 
Python :: os.filename 
Python :: django annotate 
Python :: how to register a model in django 
Python :: variable globale python 
Python :: channels_redis 
Python :: Best Python Free Tutorial 
Python :: list remove method in python 
Python :: decimal to binary 
Python :: sample hierarchical clustering 
Python :: expand pandas dataframe into separate rows 
Python :: label binarizer 
Python :: python tkinter programming project ideas 
Python :: tuple and for loop 
Python :: Accessing Elements from Dictionary 
Python :: py array contains 
Python :: insert blank row in data frame 
Python :: check if string is python 
Python :: nan vs nat pandas 
Python :: how to add pagination in discord.py 
Python :: polymorphism in python 
Python :: python tkinter focus on entry 
Python :: python types 
Python :: greater and less than in python 
Python :: python list comprehension with filter 
Python :: python remove character from string 
Python :: Python list append tutorial 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =