0

how can i make a code to accsess the user's storage??(python code)

How can a python code accsess the user's storage?? Do i have to use the import [user's file]?? Idunno

11th Apr 2021, 4:14 PM
wolfy1299
wolfy1299 - avatar
1 Réponse
0
# Hi! # When you use open() in Python, # you read and write files from your computer. # Write (create) a file on your computer: with open("myFile.txt", "w") as f: f.write("Hello World") # Read a file from your computer: with open("myFile.txt", "r") as f: s = f.read() # The file is opened and read from your # computer, and assigned to the variable s. # You can also open the file "myFile.txt" with # for example Windows Notes on your computer. # Print the read file, stored on your computer: print(s)
11th Apr 2021, 6:26 PM
Per Bratthammar
Per Bratthammar - avatar