[Tutor] Using Easygui in Python v3

Alan Gauld alan.gauld at btinternet.com
Thu Apr 9 12:50:12 CEST 2009


"Alan Gauld" <alan.gauld at btinternet.com> wrote 

> user input topic and on checking the web site it said Easygui was 
> compatible with Python v3. However after downloading  and installing 
> I get a "No module named StringIO" error under Python v3.

OK, Not much digging required.
StringIO has moved to io.StringIO in v3
So changing the version check code to:

if runningPython3:
   from tkinter import *
   import tkinter.filedialog as tk_FileDialog
   from io import StringIO
else:
   from Tkinter import *
   import tkFileDialog as tk_FileDialog
   import StringIO

and deleting the original import StringIO line seems to work...

If someone else could carry out a more exhaustive test than my 
basic EnterBox then  I'll notify the easygui team.

Alan G.



More information about the Tutor mailing list