Get your
own Python
server
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#Import os Library import os #Open a file fd = os.open( "file.txt", os.O_RDWR|os.O_CREAT ) #Write a bytestring str = b"test" os.write(fd, str) #Peform force write on file os.fsync(fd) #close the file os.close(fd)
Closed file successfully!