{"id":2497,"date":"2020-06-04T17:15:22","date_gmt":"2020-06-04T15:15:22","guid":{"rendered":"https:\/\/www.mathweb.fr\/euclide\/?p=2497"},"modified":"2024-06-09T17:02:01","modified_gmt":"2024-06-09T15:02:01","slug":"python-tkinter-et-calculatrice","status":"publish","type":"post","link":"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/","title":{"rendered":"Python, tkinter et calculatrice"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Je viens de faire une calculatrice basique \u00e0 l&rsquo;aide de Python et de <em>tkinter<\/em>.<\/p>\n\n\n\n<!--more-->\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"502\" height=\"292\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/06\/calculatrice.png\" alt=\"calculatrice tkinter\" class=\"wp-image-2498\" srcset=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/06\/calculatrice.png 502w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/06\/calculatrice-300x175.png 300w\" sizes=\"auto, (max-width: 502px) 100vw, 502px\" \/><figcaption class=\"wp-element-caption\">calculatrice faite en Python<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Ce qu&rsquo;il y a de pratique, c&rsquo;est que j&rsquo;ai ajout\u00e9 des raccourcis clavier car appuyer sur les touches avec la souris est p\u00e9nible. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ainsi, en tapant le calcul (avec ou sans parenth\u00e8ses), et en appuyant sur la touche [Entr\u00e9e], le r\u00e9sultat s&rsquo;affiche. Et pour effacer tout, on appuie sur la touche [Escape]. Pour effacer le dernier caract\u00e8re saisie, on peut aussi appuyer sur la touche [Del].<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Le programme complet se trouve ci-dessous:<\/p>\n\n\n\n<div class=\"wp-block-file aligncenter um_article\"><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/06\/calculatrice.zip\">calculatrice<\/a><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/06\/calculatrice.zip\" class=\"wp-block-file__button wp-element-button\" download>T\u00e9l\u00e9charger<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Je viens de faire une calculatrice basique \u00e0 l&rsquo;aide de Python et de tkinter.<\/p>\n","protected":false},"author":1,"featured_media":2498,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6,5],"tags":[208,101,207],"class_list":["post-2497","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-informatique","category-mathematiques","category-python","tag-calculatrice","tag-python","tag-tkinter"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python, tkinter et calculatrice - Mathweb.fr - Notion de classes<\/title>\n<meta name=\"description\" content=\"Nous allons dans cet article comment programme une calculatrice en Python, en utilisant tkinter, avec la notion de classes.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python, tkinter et calculatrice - Mathweb.fr - Notion de classes\" \/>\n<meta property=\"og:description\" content=\"Nous allons dans cet article comment programme une calculatrice en Python, en utilisant tkinter, avec la notion de classes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/\" \/>\n<meta property=\"og:site_name\" content=\"Mathweb.fr\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-04T15:15:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-09T15:02:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/06\/calculatrice.png\" \/>\n\t<meta property=\"og:image:width\" content=\"502\" \/>\n\t<meta property=\"og:image:height\" content=\"292\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"St\u00e9phane Pasquet\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"St\u00e9phane Pasquet\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/06\\\/04\\\/python-tkinter-et-calculatrice\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/06\\\/04\\\/python-tkinter-et-calculatrice\\\/\"},\"author\":{\"name\":\"St\u00e9phane Pasquet\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\"},\"headline\":\"Python, tkinter et calculatrice\",\"datePublished\":\"2020-06-04T15:15:22+00:00\",\"dateModified\":\"2024-06-09T15:02:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/06\\\/04\\\/python-tkinter-et-calculatrice\\\/\"},\"wordCount\":107,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/06\\\/04\\\/python-tkinter-et-calculatrice\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/calculatrice.png\",\"keywords\":[\"calculatrice\",\"python\",\"tkinter\"],\"articleSection\":[\"Informatique\",\"Math\u00e9matiques\",\"Python\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/06\\\/04\\\/python-tkinter-et-calculatrice\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/06\\\/04\\\/python-tkinter-et-calculatrice\\\/\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/06\\\/04\\\/python-tkinter-et-calculatrice\\\/\",\"name\":\"Python, tkinter et calculatrice - Mathweb.fr - Notion de classes\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/06\\\/04\\\/python-tkinter-et-calculatrice\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/06\\\/04\\\/python-tkinter-et-calculatrice\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/calculatrice.png\",\"datePublished\":\"2020-06-04T15:15:22+00:00\",\"dateModified\":\"2024-06-09T15:02:01+00:00\",\"description\":\"Nous allons dans cet article comment programme une calculatrice en Python, en utilisant tkinter, avec la notion de classes.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/06\\\/04\\\/python-tkinter-et-calculatrice\\\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/06\\\/04\\\/python-tkinter-et-calculatrice\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/06\\\/04\\\/python-tkinter-et-calculatrice\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/calculatrice.png\",\"contentUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/calculatrice.png\",\"width\":502,\"height\":292,\"caption\":\"calculatrice tkinter\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/06\\\/04\\\/python-tkinter-et-calculatrice\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python, tkinter et calculatrice\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#website\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/\",\"name\":\"Mathweb.fr\",\"description\":\"Math\u00e9matiques, LaTeX et Python\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\",\"name\":\"St\u00e9phane Pasquet\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\",\"contentUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\",\"width\":74,\"height\":77,\"caption\":\"St\u00e9phane Pasquet\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python, tkinter et calculatrice - Mathweb.fr - Notion de classes","description":"Nous allons dans cet article comment programme une calculatrice en Python, en utilisant tkinter, avec la notion de classes.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/","og_locale":"fr_FR","og_type":"article","og_title":"Python, tkinter et calculatrice - Mathweb.fr - Notion de classes","og_description":"Nous allons dans cet article comment programme une calculatrice en Python, en utilisant tkinter, avec la notion de classes.","og_url":"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/","og_site_name":"Mathweb.fr","article_published_time":"2020-06-04T15:15:22+00:00","article_modified_time":"2024-06-09T15:02:01+00:00","og_image":[{"width":502,"height":292,"url":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/06\/calculatrice.png","type":"image\/png"}],"author":"St\u00e9phane Pasquet","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"St\u00e9phane Pasquet","Dur\u00e9e de lecture estim\u00e9e":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/#article","isPartOf":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/"},"author":{"name":"St\u00e9phane Pasquet","@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69"},"headline":"Python, tkinter et calculatrice","datePublished":"2020-06-04T15:15:22+00:00","dateModified":"2024-06-09T15:02:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/"},"wordCount":107,"commentCount":2,"publisher":{"@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69"},"image":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/06\/calculatrice.png","keywords":["calculatrice","python","tkinter"],"articleSection":["Informatique","Math\u00e9matiques","Python"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/","url":"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/","name":"Python, tkinter et calculatrice - Mathweb.fr - Notion de classes","isPartOf":{"@id":"https:\/\/www.mathweb.fr\/euclide\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/#primaryimage"},"image":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/06\/calculatrice.png","datePublished":"2020-06-04T15:15:22+00:00","dateModified":"2024-06-09T15:02:01+00:00","description":"Nous allons dans cet article comment programme une calculatrice en Python, en utilisant tkinter, avec la notion de classes.","breadcrumb":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/#primaryimage","url":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/06\/calculatrice.png","contentUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/06\/calculatrice.png","width":502,"height":292,"caption":"calculatrice tkinter"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/06\/04\/python-tkinter-et-calculatrice\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.mathweb.fr\/euclide\/"},{"@type":"ListItem","position":2,"name":"Python, tkinter et calculatrice"}]},{"@type":"WebSite","@id":"https:\/\/www.mathweb.fr\/euclide\/#website","url":"https:\/\/www.mathweb.fr\/euclide\/","name":"Mathweb.fr","description":"Math\u00e9matiques, LaTeX et Python","publisher":{"@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mathweb.fr\/euclide\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":["Person","Organization"],"@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69","name":"St\u00e9phane Pasquet","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp","url":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp","contentUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp","width":74,"height":77,"caption":"St\u00e9phane Pasquet"},"logo":{"@id":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp"}}]}},"_links":{"self":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/posts\/2497","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/comments?post=2497"}],"version-history":[{"count":0,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/posts\/2497\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/media\/2498"}],"wp:attachment":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/media?parent=2497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/categories?post=2497"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/tags?post=2497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}