I need to compare two string in python, first string is read from .xlsx file and second is an output from stdout.readlines().
Below code is to get command output.
stdin, stdout, stderr = client.exec_command(testCommand)
op = stdout.readlines()
print("op =\n"+str(op))
str1 = "".join(op)
Since some commands output begin with \t or might have \t in between .
For Eg : Below command output begin with \t and after LEN there is \t.
# PASS_MIN_LEN Minimum acceptable password length.
PASS_MIN_LEN 5
And xlsx file is having
# PASS_MIN_LEN Minimum acceptable password length.
PASS_MIN_LEN 5
As .xlsx comparison string doesn't have \t, how can i ignore \t while comparing two string.
if cmdOutput== xlsxOutput:
is not working.
I tried to trim the cmdOutput with \t, it didn't worked. Any approach can i follow?
opa list?stdoutlooks like a file, andfile.readlines()returns a list. Not to mention the OP's use ofstr.join.str(op).strip().