import turtle # Create a screen screen = turtle.Screen() # Set the screen size and background color screen.setup(500, 500) screen.bgcolor("white") # Add a title to the screen screen.title("My Turtle Program") # Run the screen screen.mainloop()
import turtle # Create a screen screen = turtle.Screen() # Set the screen size and background image screen.setup(800, 600) screen.bgpic("background.jpg") # Run the screen screen.mainloop()In this example, we create a screen and set the size to 800x600 pixels. We then set the background image using the bgpic() method and providing the filename "background.jpg". Finally, we run the screen using the mainloop() method. Overall, Python Turtle is a powerful graphics library that allows you to create stunning images and animations. The screen setup examples above should give you an idea of how easy it is to use this library for your projects.