标签:game func sys lis python file turn pytho end
import os
def func(path):
if os.path.isfile(path):
if path.endswith(".py"):
os.system("python %s" % path)
elif os.path.isdir(path):
list_num = os.listdir(path)
for name in list_num:
list_next = os.path.join(path, name)
func(list_next)
return "Game over"
print(func(r‘G:\salar\day6‘))
标签:game func sys lis python file turn pytho end
原文地址:https://www.cnblogs.com/hadibingjing/p/12254876.html