------------------testmod.py モジュールをつくる--------------------- #! c:/Python26/python.exe # -*- coding: utf-8 -*- class testclass: def __init__(self): print "create testclass" def testmethod(self,str): print "call testmethod" print str ---------------------------------------------------------- #! c:/Python26/python.exe # -*- coding: utf-8 -*- if __name__ == "__main__": import testmod # 対象モジュールをインポート testclass1 = testmod.testclass()  # testclassの初期化 testclass1.testmethod("111") from testmod import testclass   # クラス名で直接使用出来るようになる testclass2 = testclass() testclass2.testmethod("234") -------------------------------output--------------------- create testclass call testmethod 111 create testclass call testmethod 234