Python-list Digest, Vol 81, Issue 63

madhuri vio madhuri.vio at gmail.com
Wed Jun 9 02:58:36 EDT 2010


:

> import tkinter
>
> root = tkinter.Tk() #initialize tkinter and get a top level instance
> root.title("madhuri is a python")
> canvas = tkinter.Canvas(root) #creating the canvas under the root
> canvas.pack() #to call the packer geometry
> canvas.create_rectangle(20,10,120,80,fill=colors[0])
> root.close()
> tk.destroy()
>
>
> this is the program i have written and i am unable to execute it as i
> get an attribute error like this...
>
> $ python tkinter.py
> Traceback (most recent call last):
>   File "tkinter.py", line 4, in <module>
>     import tkinter
>   File "/home/manoj/tkinter.py", line 6, in <module>
>     root = tkinter.tk() #initialize tkinter and get a top level instance
> AttributeError: 'module' object has no attribute 'tk'
>
> where is the mistake and what do i do ???its a ll urgent
>
>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100609/10ab5e93/attachment-0001.html>


More information about the Python-list mailing list