Skip to content

Instantly share code, notes, and snippets.

@maptastik
Last active April 16, 2024 21:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maptastik/369220af790885b31ed8aff10093dd89 to your computer and use it in GitHub Desktop.
Save maptastik/369220af790885b31ed8aff10093dd89 to your computer and use it in GitHub Desktop.
Create a Markdown formatted list of files in a directory
```
Create a Markdown formatted list of files in a directory
```
import os
dir = input("Directory to generate list: ")
list = os.listdir(dir)
file = open(dir + '\\' + 'list.txt', 'w')
for l in list:
file.write('- ' + str(l) + '\n')
file.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment