win32ui CreateFileDialog SLOW (since the SP2 Windows XP patch?)

MsKitty KittyMCooper at gmail.com
Wed Apr 27 19:26:02 EDT 2005


My client is used to clicking on the script name on her PC and getting
a windows command line box which it runs in. Not fancy but did the job
until recently...

Now it can take up to 4 minutes for the file dialog box to appear. No
problems with speed in PythonWin, of course, but she is not used to
doing that. Any suggestions? Anyone know why it is so slow?

Here is the code snippet to open her input file (output goes in the
same directory so we have to get the directory path for that)

try:
	d=win32ui.CreateFileDialog(1)
	d.DoModal()
	inputpath=d.GetPathName()
	inputsplit=string.split(inputpath,"\\")
	inputdir = string.join(inputsplit[:-1],"\\")
	inputname=d.GetFileName()
	if printit:
		print "input file is ",inputname
	try:
		input = open(inputname,"r") # expects text to mark up
	except:
		print "Error opening input file",inputname
		if inputname:
			print "Invalid Input File ",inputname
			line = raw_input()
		sys.exit(2)

(there's another except later in the code ...)

Kitty
OpenSkyWebDesign.com




More information about the Python-list mailing list