My part of code is
js_file = response.text
filename = [x for x in df['col1']]
for names in filename:
with open(names, 'w') as outfile:
json.dump(js_file,outfile)
What i need to do is to export to specific folder which doesn’t exist and specify the extension of filenames
for an example for the extension:
- filename1.json
- filename2.json
- … so on
I know it’s already exported as json file but i need to know how to add the extension to multiple files and put files in specific folder that doesn’t exist
Your help will be appreciated.
2
Answers
This code worked for me for whatever number of rows:
Lines here is same as rows
The following code can be used