Common.py中定义如下函数: def testfun(): print("这是一个测试程序") 另一个.py中调用: import Common as comm # 使用另一个.py文件的中函数时,需要像上面一样导入 comm.testfun()