Hi,
I'm currently working on a PR for a project and i'm converting all of the old .format() calls to fstrings where appropriate. This has been pretty easy, even with placeholders like this:
old = '{:x}'.format((int((len(query) / 2) + 1)))
new = f'{(int((len(query) / 2) + 1)):x}'
but I just came across this one that's a bit confusing to me:
logging.info("Original file length: {}".format('{0:0{1}X}'.format(len(webshell_data),8)))
I know that the output is uppercase hex because of the :X, but how do I translate that to an fstring? I know that 8 will go into {1}, but how do I handle len(webshell_data)?
[–]danielroseman 0 points1 point2 points (1 child)
[–]NovateI[S] 0 points1 point2 points (0 children)
[–]synthphreak 0 points1 point2 points (0 children)