Try putting this in your hello.py:
def myfunction():
print "hello!"
if __name__ == "__main__":
myfunction():
In other words
Enclose the code you have in the hello.py script in a function wrapper (myfunction() in above example). Now, when executing hello.py from the command line, the myfunction() will be called by the if __name__ == "__main__": part)
If you want to import hello.py as a Python module in another Python script, say anotherPython.py. Place an empty file in the same directory as the hello.py, whose name is exactly: __init__.py. Then in the anotherPython.py, write:
import hello
hello.myfunction()
That should then print "hello!" when executed in Python.
__name__etc.