forked from mdolab/MACH-Aero-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_tutorial_directory.py
More file actions
24 lines (21 loc) · 848 Bytes
/
make_tutorial_directory.py
File metadata and controls
24 lines (21 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
This script can be used to generate a directory structure identical to that
found in ./tutorial, except without any of the files. The user can then follow
the tutorial, creating each python script from scratch as recommended in the
introduction to the tutorial. Basically, this script saves you some time making
a bunch of directories.
"""
import os
import fnmatch
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('writedir', type=str)
args = parser.parse_args()
tutorial_directory = 'tutorial/'
write_directory = args.writedir
for root, dirnames, filenames in os.walk(tutorial_directory):
for dirname in dirnames:
fullpath = os.path.join(root, dirname)
endpath = fullpath.split(tutorial_directory)[-1]
newdir = os.path.join(write_directory, endpath)
os.system('mkdir -p %s'%newdir)