forked from nowacklab/Nowack_Lab
-
Notifications
You must be signed in to change notification settings - Fork 1
/
runme.py
23 lines (16 loc) · 965 Bytes
/
runme.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os, shutil, matplotlib
home = os.path.expanduser('~')
site_packages = os.path.dirname(os.path.abspath(os.path.join(matplotlib.__file__, '..')))
## Add utility to save jupyter notebook to HTML
package_path = os.path.join(os.getcwd(),'Utilities','jupyter_notebook_config.py')
jupyter_path = os.path.join(home, '.jupyter', 'jupyter_notebook_config.py')
shutil.copyfile(package_path, jupyter_path)
## Add github.pth file to enable "from Nowack_Lab import *"
package_path = os.path.join(os.getcwd(),'Utilities','github.pth')
anaconda_path = os.path.join(site_packages,'github.pth')
with open(anaconda_path, 'w') as f:
f.write(os.path.dirname(os.getcwd())) # Writes Github directory name
## Add custom.css file to add padding to bottom of the notebook
package_path = os.path.join(os.getcwd(),'Utilities','custom.css')
notebook_path = os.path.join(site_packages, 'notebook', 'static', 'custom', 'custom.css')
shutil.copyfile(package_path, notebook_path)