Skip to content

Instantly share code, notes, and snippets.

@liuzhuan
Last active August 29, 2015 14:11
Show Gist options
  • Save liuzhuan/a07c460aada4ddaa637c to your computer and use it in GitHub Desktop.
Save liuzhuan/a07c460aada4ddaa637c to your computer and use it in GitHub Desktop.
# version 3.X
# print out all the files' name, and stores
# them in a text file, in list format
import os
cwd = os.getcwd()
lst = os.listdir(cwd)
str = repr(lst)
output = open("output.txt", "w", encoding="utf-8")
output.write(str)
output.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment