Hướng dẫn draw name in python - vẽ tên bằng python
Thư viện rùa Python cung cấp tất cả các công cụ và phương pháp để vẽ bất kỳ hình dạng, hình ảnh hoặc thiết kế nào với các lệnh khác nhau. Trong bài viết này, chúng tôi sẽ vẽ bảng chữ cái với Thư viện Rùa Python. Trước khi tiến hành, bạn phải đọc phần giới thiệu về lập trình rùa.Draw alphabets with python turtle library. Before proceeding you must read the introduction to turtle programming. Show
Nội phân chính
Vẽ thư A với rùa Python:Chúng ta có thể sử dụng các chức năng tích hợp rùa rùa như rùa.forward (), rùa.right (), rùa.left () hoặc rùa.goto (), v.v. để vẽ bất kỳ hình dạng nào. import turtle t=turtle.Turtle() t.penup() t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(65) t.forward(100) t.setpos(-30,50) t.right(50) t.forward(100) t.penup() t.setpos(-50,-10) t.right(65) t.pendown() t.backward(50)Thư a Vẽ thư B với rùa Python:#.....draw letter B with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(90) t.forward(200) t.penup() t.goto(-30,50) #centering in the screen #draw first curve t.pendown() t.right(-90) t.circle(-50,180) t.penup() t.goto(-30,-50) #centering in the screen #draw second curve t.pendown() t.right(180) t.circle(-50,180)Chữ cái B Vẽ thư C với rùa Python:#.....draw letter C with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(180) t.circle(50,180)Vẽ thư D với rùa Python: Vẽ thư D với rùa Python:#.....draw letter D with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(90) t.forward(200) t.penup() t.goto(-30,50) #centering in the screen #draw curves t.pendown() t.right(-90) t.circle(-100,180) Vẽ thư E với rùa Python:#.....draw letter E with python turtle........! import turtle t=turtle.Turtle() t.penup() t.setpos(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.forward(100) t.backward(100) t.right(90) t.forward(100) t.left(90) t.forward(100) t.backward(100) t.right(90) t.forward(100) t.left(90) t.forward(100)Vẽ thư F với rùa Python: Vẽ thư F với rùa Python:#.....draw letter F with python turtle........! import turtle t=turtle.Turtle() t.penup() t.setpos(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.forward(100) t.backward(100) t.right(90) t.forward(100) t.left(90) t.forward(100) t.backward(100) t.right(90) t.forward(100)Vẽ thư G với rùa Python: Vẽ thư G với rùa Python:#.....draw letter G with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(180) t.circle(50,180) t.left(90) t.forward(50) t.goto(-50,0) t.right(90) t.forward(50) t.right(90) t.forward(20)Vẽ thư H với rùa Python: Vẽ thư H với rùa Python:#.....draw letter H with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(90) t.forward(200) t.goto(-30,-50) t.goto(50,-50) t.goto(50,50) t.goto(50,-140)Vẽ thư I với rùa Python: Vẽ thư I với rùa Python:#.....draw letter I with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(90) t.forward(100)Vẽ thư j với rùa python: Vẽ thư j với rùa python:#.....draw letter J with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.forward(10) t.right(90) t.forward(150) t.circle(-50,180)Vẽ thư K với rùa Python: Vẽ thư K với rùa Python:#.....draw letter B with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(90) t.forward(200) t.penup() t.goto(-30,50) #centering in the screen #draw first curve t.pendown() t.right(-90) t.circle(-50,180) t.penup() t.goto(-30,-50) #centering in the screen #draw second curve t.pendown() t.right(180) t.circle(-50,180)0Vẽ thư L với rùa Python: Vẽ thư L với rùa Python:#.....draw letter B with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(90) t.forward(200) t.penup() t.goto(-30,50) #centering in the screen #draw first curve t.pendown() t.right(-90) t.circle(-50,180) t.penup() t.goto(-30,-50) #centering in the screen #draw second curve t.pendown() t.right(180) t.circle(-50,180)1 Vẽ thư m với rùa Python:#.....draw letter B with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(90) t.forward(200) t.penup() t.goto(-30,50) #centering in the screen #draw first curve t.pendown() t.right(-90) t.circle(-50,180) t.penup() t.goto(-30,-50) #centering in the screen #draw second curve t.pendown() t.right(180) t.circle(-50,180)2Vẽ thư n với rùa Python: Vẽ thư n với rùa Python:#.....draw letter B with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(90) t.forward(200) t.penup() t.goto(-30,50) #centering in the screen #draw first curve t.pendown() t.right(-90) t.circle(-50,180) t.penup() t.goto(-30,-50) #centering in the screen #draw second curve t.pendown() t.right(180) t.circle(-50,180)3Vẽ thư o với rùa Python: Vẽ thư o với rùa Python:#.....draw letter B with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(90) t.forward(200) t.penup() t.goto(-30,50) #centering in the screen #draw first curve t.pendown() t.right(-90) t.circle(-50,180) t.penup() t.goto(-30,-50) #centering in the screen #draw second curve t.pendown() t.right(180) t.circle(-50,180)4Vẽ thư P với rùa Python: Vẽ thư P với rùa Python:#.....draw letter B with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(90) t.forward(200) t.penup() t.goto(-30,50) #centering in the screen #draw first curve t.pendown() t.right(-90) t.circle(-50,180) t.penup() t.goto(-30,-50) #centering in the screen #draw second curve t.pendown() t.right(180) t.circle(-50,180)5Vẽ thư q với rùa Python: Vẽ thư q với rùa Python:#.....draw letter B with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(90) t.forward(200) t.penup() t.goto(-30,50) #centering in the screen #draw first curve t.pendown() t.right(-90) t.circle(-50,180) t.penup() t.goto(-30,-50) #centering in the screen #draw second curve t.pendown() t.right(180) t.circle(-50,180)6Vẽ thư r với rùa python: Vẽ thư r với rùa python:#.....draw letter B with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(90) t.forward(200) t.penup() t.goto(-30,50) #centering in the screen #draw first curve t.pendown() t.right(-90) t.circle(-50,180) t.penup() t.goto(-30,-50) #centering in the screen #draw second curve t.pendown() t.right(180) t.circle(-50,180)7Vẽ thư s với rùa Python: Vẽ thư s với rùa Python:#.....draw letter B with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(90) t.forward(200) t.penup() t.goto(-30,50) #centering in the screen #draw first curve t.pendown() t.right(-90) t.circle(-50,180) t.penup() t.goto(-30,-50) #centering in the screen #draw second curve t.pendown() t.right(180) t.circle(-50,180)7Vẽ thư T với rùa Python: Vẽ thư T với rùa Python:#.....draw letter B with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(90) t.forward(200) t.penup() t.goto(-30,50) #centering in the screen #draw first curve t.pendown() t.right(-90) t.circle(-50,180) t.penup() t.goto(-30,-50) #centering in the screen #draw second curve t.pendown() t.right(180) t.circle(-50,180)9 Vẽ thư u với rùa python:#.....draw letter C with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(180) t.circle(50,180)0Vẽ thư v với rùa Python: Vẽ thư v với rùa Python:#.....draw letter C with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(180) t.circle(50,180)1Vẽ thư w với rùa Python: Vẽ thư w với rùa Python:#.....draw letter C with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(180) t.circle(50,180)2Vẽ thư X với rùa Python: Vẽ thư X với rùa Python:#.....draw letter C with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(180) t.circle(50,180)3Vẽ thư y với rùa python: Vẽ thư y với rùa python:#.....draw letter C with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(180) t.circle(50,180)4Vẽ thư Z với rùa Python: Vẽ thư Z với rùa Python:#.....draw letter C with python turtle........! import turtle t=turtle.Turtle() t.penup() #draw straight line t.goto(-30,50) #centering in the screen t.pendown() t.pensize(10) t.pencolor("red") t.right(180) t.circle(50,180)5Làm thế nào để bạn viết thư trong Python? Bạn có thể sử dụng Python để vẽ không?. There's plethora of functions and programs to be coded using the turtle library in python. Let's learn to draw some of the basic shapes. Penup () làm gì trong Python?makes sure that the moving object that you've created does not draw anything on the window. So if you have a ball and you want it to move around and draw anything on the window, then you use the penup(). |