-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetFilesInDir.py
More file actions
29 lines (24 loc) · 788 Bytes
/
Copy pathgetFilesInDir.py
File metadata and controls
29 lines (24 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# FILE: getFilesinDir.py
# AUTHORS: Marina Elmore, Jennifer Hu
# AHPCRC Summmer Institute 2014
# -------------------------------------------------
# This program creates a text file listing all the values in the current directory.
#
import sys, os, tangelo
def main():
run("numLayers.txt:input/facebook")
run("fileList.txt:input")
def run(me=""):
root = "/home/armysummer/tangelo_html/community_detection/"
textFile, inputDirectory = me.split(':')
os.system('rm' + root + textFile)
inputDirectory = root + inputDirectory
dirs = os.listdir(inputDirectory)
dirs.sort()
fileList=open('/home/armysummer/tangelo_html/community_detection/' + textFile, 'w')
for files in dirs:
fileList.write(files)
fileList.write('\n')
fileList.close()
if __name__ == "__main__":
main()