Answers for "python how to load a file"

73

python write to file

file = open(“testfile.txt”,”w”) 
 
file.write(“Hello World”) 
file.write(“This is our new text file”) 
file.write(“and this is another line.”) 
file.write(“Why? Because we can.”) 
 
file.close() 
Posted by: Guest on December-09-2019
1

how to open a file in python

#open any file that is in your folder you are using in your editor
import os
os.startfile('Gamepicture.jfif')
Posted by: Guest on October-04-2020

Code answers related to "python how to load a file"

Python Answers by Framework

Browse Popular Code Answers by Language