Python 199제] 파이썬 EXPRESS CHAPTER 9. 도전문제 p420
출처 : 반크_반크 20년 백서 참고풀이] from tkinter import * window = Tk() # 레이블 생성 Label(window, text="너 비",height=3, width=8).grid(row=0) Label(window, text="높 이",height=3, width=8).grid(row=1) # 엔트리 생성 e1 = Entry(window, width=15) e2 = Entry(window, width=15) e1.grid(row=0, column=1) e2.grid(row=1, column=1) # 이미지를 가진 레이블을 생성하여 2열과 2행에 걸쳐서 표시한다. photo = PhotoImage(file="saucer.png") label = Label(window, im..
2023. 7. 10.
Python 195제] 파이썬 EXPRESS CHAPTER 8. Programming 6 p402
출처 : 반크_반크 20년 백서 참고풀이] class Person: #인스턴스 변수 name, mobile, office, email를 가지는 생성자 함수 def __init__(self, n, m="01012341234", o="024251117", e="nextop@nextopedu.co.kr"): self.name=n self.mobile=m self.office=o self.email=e #Person의 정보를 문자열로 반환하는 함수 def __str__(self): Str="" Str="Person(Name=" + self.name + ", Mobile=" + self.mobile Str += ", Office=" + self.office + ", Email=" + self.email + ")"..
2023. 6. 12.
Python 193제] 파이썬 EXPRESS CHAPTER 8. Programming 4 p401
출처 : 반크_반크 20년 백서 참고풀이] class Rectangle: #매개 변수 x, y, w, h를 가지는 생성자 함수 def __init__(self, x, y, w, h): self.x=x self.y=y self.width=w self.height=h #사각형의 좌표와 크기를 문자열로 반환하는 함수 def __str__(self): Str="사각형의 좌측상단 좌표(x,y) : (" + str(self.x) + ", " + str(self.y) + ")" Str+="사각형의 너비와 높이 : (" + str(self.width) + ", " + str(self.height) + ")" return Str #각 속성의 설정자 함수들 def setX(self, x): self.x=x def setY..
2023. 5. 22.