#!/usr/bin/python #coding=utf8 ######################################################################## ### ### ### Created by Martin Genet, 2016 ### ### ### ### École Polytechnique, Palaiseau, France ### ### ### ######################################################################## import os ######################################################################## os.system("rm -rf *.pyc") init_file = open("__init__.py", "w") init_file.write("#this file was generated by __init__.py.py\n\n") for (dirpath, dirnames, filenames) in os.walk("."): for filename in filenames: if filename.endswith(".py") and not filename.startswith("__init__"): init_file.write("from " + filename[:-3] + " import *\n") init_file.close()