Deutsch English Français Italiano |
<mzmdnS4zwZeAopT-nZ2dnZfqlJ_NnZ2d@giganews.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 26 Aug 2022 21:46:05 +0000 Newsgroups: fr.comp.lang.python Subject: récupération d'une variable d'une spinbox X-poster: PEAR::Net_NNTP v1.5.0 (stable) From: nicodelanoche <nospam_nicodelanoche24@gmail.com.invalid> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Organization: !No_Organization! Message-ID: <mzmdnS4zwZeAopT-nZ2dnZfqlJ_NnZ2d@giganews.com> Date: Fri, 26 Aug 2022 21:46:05 +0000 Lines: 18 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-L2c9ufM+ZSaL0mwhHmpXKz7K2Y66Iw/2FSQhoJn/ajKbmzDM53DxIc27sTgPI/nUnUKCT9/rcW5d74D!jcNnTMFeI+0qZ98X+XLjJYY2SNAsCg+mM8BudNcNajlC1pGzukLZJkKDSJe00RUBO6s40Tyb6lLk X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Bytes: 1781 X-Original-Lines: 17 Bonjour, je débute sous python et ai un soucis sur la récupération de la variable d une spinbox. J'aimerais pouvoir faire un calcul avec la valeur de la spinbox mais a chaque modification de la valeur de la spinbox j'obtiens une erreur du genre : return self._tk.getdouble(self._tk.globalgetvar(self._name)) _tkinter.TclError: expected floating-point number but got "" je récupère la valeur de la spinbox dans une fonction que je vous met ici : #fonction de l'observateur var_kilometre = 1.0 var_consomation= 1.0 var_prix= 1.0 def update_data(*args): var_kilometre= float(var_kilometre_entry.get()) var_consomation= float(var_consomation_entry.get()) var_prix= float(var_prix_entry.get()) merci pour votre aide