When you import a file in Python, all code in the file is run (even in partial imports), including the print statement you had. To remove the extra numbers, you have two options:
1: Remove the code
#file1.py
def print_hello():
print("Hello")
2: Put it into its own function
#file1.py
def print_nums():
print("22132322432")#Call this with file1.print_nums()
def print_hello():
print("Hello")
In both of these cases, running file2.py will only produce the output Hello
. If you want a way to detect if file1 is being imported, see Alex Grounds' answer.
Hope this solves your issue