I just studied some Python basic knowledge for a few weeks. And I am a translator so I need to global search and edit Passolo files.
But I failed to search target words in binary mode with Python. Could anyone help to explain what's wrong?
Here is my script:
path=r'C:\Users\Edwin\Downloads\Temp'
targetfile=r'C:\Users\Edwin\Downloads\Temp\target.tbulic11'
key=input("Please entry search key: ").encode()
print(key)
content=open(targetfile, 'rb').readlines()
for line in content:
if key in line:
print("Found!!!!!!!!!!!!!!!")
else:
print("Bad luck!")