- f = open(fn, 'wb')
- f.write(str(self.TB_Exe.toPlainText()))
- f.close()
- except IOError, why:
- QMessageBox.critical(self, 'Save File',
- 'The file <b>%1</b> could not be saved.<br>Reason: %2'%(unicode(fn), str(why)))
+ f = open(fn, 'wb')
+ f.write(self.TB_Exe.toPlainText().encode("utf-8"))
+ f.close()
+ except IOError as why:
+ QMessageBox.critical(self, 'Save File',
+ 'The file <b>%s</b> could not be saved.<br>Reason: %s'%(str(fn), str(why)))