Displaying files in a directory
Posted: Thu Jan 23, 2014 1:07 am
Trying to host a page such that it will display all files relevant to my project. However, its not showing anything right now =(.
E: Ok, I derped =p
Code: Select all
import os
print "Content-type: text/html\n\n"
for file in os.listdir(os.getcwd()):
if 'index' not in pathFile:
pathFile = os.getcwd().replace('/var/www/', 'http://thinkplace.tk/') + '/' + file
print '<a href="%s">%s</a>'%(pathFile, pathFile)
E: Ok, I derped =p