excel - Python - Do Logical Comparisons with Different Text Encodings Make a Difference? -


i trying automate task of copying data excel application based on "tagname" column exists in both. i'm having python copy "tagname" , save variable each ("metertag" , "exceltag"). i've thrown tkmessagebox right before compare confirm values same (and are), if statement not being executed, else is. question is: python treat excel formatted text differently other copied texts? (how fix that?) otherwise else problem?

click(573,745) time.sleep(.3) click_hold(625,357) win32api.setcursorpos((571,357)) click_release(571,357) ctcopy() time.sleep(.3)  click(1116,264)  win32clipboard.openclipboard() metertag = win32clipboard.getclipboarddata() win32clipboard.closeclipboard()  time.sleep(.1) click(2295, 252) #top of tags excel  time.sleep(1) click(2295, 252) #top of tags excel time.sleep(1)  x in range (0,499): ctcopy() win32clipboard.openclipboard() exceltag = win32clipboard.getclipboarddata() win32clipboard.closeclipboard() time.sleep(.02)  metertag = str(metertag)     exceltag = str(exceltag) ts(metertag,exceltag)  if metertag == exceltag:   #<-- not true when know is!!?     time.sleep(.25)     press('left_arrow')     time.sleep(.25)     press('left_arrow')     ctcopy()     click(1005,747) #"enter reading" button updating reading     time.sleep(.75)     click(771,580)  #text box reading update     time.sleep(.05)     ctpaste()     time.sleep(.05)     time.sleep(.05)     click(913,580)  #"update now" button     #need case when pop-up occurs     break else:     press('down_arrow') 

i have answer!! whatever reason, copying excel using clipboard above adds "\n" - looked @ length of each - 1 8, other 10. did concatonation dummy letter each discover putting in new line!


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -