Skip to content

Instantly share code, notes, and snippets.

@EntityReborn
Created August 9, 2011 03:48
Show Gist options
  • Save EntityReborn/1133365 to your computer and use it in GitHub Desktop.
Save EntityReborn/1133365 to your computer and use it in GitHub Desktop.
print "__init__"
> test
> test2
Ohai
> __init__
import os
path = "." # the original gave me a empty string for some odd reason
allmodules = os.listdir(path)
for filename in allmodules:
if filename.endswith(".py"):
filename = filename[:-3]
print ">", filename
if not filename.lower() in ["__init__", "test"]: # This file was named test.py
__import__(filename)
print "ohai"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment