Hi all,

here's some code of thc, my txt to html converter programmed with Python and pyQT4:
-------------------------------------------------------------------------------
if self.rdioBtnTransitional.isChecked():
            if self.cmboBoxLang.currentText() == "English":
file_open.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' + '\n')
            elif self.cmboBoxLang.currentText() == "German":
file_open.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//DE">' + '\n')
        else:
file_open.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">' + '\n')
            if self.cmboBoxLang.currentText() == "English":
file_open.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">' + '\n')
            elif self.cmboBoxLang.currentText() == "German":
file_open.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict/DE">' + '\n')
--------------------------------------------------------------------------------

Do you have any ideas for a better code than that? Could this be done smarter, shorter, whatever!?

Thanks in advance,
Listick
http://www.listick.org
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to