Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news1.tnib.de!feed.news.tnib.de!news.tnib.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'importerror:': 0.05; 'url:launchpad': 0.05; 'exit': 0.07; 'try:': 0.07; 'urllib2': 0.07; 'valueerror:': 0.07; '(self):': 0.09; 'exception,': 0.09; 'grid': 0.09; 'def': 0.10; 'subject:error': 0.11; 'finished': 0.15; 'from:addr:swing.be': 0.16; 'from:addr:vincent.vandevyvre': 0.16; 'from:name:vincent vande vyvre': 0.16; 'message-id:@swing.be': 0.16; 'oqapy': 0.16; 'paqager': 0.16; 'received:mobistar.be': 0.16; 'url:oqapy': 0.16; 'url:paqager': 0.16; 'url:qarte': 0.16; 'v.v.': 0.16; '\xe9crit': 0.16; 'fix': 0.17; 'app': 0.19; 'module': 0.19; 'skip:" 40': 0.20; 'import': 0.21; 'script': 0.24; 'pass': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; '(most': 0.27; 'run': 0.28; 'skip:q 20': 0.29; 'date:': 0.29; 'skip:_ 10': 0.29; 'class': 0.29; 'install': 0.29; 'error': 0.30; 'code': 0.31; 'file': 0.32; 'skip:s 30': 0.33; 'traceback': 0.33; 'to:addr :python-list': 0.33; 'code:': 0.33; 'continue': 0.35; 'except': 0.36; 'skip:g 30': 0.36; 'subject:: ': 0.38; 'skip:l 20': 0.38; 'url:en': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'skip:u 10': 0.60; 'received:80.12': 0.65 Date: Sat, 24 Nov 2012 11:33:28 +0100 From: Vincent Vande Vyvre User-Agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 To: python-list@python.org Subject: Re: UI error for pycharm References: <0adb87de-e60b-4371-a6ff-e27c5b85a476@googlegroups.com> In-Reply-To: <0adb87de-e60b-4371-a6ff-e27c5b85a476@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 52 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353753665 news.xs4all.nl 6872 [2001:888:2000:d::a6]:53933 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33873 Le 24/11/12 11:20, bakie a =E9crit : > when I run py script in pycharm for UI=20 > > > Code: > import from PySide.QtCore import * from PySide.QtGui import * import ur= llib2 class Form(QDialog): def __init__(self, parent=3DNone): super(Form,= self).__init__(parent) date =3D self.getdata() rates =3D sorted(self.rat= es.keys()) dateLabel =3D QLabel(date) self.fromComboBox =3D QComboBox() s= elf.fromComboBox.addItems(rates) self.fromSpinBox =3D QDoubleSpinBox() se= lf.fromSpinBox.setRange(0.01, 10000000.00) self.fromSpinBox.setValue(1.00= ) self.toComboBox =3D QComboBox() self.toComboBox.addItems(rates) self.to= Label =3D QLabel("1.00") grid =3D QGridLayout() grid.addWidget(dateLabel,= 0, 0) grid.addWidget(self.fromComboBox, 1, 0) grid.addWidget(self.fromSp= inBox, 1, 1) grid.addWidget(self.toComboBox, 2, 0) grid.addWidget(self.to= Label, 2, 1) self.setLayout(grid) self.connect(self.fromComboBox, SIGNAL(= "currentIndexChanged(int)"), self.updateUi) self.connect(self.toComboBox,= SIGNAL("currentIndexChanged(int)"), self.updateUi) self.connect(self.fro= mSpinBox, SIGNAL("valueChanged(double)"), self.updateUi) def=20 > updateUi > (self): to =3D self.toComboBox.currentText() from_ =3D self.fromComboB= ox.currentText() amount =3D (self.rates[from_] / self.rates[to]) * self.f= romSpinBox.value() self.toLabel.setText("%0.2f" % amount) def getdata(sel= f): self.rates =3D {} try: date =3D "Unknown" fh =3D urllib2.urlopen("htt= p://www.bankofcanada.ca/en/markets/csv/exchange_eng.csv") for line in fh:= line =3D line.rstrip() if not line or line.startswith(("#", "Closing")):= continue fields =3D line.split(",") if line.startswith("Date "): date =3D= fields[-1] else: try: value =3D float(fields[-1]) self.rates[fields[0]] = =3D value except ValueError: pass return "Exchange rates date: " + date e= xcept Exception, e: return "Failued to download:\n%s" % e app =3D QApplic= ation(sys.argv) form =3D Form() form.show() app.exec_() > > > I had this error , how to fix them ? =20 > > Code: > C:\Python27\python.exe "C:/Users/denial/PycharmProjects/currency projec= t/alarm.py" > Traceback (most recent call last): > File "C:/Users/denial/PycharmProjects/currency project/alarm.py", lin= e 2, in > from PySide.QtCore import * > ImportError: No module named PySide.QtCore > > Process finished with exit code 1 Install PySide. --=20 Vincent V.V. Oqapy . Qarte . PaQager