Skip to content
Advertisement

Find Function in Python

I’ve made this code but it is not acting how I was expecting:

JavaScript

Basically I read a .pcap file which can be full of information or empty and I’m looking for a word inside each raw. If it is found I start some operation on this string in order to reach a desidered position inside the string.

I noticed that when the .pcap file is empty the code doesn’t enter into the “else” condition. I think I’m making a mistake with the find function in python but I don’t see it.

Advertisement

Answer

JavaScript

it will execute the outermost if statement when there’s content in the file otherwise it will execute the else statement.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement