Create notamodule.py

linux:~> python
Python 2.6.6 (r266:84292, Feb 22 2013, 00:00:18)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import notamodule
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "notamodule.py", line 3, in <module>
    assert __name__ == '__main__', "You cannot import this as a module"
AssertionError: You cannot import this as a module
>>>


linux:~> python notamodule.py
Good. This is how this script was intended to be used