Wednesday, 3 July 2024

Print hidden characters of a string in python

When you do

result = subprocess.run(
        args,
        capture_output=True,
        text=True
    )



    for line in result.stdout.splitlines():
        print(line)

There can be hidden text, which is then not printed. To show it, wrap the line with a list. I found this out by processing log lines and trying to write a regex.

result = subprocess.run(
        args,
        capture_output=True,
        text=True
    )



    for line in result.stdout.splitlines():
        print([line])

No comments:

Post a Comment

How whey is made

Source: https://www.youtube.com/watch?v=LeUZmojH7p8 Start with Milk, homogenize, pasteurize. It is 87% water, 5% lactose, 3.5% fat, 3.5...