473,394 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Help with Tkinter and stdin input event binding

Hello,

I'm fairly used to working with Python but it's the first time I'm
trying to use Tkinter so I'm running into a problem.

I'm using three python scripts with Tkinter GUIs and a fourth script
that basically opens communication pipes with the three others. The idea
is that the fourth script works as a communication intermediary between
the others. The problem is that I can't make the Tkinter GUIs respond to
stdin events because the toplevel mainloop isn't under my control, I
have no idea how to do this.

Here's the main idea simplified.

Script 1 is a Tkinter GUI.
Script 2 uses os.forkpty() to get the child's pseudo-terminal descriptor.

Now if in Script 1 I use <print "Here I Am!"I can get that input in
Script 2 using simply the os.read() method on the pseudo-terminal
descriptor. The problem is that when I use os.write() on that
descriptor, there's no way I can get the input on Script 1 because I
have no control whatsoever of the program's main loop. Is there any way
around this, either by adding some sort of stdin input event binding or
something similar?

Thanks in advance
Sep 25 '06 #1
0 1316

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rodrigo Benenson | last post by:
Hi, I have a weird need in tkinter. If I have a widget I can *set* a binding ..bind("<the event>", the_callback) I also can *append* a binding ..bind("<the event>", the_second_callback,...
6
by: Elaine Jackson | last post by:
I've got a script where a button gets pushed over and over: to cut down on the carpal tunnel syndrome I'd like to have the button respond to presses of the Enter key as well as mouse clicks; can...
8
by: Harlin Seritt | last post by:
I have the following script. Two widgets call the same function. How can I tell inside of the called function which button called it?: def say_hello(): print 'hello!' print widget root =...
9
by: Tuvas | last post by:
I am building a tkinter program. A part of this program is to read data from an incoming interface, and depending on the data, will display a bit of text on the tk dialog, it decodes this data, so...
1
by: Tuvas | last post by:
I am trying to execute a function with a tkinter event binding double click. With 2 mouse clicks done quickly, the function should happen, otherwise, it should not. However, I am noticing that the...
8
by: Jay | last post by:
I'm having a problem using lambda to use a command with an argument for a button in Tkinter. buttons = range(5) for x in xrange(5): buttons = Button(frame, text=str(x+1), command=lambda:...
2
by: Kevin Walzer | last post by:
I'm porting a Tkinter application to wxPython and had a question about wxPython's event loop. The Tkinter app provides a GUI to a command-line tool. It gathers user input, and opens an...
4
by: Davy | last post by:
Hi all, I have written a simple Tkinter program, that is draw a rectangle in a canvas, when I press Up key, the rectangle move up. But the program seems work not properly? My environment is...
5
by: jamitwidme | last post by:
Is there any way to type into a Tkinter frame window? I want to use raw_input() within a Tkinter frame.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.