Skip to content

Instantly share code, notes, and snippets.

@emakryo
Created June 13, 2017 07:43
Show Gist options
  • Save emakryo/4b5d9307ce5fa631bdc5c1b03ce39fb4 to your computer and use it in GitHub Desktop.
Save emakryo/4b5d9307ce5fa631bdc5c1b03ce39fb4 to your computer and use it in GitHub Desktop.
# general code for experiments
import time
from datetime import datetime
from progressbar import ProgressBar
import pandas as pd
def main():
timeid = datetime.now().strftime('%Y%m%d%H%M%S')
countMax = 100
pb = ProgressBar(max_value=countMax)
with open('meta%s.txt'%timeid, 'w') as f:
print('countMax=', countMax, file=f)
result = []
for x in range(countMax):
pb.update(x+1)
time.sleep(1)
result.append({'hoge': x})
pd.DataFrame(result).to_csv('result%s.csv'%timeid)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment