Last active
April 16, 2024 21:05
-
-
Save maptastik/369220af790885b31ed8aff10093dd89 to your computer and use it in GitHub Desktop.
Create a Markdown formatted list of files in a directory
This file contains 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
``` | |
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