[python-win32] Process creation hang up - Part 2

Mark Hammond mhammond@skippinet.com.au
Fri, 20 Dec 2002 17:15:10 +1100


This is a multi-part message in MIME format.

------=_NextPart_000_005B_01C2A84B.5ACD4210
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

It sounds like your Python app needs to be running the message pump (maybe
as it is the "parent" of a DDE hosted app) - as soon as your Python script
displays a UI (and therefore starts a loop) everything springs to life, so
this sounds like the problem.

First try a "busy" wait loop - ie:

while 1:
  win32gui.PumpWaitingMessages()
  # check for result.txt, but dont wait
  if check():
    break

If that works, you can then work on a more efficient wait loop.

Mark.
  -----Original Message-----
  From: python-win32-admin@python.org
[mailto:python-win32-admin@python.org]On Behalf Of Bill Taylor
  Sent: Friday, 20 December 2002 7:09 AM
  To: 'python-win32@python.org'
  Subject: [python-win32] Process creation hang up - Part 2


  I failed to give the complete scenario on this and also make clear a few
other things.

  1. This all begins with an MFC app launching my python scripts.  So,
again, the complete progression is:
  MFC app launches python scripts
  python scripts call program.exe
  program.exe calls login.exe
  login.exe presents login window to user
  user enters login info
  program.exe hangs
  python scripts timeout waiting for program.exe to write result.txt; python
scripts present message window to user.
  program.exe "un-hangs"; writes result.txt

  2. Program.exe and login.exe are third party apps in which I do not have
access to that code.  When program.exe is run as a stand alone app, it works
fine, creating result.txt.

  Sorry for the omissions - thanks again for your suggestions.

  Bill
  -----Original Message-----
  From: Bill Taylor
  Sent: Wednesday, December 18, 2002 2:21 PM
  To: 'python-win32@python.org'
  Subject: Process creation hang up


  Hi all,

  Sorry this is lengthy and wordy... but does anyone have experience with
process creation?  I’m having problems with my child process hanging.  Could
be I’m a rookie (I am) missing the boat on something simple… or I’m just an
idiot… or both (likely) :)

  Here’s my scenario:
  I need to call an executable within my Python code – let’s call this
program.exe.  Program.exe in turn calls a login executable – let’s call this
login.exe.  Program.exe calls login.exe opening a DDE channel.  Login.exe
presents a login window to a user.  The user enters user ID and password and
then program.exe logs into a server database.  Once connected, program.exe
gathers database information and writes it to a text file named result.txt
back on the calling machine.

  Here’s my problem:
  When I use win32api.WinExec(programPathName), program.exe is called,
login.exe is called, login window is presented to the user, user enters
login information, and then program.exe hangs.  Immediately after calling
program.exe, my code goes into a time.sleep loop looking for result.exe.
When result.exe is not found within a specified time, I present a message to
the user to terminate.  As soon as this message is presented, program.exe
“un-hangs” and completes execution, writing result.txt to the calling
machine.  So, it appears my code has some sort of lock on the processor
(possibly my time.sleep loop) preventing program.exe from processing.  Any
clues on this?

  Also, I’ve tried the os.spawn functions, win32api.ShellExecute, and
win32process.CreateProcess with several different parameter settings on each
and I get similar behavior except with all of these I don't get as far as
with WinExec in that login.exe’s login window never even displays.  Here’s
my basic calls:

  Spawnl
  ==================================================
  os.spawnl(os.P_WAIT, programPathName)
  ==================================================

  ShellExecute
  ==================================================
  win32api.ShellExecute(0, None, programPathName, "", programPath, 1)
  ==================================================

  CreateProcess
  ==================================================
  si = win32process.STARTUPINFO()
  win32process.CreateProcess(None, # module
                                             programPathName, #command line
                                             None, #process security
attributes
                                             None, #thread security
attributes
                                             0, #handle inheritance flag
                                             win32con.NORMAL_PRIORITY_CLASS,
#creation flags
                                             None, # process new environment
setting
                                             programPath, #start directory
                                             si) #STARTUPINFO object
specifying window appearance
  ==================================================

  wait loop
  ==================================================
  while not os.path.exists(fileName) and wait < maxWait:
          wait += 1
          time.sleep(1)

          if wait >= maxWait:
              #Timeout error
              message = "Cannot find file " + fileName + "\nDo you want to
continue searching?"
              ret = DisplayMessageBox(message, "File Search Timeout
Message", "YESNO")
              if ret == 1:
                  wait = 0
              else:
                  #terminate
  ==================================================

  Any suggestions/help are/is much appreciated!
  Thanks in advance folks,

  Bill Taylor

------=_NextPart_000_005B_01C2A84B.5ACD4210
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">


<META content=3D"MSHTML 6.00.2800.1126" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D156591106-20122002><FONT face=3DArial color=3D#0000ff =
size=3D2>It=20
sounds like your Python app needs to be running the message pump (maybe =
as it is=20
the "parent" of a DDE hosted app) - as soon as your Python script =
displays a UI=20
(and therefore starts a loop) everything springs to life, so this sounds =
like=20
the problem.</FONT></SPAN></DIV>
<DIV><SPAN class=3D156591106-20122002><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D156591106-20122002><FONT face=3DArial color=3D#0000ff =
size=3D2>First=20
try a "busy" wait loop - ie:</FONT></SPAN></DIV>
<DIV><SPAN class=3D156591106-20122002><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D156591106-20122002><FONT face=3DArial color=3D#0000ff =
size=3D2>while=20
1:</FONT></SPAN></DIV>
<DIV><SPAN class=3D156591106-20122002><FONT face=3DArial color=3D#0000ff =
size=3D2>&nbsp;=20
win32gui.PumpWaitingMessages()</FONT></SPAN></DIV>
<DIV><SPAN class=3D156591106-20122002><FONT face=3DArial color=3D#0000ff =
size=3D2>&nbsp;=20
# check for result.txt, but dont wait</FONT></SPAN></DIV>
<DIV><SPAN class=3D156591106-20122002><FONT face=3DArial color=3D#0000ff =
size=3D2>&nbsp;=20
if check():</FONT></SPAN></DIV>
<DIV><SPAN class=3D156591106-20122002><FONT face=3DArial color=3D#0000ff =

size=3D2>&nbsp;&nbsp;&nbsp; break</FONT></SPAN></DIV>
<DIV><SPAN class=3D156591106-20122002><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D156591106-20122002><FONT face=3DArial color=3D#0000ff =
size=3D2>If=20
that works, you can then work on a more efficient wait =
loop.</FONT></SPAN></DIV>
<DIV><SPAN class=3D156591106-20122002><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D156591106-20122002><FONT face=3DArial color=3D#0000ff =

size=3D2>Mark.</FONT></SPAN></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid; MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B>=20
  python-win32-admin@python.org =
[mailto:python-win32-admin@python.org]<B>On=20
  Behalf Of </B>Bill Taylor<BR><B>Sent:</B> Friday, 20 December 2002 =
7:09=20
  AM<BR><B>To:</B> 'python-win32@python.org'<BR><B>Subject:</B> =
[python-win32]=20
  Process creation hang up - Part 2<BR><BR></FONT></DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D237115219-19122002>I=20
  failed to give the complete scenario on this and also make clear a few =
other=20
  things.</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
  class=3D237115219-19122002></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D237115219-19122002>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D237115219-19122002>1.=20
  This all begins with an MFC app&nbsp;launching my python =
scripts.&nbsp; So,=20
  again, the complete progression =
is:</SPAN></FONT></DIV></SPAN></FONT></DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D237115219-19122002>MFC=20
  app&nbsp;launches python scripts</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
  class=3D237115219-19122002>python scripts call =
program.exe</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
  class=3D237115219-19122002>program.exe calls =
login.exe</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
  class=3D237115219-19122002>login.exe presents login window to=20
  user</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D237115219-19122002>user=20
  enters login info</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
  class=3D237115219-19122002>program.exe hangs</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
  class=3D237115219-19122002>python scripts timeout waiting for =
program.exe to=20
  write result.txt; python scripts present message window to=20
  user.</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
  class=3D237115219-19122002>program.exe "un-hangs"; writes=20
  result.txt</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
  class=3D237115219-19122002></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
  class=3D237115219-19122002><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
  class=3D237115219-19122002>2. Program.exe and login.exe are third =
party apps in=20
  which I do not have access to that code.&nbsp; When program.exe is run =
as a=20
  stand alone app, it works fine, creating=20
  result.txt.</SPAN></FONT></SPAN></FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
  class=3D237115219-19122002>Sorry for the omissions - thanks again for =
your=20
  suggestions.</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
  class=3D237115219-19122002></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
  class=3D237115219-19122002>Bill</SPAN></FONT></DIV>
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B> Bill Taylor =
<BR><B>Sent:</B>=20
  Wednesday, December 18, 2002 2:21 PM<BR><B>To:</B>=20
  'python-win32@python.org'<BR><B>Subject:</B> Process creation hang=20
  up<BR><BR></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN class=3D472114621-18122002>Hi=20
  all,</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D472114621-18122002></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN =
class=3D472114621-18122002>Sorry this is=20
  lengthy and wordy... but does anyone have experience with process=20
  creation?<SPAN style=3D"mso-spacerun: yes">&nbsp; </SPAN>I'm having =
problems=20
  with my child process hanging.<SPAN style=3D"mso-spacerun: yes">&nbsp; =

  </SPAN>Could be I'm a rookie (I am) missing the boat on something =
simple... or=20
  I'm just an idiot... or both (likely) :)</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D472114621-18122002></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN =
class=3D472114621-18122002>Here's my=20
  scenario:</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN class=3D472114621-18122002>I =
need to call an=20
  executable within my Python code - let's call this program.exe.<SPAN=20
  style=3D"mso-spacerun: yes">&nbsp; </SPAN>Program.exe in turn calls a =
login=20
  executable - let's call this login.exe.<SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
  </SPAN>Program.exe calls login.exe opening a DDE channel.<SPAN=20
  style=3D"mso-spacerun: yes">&nbsp; </SPAN>Login.exe presents a login =
window to a=20
  user.<SPAN style=3D"mso-spacerun: yes">&nbsp; </SPAN>The user enters =
user ID and=20
  password and then program.exe logs into a server database.<SPAN=20
  style=3D"mso-spacerun: yes">&nbsp; </SPAN>Once connected, program.exe =
gathers=20
  database information and writes it to a text file named result.txt =
back on the=20
  calling machine.</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D472114621-18122002></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN =
class=3D472114621-18122002>Here's my=20
  problem:</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN class=3D472114621-18122002>When =
I use=20
  win32api.WinExec(programPathName), program.exe is called, login.exe is =
called,=20
  login window is presented to the user, user enters login information, =
and then=20
  program.exe hangs.<SPAN style=3D"mso-spacerun: yes">&nbsp; =
</SPAN>Immediately=20
  after calling program.exe, my code goes into a time.sleep loop looking =
for=20
  result.exe.<SPAN style=3D"mso-spacerun: yes">&nbsp; </SPAN>When =
result.exe is=20
  not found within a specified time, I present a message to the user to=20
  terminate.<SPAN style=3D"mso-spacerun: yes">&nbsp; </SPAN>As soon as =
this=20
  message is presented, program.exe "un-hangs" and completes execution, =
writing=20
  result.txt to the calling machine.<SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
  </SPAN>So, it appears my code has some sort of lock on the processor =
(possibly=20
  my time.sleep loop) preventing program.exe from processing.<SPAN=20
  style=3D"mso-spacerun: yes">&nbsp; </SPAN>Any clues on =
this?</SPAN></FONT><FONT=20
  face=3DArial size=3D2><SPAN =
class=3D472114621-18122002></SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D472114621-18122002></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN =
class=3D472114621-18122002>Also, I've tried=20
  the os.spawn functions, win32api.ShellExecute, and =
win32process.CreateProcess=20
  with several different parameter settings on each and I get similar =
behavior=20
  except with all of these I don't get as far as with WinExec in that=20
  login.exe's login window never even displays.<SPAN=20
  style=3D"mso-spacerun: yes">&nbsp; </SPAN>Here's my basic=20
  calls:</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D472114621-18122002></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D472114621-18122002>Spawnl</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  =
class=3D472114621-18122002>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D472114621-18122002>os.spawnl(os.P_WAIT,=20
  programPathName)</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  =
class=3D472114621-18122002>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D472114621-18122002></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D472114621-18122002>ShellExecute</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  =
class=3D472114621-18122002>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D472114621-18122002>win32api.ShellExecute(0, None, =
programPathName, "",=20
  programPath, 1)</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  =
class=3D472114621-18122002>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D472114621-18122002></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D472114621-18122002>CreateProcess</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  =
class=3D472114621-18122002>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN class=3D472114621-18122002>si =
=3D=20
  win32process.STARTUPINFO()</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D472114621-18122002>win32process.CreateProcess(None, #=20
  module</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  =
class=3D472114621-18122002>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  programPathName, #command line</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  =
class=3D472114621-18122002>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  None, #process security attributes</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  =
class=3D472114621-18122002>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  None, #thread security attributes</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  =
class=3D472114621-18122002>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  0, #handle inheritance flag</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  =
class=3D472114621-18122002>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  win32con.NORMAL_PRIORITY_CLASS, #creation flags</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  =
class=3D472114621-18122002>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  None, # process new environment setting</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  =
class=3D472114621-18122002>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  programPath, #start directory</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  =
class=3D472114621-18122002>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  si) #STARTUPINFO object specifying window =
appearance</SPAN></FONT></DIV>
  <DIV><SPAN class=3D472114621-18122002><FONT face=3DArial=20
  =
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D</FONT></SPAN></DIV>
  <DIV><SPAN class=3D472114621-18122002></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D472114621-18122002><FONT face=3DArial size=3D2>wait =

  loop</FONT></SPAN></DIV>
  <DIV><SPAN class=3D472114621-18122002><FONT face=3DArial=20
  =
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D</FONT></SPAN></DIV>
  <DIV><SPAN class=3D472114621-18122002><FONT face=3DArial =
size=3D2>while not=20
  os.path.exists(fileName) and wait &lt;=20
  maxWait:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wait +=3D=20
  1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  =
time.sleep(1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  if wait &gt;=3D=20
  =
maxWait:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
  #Timeout=20
  =
error<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
  message =3D "Cannot find file " + fileName + "\nDo you want to =
continue=20
  =
searching?"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;=20
  ret =3D DisplayMessageBox(message, "File Search Timeout Message",=20
  =
"YESNO")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
  if ret =3D=3D=20
  =
1:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;=20
  wait =3D =
0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  else:</FONT></SPAN></DIV>
  <DIV><SPAN class=3D472114621-18122002><FONT face=3DArial=20
  =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;=20
  #terminate</FONT></SPAN></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  =
class=3D472114621-18122002>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D</SPAN></FONT></DIV>
  <DIV><SPAN class=3D472114621-18122002><FONT face=3DArial=20
  size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D472114621-18122002><FONT face=3DArial size=3D2>Any=20
  suggestions/help are/is much appreciated!</FONT></DIV>
  <P class=3DMsoNormal><FONT size=3D2><FONT face=3DArial>Thanks in =
advance folks<SPAN=20
  class=3D472114621-18122002>,</SPAN></FONT></FONT></P>
  <P class=3DMsoNormal><FONT size=3D2><FONT face=3DArial><SPAN=20
  class=3D472114621-18122002>Bill=20
Taylor</SPAN></FONT></FONT></P></BLOCKQUOTE></SPAN></BODY></HTML>

------=_NextPart_000_005B_01C2A84B.5ACD4210--