from otherfile import TheClasstheclass = TheClass()# if you want to return the output of runreturn theclass.run() # if you want to return run itself to be used laterreturn theclass.run
将通讯系统的结尾更改为:
if __name__ == '__main__': a_game = Comm_system() a_game.run()
总是在运行的那些行会导致它在导入和执行时都运行。



