first commit
This commit is contained in:
commit
e4c7c2a75b
2 changed files with 21 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/resultat.txt
|
||||||
|
/zipped
|
19
main.py
Normal file
19
main.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
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))
|
Reference in a new issue