import
os
from
pathlib
import
Path
class
PathTree:
def
__init__(
self
):
os.chdir(os.path.abspath(os.path.dirname(__file__)))
homepath
=
Path(
'.'
)
rootpath
=
homepath
/
'..'
self
.docpath
=
rootpath
/
'doc'
self
.docpath.mkdir(exist_ok
=
True
)
self
.datapath
=
rootpath
/
'data'
self
.datapath.mkdir(exist_ok
=
True
)
self
.databasepath
=
self
.datapath
/
'database'
self
.databasepath.mkdir(exist_ok
=
True
)
self
.excelpath
=
self
.datapath
/
'excel'
self
.excelpath.mkdir(exist_ok
=
True
)
self
.csvpath
=
self
.datapath
/
'csv'
self
.csvpath.mkdir(exist_ok
=
True
)
self
.htmlpath
=
self
.datapath
/
'html'
self
.htmlpath.mkdir(exist_ok
=
True
)
self
.imagepath
=
self
.datapath
/
'images'
self
.imagepath.mkdir(exist_ok
=
True
)
self
.jsonpath
=
self
.datapath
/
'json'
self
.jsonpath.mkdir(exist_ok
=
True
)
self
.logpath
=
self
.datapath
/
'logs'
self
.logpath.mkdir(exist_ok
=
True
)
self
.pandaspath
=
self
.datapath
/
'pandas'
self
.pandaspath.mkdir(exist_ok
=
True
)
self
.prettypath
=
self
.datapath
/
'pretty'
self
.prettypath.mkdir(exist_ok
=
True
)
self
.tmppath
=
self
.datapath
/
'tmp'
self
.tmppath.mkdir(exist_ok
=
True
)
self
.ASE_savefile
=
self
.htmlpath
/
"AmericasStockExchanges.html"
if
__name__
=
=
'__main__'
:
PathTree()