Guest User

Untitled

a guest
Apr 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import sys, os
  3.  
  4. def make_namespaced(path):
  5. init_file = os.path.join(path, "__init__.py")
  6. if os.path.exists(init_file):
  7. return
  8. open(init_file, "w").write("import pkg_resources\npkg_resources.declare_namespace(__name__)\n\n")
  9.  
  10. [make_namespaced(i[0]) for i in os.walk(sys.argv[1])]
Add Comment
Please, Sign In to add comment