好比我有个test.py文件 类名称:Manpython
A.py 的 A类 想调用 test.py文件Man类code
#A类调用Man类 # from test.py文件 import Man类名 from test import Man #定义一个A类 class A: if __name__ == '__main__': #实例化对象 manObject=Man(); #调用其方法 manObject.sleep();