Need help installing Tkinter/tkdnd
Hi I am trying to install the tk drag and drop to python 2.4. I installed python to c:\python24 I downloaded tkdnd-1.0a2.tar.gz, and TkinterDnD-0.4.zip. After I unzipped tkdnd-1.0a2.tar.gz, I copied the lib directory to c:\python24\tcl, now in C:\Python24\tcl\lib\tkdnd I have; libtkdnd.dll pkgIndex.tcl tkDND_Utils.tcl. I then unzipped TkinterDnD-0.4.zip and copied the TkinterDnD folder to C:\Python24\Lib\site-packages. In this folder I have; TkinterDnD.py TkinterDnD.pyc __init__.py __init__.pyc now when I go to python I get this error: >>> from TkinterDnD import * >>> root = TkinterDnD.Tk() Traceback (most recent call last): File "", line 1, in ? File "C:\Python24\Lib\site-packages\TkinterDnD\TkinterDnD.py", line 352, in __init__ self.TkdndVersion = _require(self) File "C:\Python24\Lib\site-packages\TkinterDnD\TkinterDnD.py", line 333, in _require tkdndver = tkroot.tk.call('package', 'require', 'tkdnd') _tkinter.TclError: can't find package tkdnd Can someone explain what's going on? Thanks -- http://mail.python.org/mailman/listinfo/python-list
Running a python program during idle time only
Hi, I'm trying to create a program similar to that of Google's desktop that will crawl through the hard drive and index files. I have written the program and as of now I just put the thread to sleep for 1 second after indexing a couple of files. I'm wondering if anyone knows of a way that I could make so that the program will run at full speed only runs after the computer has been idle for a while. I've looked at the "nice" command but that's not exactly what I want. Let me know if it isn't clear what I explained above. Thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: Running a python program during idle time only
Thanks for all the replies. I did try using nice under windows. I created a java program that would just loop and print numbers on the screen. Even when I ran that simple program with nice, (lets call it program A) as soon as I started the program the cpu went all the way to 100% usage. Then when I ran another program that did the same thing (lets call it program B), program A halted to let B finish, then it started again. Nevertheless it still hogged all the cpu while I was using the computer. For my indexing program I just wrote a simple python program and called on the python os.walk() method to iterate through the drive and then it connects to a database to store some information. Then I wrote a simple interface to connect to the database to search for files using visual basic. Once everything is indexed it works fine, but it would be nice to have the program looping through and indexing the files all the time to account to file updates, deletes, and relocation, but without hurting the performance when I'm using the computer. So really what I am looking for is some way to have the program only start indexing and crawling through the hd after 5 minutes of no user interaction with the computer. I'm going to take a look at this CPU load possibility. But I'm afraid that this will work similarly to "nice" in which case it will let the program kick in when the CPU isn't being used heavily, but I might still be using the computer. thanks once again! -los -- http://mail.python.org/mailman/listinfo/python-list
Re: Running a python program during idle time only
Yes it should. The problem is that I notice a loss in performance when the program is running at 100% CPU. Even though it is nice, if you try to open up new applications, or switch between them, you notice your computer lagging a little bit. That's why even though I'm not using the cpu that much as I'm just reading my email, or browsing the web, I wouldn't necessarily want the indexing program to be running at full pace. If you use google's desktop program, you'll notice that once the computer has been idle for a few minutes your CPU will go to 100%, but as soon as you move your mouse, or hit a keystroke the cpu will drop to 5-10% usage. That's the behavior I'm trying to achieve. Thanks David for your suggestions. That seems to be what I was looking for. I'm going to try to incorporate those changes in my code and see what I can come up with. Thanks for everyone who responded as well. I really appreciate it. -los -- http://mail.python.org/mailman/listinfo/python-list
Re: Running a python program during idle time only
I'm writting the code with the win32 module I found. The way I'm planning on attacking the problem after reading all the remarks is as follows: 1.) have the program run a full system index, and once it completes it turn the flag on a configuration file to true 2.) after this initial index, every time the program is started it will check this flag in the configuration file, and if it has had the full system index then the system will be kept up to date using the win32 modules, listening for events and changes made to the file system. I am basing my code pretty closely to what I found in the last example of this page http://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_for_changes.html I'm aware that in case the program isn't running, all the changes made to the file system during that time won't be picked up next time the program starts. I haven't thought of a good way to solve this problem other than just do a full system index every once in a while to actually go through each directory updating and deleting records as necessary. Thanks once again for the posts! -los -- http://mail.python.org/mailman/listinfo/python-list