473,785 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Running user scripts in a Tkinter app?

I have a Python/Tkinter remote control application and want to add
support for running user scripts.

I would like the scripts to be written in python, would like them to be
able to update Tkinter widgets and (the hard part) would also like them
to be capable of pausing until some condition is met (e.g. a remote
control command finishes) without hanging the event loop.

I plan to add a library of routines to send commands and wait for
specific replies. For example:
- call(cmd) sends a command string to the remote host and returns a
"command object" that keeps track of the state of the command
- waitcmd(cmd_obj ) pauses the script (but not the overall application)
until cmd_obj finishes or fails

I'm confused as to the best way to write the "waitcmd" function. It
seems like a good place to use threads, but my understanding is that
Tkinter is not thread safe.

The only solution I've thought of is to try to recreate the Tkinter main
loop within the wait function. Very crudely:

tkobj = Tkinter.Frame()

def waitcmd(cmd_obj ):
while not cmd_obj.isdone( ):
tkobj.update()

I think this will work, but am worried it will be much slower than the
usual Tkinter main event loop. If there was some way to start a new
Tkinter event loop (while the main loop is paused) and terminate this
new loop when the wait was finished, that'd be perfect.

Any suggestions? Would this be easier in some other GUI library?

-- Russell
Jul 18 '05 #1
0 1320

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

Similar topics

1
2098
by: wolf | last post by:
i have without any success tried hard to get python scripts running under apache on windows using fastcgi. it is totally unclear to me what role the adaption script http://alldunn.com/python/fcgi.py plays, or exactly what directives i have to use in which places. given the promises of fastcgi, its wide deployment and good standing, this is sort of, well, disappointing. can anyone substantially help here? my suspicion is that fcgi.py will...
11
5027
by: Maxim Kasimov | last post by:
Hi. Are there widely used and recommended Python libraries that will let me makes a portable text user interface? -- Best regards, Maxim
1
2026
by: chris.levis | last post by:
All: I have written a Python webapp under MS IIS 5.0 that does the following: -Does a CVS checkout of a particular bit of xml -Gets a list of valid cvs tags for that xml file -Based on user input via forms, modifies that xml -CVS checkin's that file To have correct permissions to run the cvs binaries and to write
3
1396
by: Jim Anderson | last post by:
I have just installed Fedora Core 3 on my pc. Python runs fine, but when I try to run tkinter the tkinter library is not found. I tried installing python 2.4.1 and could not get tkinter to run there either. When I look through the build directories for 2.4.1, I find a lib-tk, but I do not find anything for tcl. In past releases, my recollection is that tcl/tk were part of the release and that if TCL_LIBRARY and TK_LIBRARY environment...
17
4845
by: JStemper | last post by:
On one of my localhost sites I'm getting a message to run aspnet_regiis -c to correct some scripting issues. When I try to run the listed command I get another error: "You must have administrative rights on this machine in order to run this tool." I have verified that I have administrative rights on the box as my normal login. I have also logged in as the local administrator, tried the same thing and get the same message.
0
1714
by: paulhjwu | last post by:
Hi, I have problems running a couple of shell scripts from PHP. I found a similar posting, so I posted my question to the original author. But unfortunately the original author is not at the address anymore. Anyone can help with the problems highlghted below?
2
4877
by: Dave Hughes | last post by:
Just noticed something rather annoying after upgrading my test box (a Linux server running DB2 UDB v8 for LUW) to fixpak 11 (for reference it was previously on fixpak 7). In the past I've relied heavily on the ability to start multiple long-running SQL scripts in the background and have them all run in parallel. Unfortunately, it seems that somewhere between fixpak 7 and fixpak 11 something has been fixed / broken which prevents more...
2
2332
by: jim-on-linux | last post by:
py help, The file below will run as a stand alone file. It works fine as it is. But, when I call it from another module it locks my computer, The off switch is the only salvation. This module when run as a stand alone, it will
9
2469
by: Frank Potter | last post by:
I want to find a multithreaded downloading lib in python, can someone recommend one for me, please? Thanks~
0
9646
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9484
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10157
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9957
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7505
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5518
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.