I am copying an example from a book with a piece of code to write and read a file that has already been created (using utf-8). The thing is that the code I have doesn't print anything when I run it:
#encoding = utf-8
import io
f = io.open("abc.txt", "wt", encoding = "utf-8")
texto = u"Writing with díférént chars"
f.write(texto)
f.close
text = io.open("abc.txt", encoding = "utf-8").read()
print(text)