write file using buffer

__init__.py to initialize package variables

prepareData
     BAT, TBAT, update
     per is the percentage of update