I am getting an error trying to open a window in python
I am using
from tkinter import *
Window = Tk()
Window2 = Tk()
Window.create_rectangle(0, 0, 100, 100) # border
Window2.create_rectangle(0, 0, 100, 100)
You have some basic typos / syntax errors in your code. But anyway...
A Tkinter window doesn't have
create_rectangle method. However, the Canvas widget does have that method; you can use it like this.
import tkinter as tk window = tk.Tk() canvas = tk.Canvas(window, width=100, height=100) canvas.pack() canvas.create_rectangle(1, 1, 99, 99, outline="blue", fill="white") tk.mainloop()