Pythonのインポート(import)は標準ライブラリのインポートはもちろん、自ら作成したモジュールのインポートも行うことができます。 import, from まずは簡単なモジュールファイルを用意します。下記コードをtestmod.pyという名前で作業ディレクトリに保存してください。 class TestClass: def __init__(self): print('create TestClass') def test_method(self, val): print('call test_method') print(val) 次は上記モジュールを実行(インポート)するコードを記述します。Pythonはコード中のどこにimport、fromを記述してもエラーにはなりません。 import testmod test_class_1 = testmod.TestClass() te