简体   繁体   中英

Same Program Runs Fine when ran from IDLE but not when ran directly

I wrote a small Tkinter based GUI app on python. It worked fine when run with IDLE, but displays moduleError on running it directly. I am on windows. Running it directly means double-clicking the .py file. Here's the link to the code. I have the path to python appended in the PATH environment variable

http://codepad.org/ezxcpi7Y

And the error image:

错误

Why i am getting that error? Please help

You need to import tkinter.messagebox

IDLE(writen in tk) imports this module in tkinter (python not imports modules twice).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM