How can I draw a point with Canvas in Tkinter?
<p>I want to draw a point in Tkinter,Now I'm using <code>Canvas</code> to make it,but I didn't find such method to draw a point in <code>Canvas</code> class.<code>Canvas</code> provides a method called <code>crete_line(x1,y1,x2,y2)</code>,so i tried to set <code>x1=x2,y1=y2</code> to draw a point, but it doesn't work.</p>

<p>So anyone can tell me how to make it,it will be better if use <code>Canvas</code> can make it,other solution will be also accepted.Thanks!</p>

<p>There is no method to directly put a point on <code>Canvas</code>. The method below shows points using <code>create_oval</code> method.</p>

<p>Try this:</p>

<pre><code>from Tkinter import *

canvas_width = 500
canvas_height = 150


def paint(event):
    python_green = "#476042"
    x1, y1 = (event.x - 1), (event.y - 1)
    x2, y2 = (event.x + 1), (event.y + 1)
    w.create_oval(x1, y1, x2, y2, fill=python_green)



master = Tk()
master.title("Points")
w = Canvas(master,
           width=canvas_width,
           height=canvas_height)
w.pack(expand=YES, fill=BOTH)
w.bind("&lt;B1-Motion&gt;", paint)

message = Label(master, text="Press and Drag the mouse to draw")
message.pack(side=BOTTOM)

mainloop()
</code></pre>

python canvas tkinter