Graphic
-
Python/Graphical User Interfaces with Tk코딩/Python 2024. 7. 29. 09:54
Graphical User Interfaces with Tk이 문서는 Graphical User Interfaces with Tk를 번역한 것이다.이 번역본은 완전한 번역이 아니며, 영문을 읽는데 소요되는 시간을 절약하기 위해 작성되었다.번역본의 어색한 해석을 이해할 수 있도록 영문도 함께 배열한다.마크다운 문서를 html로 자동변환하면서 몇몇 기호는 누락될 수 있다. 어색한 기호표현이 나타난다면 원본을 참고해야 한다.영문은 회색으로 표시하는데, 티스토리 블로그 시스템의 문제로 리스트는 회색으로 처리되지 않는다.Tk/Tcl has long been an integral part of Python. It provides a robust and platform independent windowing tool..
-
[Python/Turtle] 7. Help and configuration, Turtledemo코딩/Python 2022. 12. 20. 01:22
Help and configuration How to use help Screen 및 Turtle 클래스의 공개 메서드는 docstring을 통해 광범위하게 문서화. 따라서 Python 도움말 기능을 통해 온라인 도움말로 사용. IDLE을 사용하는 경우 툴팁에 함수/메서드 호출에 입력된 docstring의 서명과 첫 번째 줄이 표시. 메서드 또는 함수에서 help()를 호출하면 docstring이 표시. help(Screen.bgcolor) Help on method bgcolor in module turtle: bgcolor(self, *args) unbound turtle.Screen method Set or return backgroundcolor of the TurtleScreen. Argumen..
-
[Python/Turtle] 6. Public classes코딩/Python 2022. 12. 20. 01:20
빨리가기 RawTurtle / Turtle / TurtleScreen / Screen / ScrolledCanvas / Shape / addcomponent / Vec2D Public classes class turtle.RawTurtle(canvas) / class turtle.RawPen(canvas) canvas – a tkinter.Canvas, a ScrolledCanvas or a TurtleScreen 거북이를 만든다. 거북이는 위에서 "Turtle/RawTurtle의 메서드"로 설명한 모든 메서드를 가지고 있다. class turtle.Turtle RawTurtle의 하위 클래스는 동일한 인터페이스를 갖지만 처음 필요할 때 자동으로 생성된 기본 Screen 개체를 그린다. class tur..
-
[Python/Turtle] 5. Methods of TurtleScreen/Screen and corresponding functions코딩/Python 2022. 12. 20. 01:18
bgcolor / bgpic / clear / clearscreen / reset / resetscreen / screensize / setworldcoordinates / delay / tracer / update / listen / onkey / onkeypress / onclick / ontimer / mainloop / textinput / numinput / mode / colormode / getcanvas / getshapes / register_shape / turtles / window_height / window_width / bye / exitonclick / setup / title Methods of TurtleScreen/Screen and corresponding functio..
-
[Python/Turtle] 4. Methods/Color control, Filling코딩/Python 2022. 12. 19. 21:55
빨리가기 pencolor() / fillcolor() / color() / filling() / begin_fill() / end_fill() Methods of RawTurtle/Turtle Color control turtle.pencolor(*args) 펜 색상을 반환하거나 설정 입력 포맷 pencolor() 현재 펜 색상을 색상 지정 문자열 또는 튜플로 반환 다른 color/pencolor/fillcolor 호출에 대한 입력으로 사용 pencolor(colorstring) pencolor를 "red", "yellow" 또는 "#33cc8c"와 같은 Tk 색상 사양 문자열인 colorstring으로 설정 pencolor((r, g, b)) pencolor를 r, g, b의 튜플로 표현되는 RGB 색..
-
[Python/Turtle] 3. Methods/Turtle state & Settings for measurement코딩/Python 2022. 12. 19. 21:36
빨리가기 position() / towards() / xcor() / ycor() / heading() / distance() / degrees() / radians() Methods of RawTurtle/Turtle Turtle's state turtle.position() / turtle.pos() 거북이의 현재 위치를 (x,y) (Vec2D vector)로 반환. turtle.pos() (440.00,-0.00)turtle.towards(x, y=None) x – a number or a pair/vector of numbers or a turtle instance y – a number if x is a number, else None 거북이 위치에서 (x,y)로 지정된 위치까지의 선, ..
-
[Python/Turtle] 2. Methods/Turtle motion, Pen control, More drawing control, Using events, Compound shapes코딩/Python 2022. 12. 19. 21:36
forward / back / right / left / goto;setpos;setposition / setx / sety / setheading;seth / home / circle / dot / stamp / clearstamp / clearstamps / undo / speed / pendown;pd;down / penup;pu;up / pensize / pen / isdown / reset / clear / write / onclick / onrelease / ondrag / begin_poly / end_poly / get_poly / clone / getturtle;getpen / getscreen / setundobuffer / undobufferentries / Compound shape..
-
[Python/Turtle] 1. 개요코딩/Python 2022. 12. 19. 21:36
Turtle from turtle import * color('red', 'yellow') begin_fill() while True: forward(200) left(170) if abs(pos()) < 1: break end_fill() done() 터틀은 위와 같은 그래픽을 그리게 해주는 라이브러리다. 원래는 아이들에게 코딩을 가르치기 위해 놀이용으로 개발됐다고 한다. tkinter를 기반으로 하므로 Tk를 지원하는 파이썬 버전을 사용해야 한다. TurtleScreen 클래스는 플레이그라운드인 그래팩 윈도우를 정의하는데, 이를 위해 tkinter.Canvas 또는 ScrolledCanvas가 인수로 필요하다. 터틀이 어떤 앱의 부분으로 사용되기 위해 필요하다. Screen() 함수는 TurtleSc..