io मॉड्यूल अब अनुशंसित है और Python 3 के ओपन सिंटैक्स के साथ संगत है: Python में यूनिकोड (UTF-8) फाइल्स को पढ़ने और लिखने के लिए निम्न कोड उपयोग किया जाता है।
उदाहरण
import io
with io.open(filename, 'r', encoding='utf8') as f:
text = f.read()
# Unicode text प्रोसेस करें
with io.open(filename, 'w', encoding='utf8') as f:
f.write(text)