Friday, February 19, 2016

Read/Write a file in Python

The Python code below shows how to write a string to a storage file and then print the file content by reading:


open("storage.txt","w").write("Hello, World!")

readStr = open("storage.txt","r").read()

print readStr

iOS version:

Read/Write a file in an iOS app (Swift 2)

No comments:

Post a Comment