Hi all
I'm trying to find my way in Python scripting.
I got some code from a LQ user, and i want to build on it.
I got this:
Code:
fh = open("file.txt")
for line in fh:
if 'test' in line:
print (line)
fh.close()
So it opens a file and searches for a word 'test', and when he finds it, he prints it, and this is working fine, BUT i get enters where i don't need them, this is my output
Code:
C:\Users\..\Dekstop>python test.py
test
test123
C:\Users\..\Desktop>
So i want to filter those enters out, but i don't know how
Does anyone know how i can filter those '123' away?
Thanks in advance and i'm trying to find it myself until someone can guide me