Symbol-2016-1.csv.gz. Ich möchte aber eine führende 0 bei der Ausgabe der Woche haben.
Symbol-2016-01.csv.gz
Week.map("{:02}".format)
Code: Alles auswählen
def save_file(symbol, year, week, data):
filename = generate_filename(symbol, year, week.map("{:02}".format))
print(filename)
if not os.path.exists(os.path.dirname(filename)):
os.makedirs(os.path.dirname(filename))
with open(filename, "wb") as output:
output.write(data)