Created
May 15, 2013 06:33
-
-
Save nathanhere/5582019 to your computer and use it in GitHub Desktop.
List current directory contents in web browser (for Koding.com)
This file contains hidden or 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
#!/usr/bin/python | |
# Make sure file permission is set so that Owner, Group, and Everyone can EXECUTE. | |
# Otherwise server error | |
import os | |
import platform | |
print "Content-Type: text/html" | |
print """\ | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> <meta charset="utf-8"> | |
<title>Hello World from Python</title> | |
</head> | |
<body> | |
""" | |
print os.listdir(os.curdir) | |
print """\ | |
</body> | |
</html> | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment