Can i save files to a usb drive in python

55 views Asked by At

I am trying to make a recipe database for my grandma and I would like to learn how to save the recipes to an sd card.

1

There are 1 answers

0
Jawwad Ahmed On BEST ANSWER

You need to use open method, see below

with open(usb_drive_location, "wb+") as file_obj:
    file_obj.write(uploaded_file.file.read())

just add in your usb_drive_location and you will be good.