cmd - Python 3.6 64 bit configparser works in IDLE but not on open -


looooong time user, first time poster (never stumped)

using python 3.6 wrote config parser script, when run in idle editor, works expected, no problems. when use cmd, or click file.... nothing.

when more, told in cmd 'configparser' not found... why work in idle?

hope have provided enough information, have learned on here stupidist details make difference. agian, site has saved me million times

other issues may explain problem:

  • idle not opening on left click of file "edit idle"

following details:

  • windows 7 hp
  • 64 bit
  • python 3.6
  • pyqt designer 5.4.1 py 3.4 (64 bit) <- shouldn't problem??? (i know py versions don't match)

script: (script indented on purpose show here correctly)

    pyqt5 import qtcore, qtgui, qtwidgets import configparser  class ui_mainwindow(object): def clicked_btn(self): config = configparser.configparser() config.read("config.ini") user = config.get('section_2', 'user') self.label.settext(user) txt = self.lineedit.text() #print(txt) self.pushbutton.settext("last text: "+ txt) config.set('section_4', 'last_text', txt) f = open('config.ini','w') config.write(f) f.close()  def setupui(self, mainwindow): mainwindow.setobjectname("mainwindow") mainwindow.resize(220, 127) self.centralwidget = qtwidgets.qwidget(mainwindow) ...  code edited out ... mainwindow.setstatusbar(self.statusbar)  self.retranslateui(mainwindow) qtcore.qmetaobject.connectslotsbyname(mainwindow)  def retranslateui(self, mainwindow): _translate = qtcore.qcoreapplication.translate mainwindow.setwindowtitle(_translate("mainwindow", "mainwindow")) self.label.settext(_translate("mainwindow", "textlabel")) self.pushbutton.settext("click me!") self.pushbutton.clicked.connect(self.clicked_btn)  if __name__ == "__main__": import sys app = qtwidgets.qapplication(sys.argv)  mainwindow = qtwidgets.qmainwindow() ui = ui_mainwindow() ui.setupui(mainwindow) mainwindow.show() sys.exit(app.exec_()) 


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -