Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > [newbie] struggling wth tkinter

Reply
Thread Tools

[newbie] struggling wth tkinter

 
 
Cousin Stanley
Guest
Posts: n/a
 
      12-08-2013

> ....
> This is what I get:
>
> Traceback (most recent call last):
> File "./feet2meters.py", line 2, in <module>
> from tkinter import *
> File "/home/jean/tkinter.py", line 2, in <module>
> import Tkinter as tk
> ImportError: No module named Tkinter
> ....


From your original post I only changed the she-bang line
from python to python3 ....

#!/usr/bin/env python3

and the import lines remained
as you originally posted
which are appropriate for python3 ....

from tkinter import *
from tkinter import ttk

The traceback above shows an import statement
that is different from the one you originally posted
which would be ok in python2 but not python3 ....

import Tkinter as tk


--
Stanley C. Kitching
Human Being
Phoenix, Arizona
 
Reply With Quote
 
 
 
 
Jean Dubois
Guest
Posts: n/a
 
      12-08-2013
Op zondag 8 december 2013 15:16:25 UTC+1 schreef Dave Angel:
> On Sat, 7 Dec 2013 23:45:06 -0800 (PST), Jean Dubois
>
> <(E-Mail Removed)> wrote:
>
> > This is what I get:

>
> > Traceback (most recent call last):

>
> > File "./feet2meters.py", line 2, in <module>

>
> > from tkinter import *

>
> > File "/home/jean/tkinter.py", line 2, in <module>

>
> > import Tkinter as tk

>
> > ImportError: No module named Tkinter

>
>
>
> Regardless of your other fixes, you should rename the bogus file:
>
>
>
> /home/jean/tkinter.py
>
>
>
> You very seldom want to have files that can shadow system modules.
>
>
>
> --
>
> DaveA


Thank you Dave, this made it work under python3 too. I also had to remove tkinter.pyc

kind regards,
jean
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie: Struggling again 'map' mosscliffe Python 6 05-27-2007 12:32 AM
Newbie struggling withwireless =?Utf-8?B?am9iYmVycw==?= Wireless Networking 3 07-13-2006 04:50 PM
Newbie struggling with function pointers larkmore@aol.com C Programming 8 05-17-2005 12:35 PM
Java Newbie struggling with threads Bob Dubery Java 10 06-11-2004 02:26 PM
Struggling wth new installation Lee Davison Computer Support 3 02-01-2004 11:11 PM



Advertisments