Last active
February 2, 2023 21:41
-
-
Save makesomelayouts/0bfbce08d1117d0fa8ba09a23c6a7e82 to your computer and use it in GitHub Desktop.
prints what is contained in the folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| def main(): | |
| i = 0 | |
| source_dir = input('folder path: ') | |
| with os.scandir(source_dir) as entries: | |
| for entry in entries: | |
| i += 1 | |
| print(f'{i} :: {entry.name}') | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment