PythonでClassを作ってみたのですが、他のクラスから読み込みができません。
おそらくUserがModelBaseを継承しているのが影響しているのかもしれませんが、どうしたら読み込めますか?
python
1# ファイル名 Test.py 2# 今回作ったClass 3class Test: 4 test = 'test'
python
1from ModelBase import ModelBase 2from peewee import * 3from Test import Test 4 5class User(ModelBase): 6 print(Test.test) 7 8# NameError: name 'Test' is not defined
2つのファイルは同じディレクトリに配置しているのですか? また "from Test import Test" だけのファイルを実行しても同じエラーになるのですか?