목록Python/기타 공부 (22)
노는게 제일 좋습니다.
SummaryWrong: lbl.text = "PLUG"Right : lbl.config(text = "PLUG") You have code.from tkinter import *master = Tk()lbl = Label(master, text="studioPLUG") lbl.pack() If you want to modify options of a widget ("studioPLUG" --> "PLUG") , you could see message like below. lbl.text = "PLUG">> Traceback (most recent call last): File "", line 1, in lbl.text AttributeError: 'Label' object has no attribute..
random 모듈 import 필요. random.random()0
reference http://effbot.org/tkinterbook/entry.htm#Tkinter.Entry.insert-method Entry has index. Index specify position. You can use index to access data in Entry.Example) ABCDEindex 2 means hear.(between A and B) AB CDE In webpage http://effbot.org/tkinterbook/entry.htm#Tkinter.Entry.insert-method , index is being said. IndexesThe Entry widget allows you to specify character positions in a number..
http://robotic-controls.com/learn/python-guis/basics-tkinter-gui That webpage explains FrameLabelEntryButtonCanvasText
Reference http://stackoverflow.com/questions/6582387/image-resize-under-photoimage Example from tkinter import * master = Tk()src_img = PhotoImage(file ='test.gif').subsample(20) image = Label(master, image = src_img)image.grid(row=0, column=2, columnspan=2, rowspan=2,sticky=N+S+W+E)
If you write code like this, error occurs.[code]img = PhotoImage(file ='test.gif')img.grid(row=0, column=0) [error] AttributeError: 'PhotoImage' object has no attribute 'grid' image.grid(row=0, column=0) File "C:\Users\studioplug\Desktop\aa.py", line 28, in Traceback (most recent call last): According my trying, PhotoImage object should be used by attribute of Label.src_img = PhotoImage(file ='t..
original document http://effbot.org/tkinterbook/grid.htm 정확한 내용 파악은 같이 쓰여져있는 원문을 통해 하시길 바랍니다. 이 내용을 바탕으로 작성한 동작하는 코드. from tkinter import * master = Tk() #위젯 정의하기 label1 =Label(master, text="First") label2 = Label(master, text="Second") entry1 = Entry(master) entry2 = Entry(master) checkbutton = Checkbutton(master,text="check") button1 = Button(master, text="A") button2 = Button(master, text="B"..
참고자료 http://pythonstudy.xyz/python/article/109-Tkinter-%EC%86%8C%EA%B0%9C tcl : 언어의 한 종류. https://ko.wikipedia.org/wiki/Tcltk : 플랫폼 독립적인 GUI라이브러리 ( 출처 위키백과 )묶어서 tcl/tk라고 한다. http://www.tcl.tk/ tkinter : Tkinter is Python's de-facto standard GUI (Graphical User Interface) package. It is a thin object-oriented layer on top of Tcl/Tk. Tkinter is not the only GuiProgramming toolkit for Python. It is..