954,546 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Tkinter Windows - How not to destroy it?

My problem may be very simple.
I want to use a Tkinter window to show informations to the user, so that he could enter his answers to the Python Shell. The problem is that when the Tkinter Window appears, the Python Shell will no longer receive any command before I destroy the Tkinter Window.

This is very unconfortable, cause I would like the user to be able to answer with the proper informations under his eyes.

Can I do something, and What?

Thanks.

Lapinbriac
Newbie Poster
4 posts since May 2007
Reputation Points: 10
Solved Threads: 0
 

When you run your Tkinter program, you are running a Windows GUI program and the eventloop of that program will intercept all keyboard and mouse events.

Why can't you let the user enter the answers into a Text widget? It is very hard to mix console and windows programs.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

Thank you for your reply.
It is very hard, you say, but is it impossible?
DO you think we can't use the console while there is a Tkinter window opened?

Or is there a special way to open the window so as to keep the console responsive?

Lapinbriac
Newbie Poster
4 posts since May 2007
Reputation Points: 10
Solved Threads: 0
 
Thank you for your reply. It is very hard, you say, but is it impossible? DO you think we can't use the console while there is a Tkinter window opened? Or is there a special way to open the window so as to keep the console responsive?

You can use the module threading to run two programs side by side. However, I am not quite sure how these two programs would communicate with each other.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

I think vegaseat is right -- it's much easier to make your program self-contained in the GUI. You can still easily print to the console (for viewing later), or write information to a file.

I guess I just don't see what added functionality you are hoping to get from combining the GUI and the console...

aot
Junior Poster in Training
83 posts since Feb 2007
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You