473,385 Members | 1,356 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,385 software developers and data experts.

How to know when a folder is copied in Cygwin using Sendkeys

Using python (Python 2.5) I am invoking a cygwin session by the following code.

Expand|Select|Wrap|Line Numbers
  1. from win32com.client import *
  2.  
  3. a = Dispatch("Wscript.Shell")
  4.  
  5. a.Run("C:/cygwin/cygwin.bat");    
  6.  
The cygwin window is prompted open. Now in the cygwin shell, i issue the following command using "SendKeys"

Expand|Select|Wrap|Line Numbers
  1. a.SendKeys ("cp -r src_path dest_path"+ "{Enter}")     #copy src_path to dest_path
  2.  
Now i would like to prompt a dialog box "Copy Successful" once the entire folder is copied (using tkMessageBox).

How do i check that the entire folder is copied after issueing the command so that the dialog box is prompted?


Kindly help me in this regard.
Dec 12 '06 #1
1 1547
bartonc
6,596 Expert 4TB
I believe that the glob module is what you are looking for, though I have not used it.

11.7 glob -- Unix style pathname pattern expansion

The glob module finds all the pathnames matching a specified pattern according to the rules used by the Unix shell. No tilde expansion is done, but *, ?, and character ranges expressed with [] will be correctly matched. This is done by using the os.listdir() and fnmatch.fnmatch() functions in concert, and not by actually invoking a subshell. (For tilde and shell variable expansion, use os.path.expanduser() and os.path.expandvars().)


glob( pathname)

Return a possibly-empty list of path names that match pathname, which must be a string containing a path specification. pathname can be either absolute (like /usr/src/Python-1.5/Makefile) or relative (like ../../Tools/*/*.gif), and can contain shell-style wildcards. Broken symlinks are included in the results (as in the shell).

iglob( pathname)

Return an iterator which yields the same values as glob() without actually storing them all simultaneously. New in version 2.5.
Dec 12 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Joonas Paalasmaa | last post by:
Hi, When compiling Sketch's streamfilter C extension the errors below are raised during linking. What could cause the errors? (Python 2.3, MinGw 1.1 with GCC 2.95.3-6, Windows 98) Here are...
0
by: dw | last post by:
Pehaba, does anyone knows how to install MySQLdb on cygwin? - test device: MySQLdb 0.9.2.0 targz + cygwin 1.5.7-cr-0x9e + python 2.3.3 on cygwin + mysql 4.0.17 win32 - modified setup.py's...
2
by: Eric Woudenberg | last post by:
I just installed a Python 2.3.4 Windows binary on a friend's WinXP machine (because the latest Cygwin-provided Python 2.3 build leaves out the winsound module for some reason). When I try and...
4
by: KB | last post by:
Hi, I want to write a Python script that controls and automates a Windows GUI computation program. My problem is that I do not know how to quit the Windows GUI program gracefully with a...
2
by: Johann Blake | last post by:
I can hardly believe I'm the first one to report this, but having gone through the newsgroup, it appears that way. I would like to open a solution in the VS.NET IDE that consists of multiple...
6
by: Ana | last post by:
Hi! I have problems with the following scenario: My application is developed using C# under .NET. It must run on all Windows versions starting from Windows 98. The user must open different...
4
by: davermcl | last post by:
Hi, I'm experiencing a problem when using the VB SendKeys method. I'm sending characters to a textbox in another application. It works fine when the Windows Input Languages on both apps are...
2
by: bkunjitam | last post by:
I am invoking a cygwin session by the following code from win32com.client import * a = Dispatch("Wscript.Shell") a.Run("C:/cygwin/cygwin.bat"); a.SendKeys ("cd D:/temp/code" +...
0
by: jairathore | last post by:
Hi, I m working on a project on which my requirment is like that remotely i control another application by using sendkey.sendwait method, i m sending some keystroke to that application and...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.