Skip to content

Instantly share code, notes, and snippets.

@AnshKapoor
Created August 15, 2020 12:45
Show Gist options
  • Save AnshKapoor/6ef2d75c6cf3f05dd9f739b93aafe608 to your computer and use it in GitHub Desktop.
Save AnshKapoor/6ef2d75c6cf3f05dd9f739b93aafe608 to your computer and use it in GitHub Desktop.
newFile = open("newFile.txt", "w+") # Opening the file in writing mode
string = "This is the content to be written into the file" # Content to be inserted into the file
newFile.write(string) # Writing the content to file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment