Python's Tkinter simpledialog.askstring not working from command prompt
Question: > **Possible Duplicate:**  
>  [Script works in IDLE, but .py-file doesn't
> work](http://stackoverflow.com/questions/8319022/script-works-in-idle-but-
> py-file-doesnt-work)

So i wrote a gui in python's tkinter using python 3.2.2's IDLE. When i run the
program from the IDLE in interative mode everything works just fine but when i
run it by double clicking on it or from the command prompt it produces an
error and doesnt start the program. i know the problem is with this line:

    
    
    path_da=self.simdia.askstring("Path to start","Paths must be relative!")
    

i have imported all from tkinter. path_da is suposed to be the string from the
askstring dialog. i set simdia to simpledialog as a public variable in my
class. I just don't understand why this works when running it using F5 in IDLE
but not from the command prompt


Answer: I flagged this as a dupe since the error received for using
`simpledialog.askstring` without importing `simpledialog` from the `tkinter`
module, is the same error you would get if just `simpledialog` was being used.
If it's not considered a duplicate, here is the answer:

Quoting [Roger's answer](http://stackoverflow.com/a/8353233/404469) to a
similar question:

> IDLE uses Tkinter as its graphical environment. It is possible that your
> code is relying on a side effect of an import by IDLE itself. This is
> especially true if you use IDLE without a subprocess.
>
> The simpledialog module does not import when using
    
    
    from tkinter import*
    

Try adding this to your code:

    
    
    import tkinter.simpledialog as simpledialog
    

