Description
Subject changed and example created by ctismer
Writing to a QTextStream with "<<" writes only the numbers. No error message, nothing.
from PySide2.QtCore import * from PySide2.QtGui import * from PySide2.QtWidgets import * def f(): file = QFile("out.txt") if not file.open(QIODevice.WriteOnly | QIODevice.Text): return out = QTextStream(file) out << "The magic number is: " << 49 << "huh" << 123 << "\n" if __name__ == "__main__": f()
Attachments
Issue Links
- duplicates
-
PYSIDE-332 Combination of QTextStream and QFile doesn't save the file contents
- Closed