This repository has been archived on 2021-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
allFilenameInFile/main.py
2021-06-03 21:19:51 +02:00

19 lines
443 B
Python

from os import walk
import sys
from pathlib import Path
def listeDossier(path = None):
if path == None:
path = Path().absolute()
else:
path = Path(path)
_, _, filenames = next(walk(path))
with open(path.parent.absolute() / "resultat.txt", 'w') as f:
f.write('\n'.join(filenames))
return "Done!"
if __name__ == "__main__":
print(listeDossier(sys.argv[1] if len(sys.argv) > 1 else None))