목록Python (35)
노는게 제일 좋습니다.
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..
reference this post.http://snowple.tistory.com/270 Using python, we can declare two-dimensional array like this. a=[ [0 for i in range(10)] for j in range(10) ] a[1][3] = 1 a[6][2] = 1 a[9][8] = 1 num=0 while num
스프라이트와 사운드 로드까지 배웠다.도트 캐릭터를 주워오고 대충 동전도트를 찍어서 입혀봤다. http://studioplug.tistory.com/193 의 코드에 다음 줄들을 추가했다. 게임루프 밖에123456789101112playerImage= pygame.image.load('crt.png')playerImage = pygame.transform.scale(playerImage, (40,40))coinImage = pygame.image.load('myCoin.bmp')coinImage= pygame.transform.scale(coinImage, (20,20)) pygame.mixer.music.load('unity.mp3')pygame.mixer.music.play(-1,0.0) pickupS..
원코드 출처 http://inventwithpython.com/downloads/ 키입력을 추가함. 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101import pygame,sys,randomfrom pygame.locals import * pygame.init()mainClock = pygame.time.Clock() WINDOWWIDTH = 400WINDOWHEIGHT= 400 windowSurface =..