I am trying to create multiple json files in for loop, I am trying below, but i am getting error below
OSError: [Errno 22] Invalid argument: 'c:\\csv\x0bolume_current_{vol_size}.json'
What I tried:
storage_info =({"VolumeType": vol_type,"Size": vol_size,"InstanceId": inst_id,"Encrypted": encryption_status,"AliasName": alias_name})
for s in storage_info:
filename = 'c:\csv\volume_current_{vol_size}.json'
with open(filename, "w") as f:
json.dump(storage_info, f, indent=4, separators=(',', ': '))
as i get multiple volume size values for example 8, 2 in main loop i need to create a json for each size as one file..like volumen_current_8.json volume_current_2.json like that... anyhelp appreciated.