plotting arrow in python

r rt8396 at gmail.com
Sat Nov 21 21:01:53 EST 2009


On Nov 21, 7:36 pm, Lie Ryan <lie.1... at gmail.com> wrote:
(..snip..)
> If you want to avoid 3rd party modules, take a look at turtle and
> Tkinter in the standard library.

Just to add to Ryans words...
If you want to avoid 3rd party modules, take a look at turtle and the
Tkinter *Canvas* widget in the standard library. Here is an example.

#-- start code --#
try:
    import Tkinter as tk
except ImportError:
    import tkinter as tk #python 3+

app = tk.Tk()
canvas = tk.Canvas(app)
canvas.create_line(0,0, 50,50, arrow='last')
canvas.pack()
app.mainloop()
#-- end code --#

remove the try/except when you know which one to use. I just wanted to
make sure it ran out-the-box for you, have fun!



More information about the Python-list mailing list