Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. import sys
  2. import os
  3.  
  4. def main(argv = sys.argv):
  5.  
  6. if len(argv) == 1:
  7. print('[USAGE] python create_template.py <project_name>')
  8. return 0
  9.  
  10. project_name = argv[1]
  11. if project_name in os.listdir('.'):
  12. print('name : %s already exist' % (project_name))
  13. return 0
  14.  
  15. os.mkdir(project_name)
  16. os.chdir(project_name)
  17.  
  18. os.mkdir('data')
  19. os.mkdir('hpsearch')
  20. os.mkdir('models')
  21. os.mkdir('results')
  22. os.mkdir('tests')
  23.  
  24. with open('.gitignore', 'w') as f:
  25. pass
  26. with open('README', 'w') as f:
  27. pass
  28. with open('main.py', 'w') as f:
  29. pass
  30.  
  31. with open('data/download.sh', 'w') as f:
  32. pass
  33.  
  34. with open('hpsearch/hyperband.py', 'w') as f:
  35. pass
  36. with open('hpsearch/randomsearch.py', 'w') as f:
  37. pass
  38.  
  39. with open('models/__init__.py', 'w') as f:
  40. pass
  41. with open('models/basic_model.py', 'w') as f:
  42. pass
  43.  
  44. with open('results/.gitkeep', 'w') as f:
  45. pass
  46.  
  47.  
  48. if __name__ == '__main__':
  49. main(sys.argv)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement