Tkinter For Python 2.7

I am learning python tkinter and have written an app that responds to clicking on a button for each button clicked, the label in the largest frame changes to reflect the color chosen. But only the words. I cant configure the background color of the label, I think because the app sees the label as none type object. What to do The code is attached, with my comments to reflect the errors that I saw. Tkinter import class ApplicationFrame def initself, masterNone Frame. None self. NSEW self. Button 1 event self. Build. Framesevent def Button. Handlerself, event, f, v, r, s, color, i if i 1 f. YE.jpg' alt='Tkinter For Python 2.7' title='Tkinter For Python 2.7' />Download Python. The current production versions are Python 3. Python 2. 7. 6. Start with one of these versions for learning Python or if you want the most. Assorted software, most of it shipped under an OSIcompatible oldstyle Python license. Some documentation links are broken at the moment, all download links should work. Text Editors Just about anything that can edit plain text will work for writing Python code, however, using a more powerful editor may make your life a bit easier. Search this website This topic in German Deutsche bersetzung ListenAbstraktion List Comprehension Python 2. This tutorial deals with Python Version 2. How To Install Chillispot On Fedora. You picked red elif i 2 f. Label is a non. Type object. You picked blue elif i 3 f. You picked green elif i 4 f. You picked black elif i 5 f. Random file r. You wish to open a file def Handler. Blueself, event printFrame 1 clicked at, event. Handler. Whiteself, event printFrame 2 clicked at, event. Build. Framesself, event for x in range1, 3 self. Frameself, bgblue Labelself, textFrame 1, bgblue. E, pady5. 0 d. NSEW d. Handler. Blue e Frameself, bgwhite Labelself, textFrame 2, bgwhite. E, pady5. 0 e. NSEW e. Handler. White f Frameself, bgred r String. Var Labelself, textvariabler, bgred. S r. setFrame 3 f. NSEW self. Frameself v String. Var color. PYVAR2 color red s Labelself, textOpen File, bgcolor, borderwidth2. SE entrywidget Entryself, textv, width1. SE s is a None. FV7.png' alt='Tkinter For Python 2.7' title='Tkinter For Python 2.7' />Type object g. String. Var self. Create. Buttonsevent, f, v, r, s, color self. Create. Buttonsself, event, f, v, r, s, color self. Red, button. 2 Blue, button. Green, button. 4 Black, button. Open for i in range1, 6 for y in self. Buttonself, textlabel y. NSEW def handler event, ii return self. Button. Handlerevent, f, v, r, s, color, i y. Tkapp Applicationmasterrootapp. Select all. Open in new window. Install tkinter for Python. If, like me, you dont have root privileges on your network because of your wonderful friends in I. S., and you are working in a local install you may have some problems with the above approaches. I spent ages on Google but in the end, its easy. Download the tcl and tk from http www. To install locally on Linux I did it to my home directory, extract the. Then open up the readme files inside the. I rancd tcl. 8. It may seem a pain, but the files are tiny and installation is very fast. Then re run python setup. It worked for me and I can now import Tkinter etc to my hearts content yipidy yay. An entire afternoon spent on this hope this note saves others from the pain.