Skip to content
Advertisement

How can print out in console more beautifully? [closed]

I create a Web-Bruteforce project with Python for CTFs. I ran it.

My Project Outputs

As you can see something’s wrong. It isn’t regular. How can I print them more beautifully? These are my codes:

JavaScript

(These IP addresses and the cookie were for a CTF)

Advertisement

Answer

You can specify a size for the formatting and the content will be padded with spaces

JavaScript

More

  • Do not use id builtin keyword

  • Read file with a with, you don’t need to think about closing it so

    JavaScript
  • Or read it with pathlib

    JavaScript
  • You can use itertools.product to use one for-loop

    JavaScript
  • Use enumerate to get the count auto-generated

    JavaScript

Final code

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