listdir=[x for x in os.listdir('.') if os.path.isdir(x)]
def getfilepy():
for d in listdir:
for x in os.listdir(d):
if os.path.isfile(x) and os.path.splitext(x)[1]=='.py':
print(x)
print(getfilepy())
print(os.path.abspath(x))
Sign in to make a reply
只想一夜暴富
listdir=[x for x in os.listdir('.') if os.path.isdir(x)]
def getfilepy():
for d in listdir:
for x in os.listdir(d):
if os.path.isfile(x) and os.path.splitext(x)[1]=='.py':
print(x)
print(getfilepy())