So i have a code in which i need to write to file something like this.
def f():
f.write(anothervar)
f.write("\t \t \t \t <------------------ Written from function f ")
f.write('\n')
def g
f():
f.write(somevar)
f.write("\t \t \t \t <------------------ Written from function g ")
f.write('\n')
However when displaying the text file it appears something like this (the code is snipped)
HELLO WORLD <------------------ Written from function g
HELLO WORLD MORE BIG BIGGER <------------------ Written from function f
HELLO WORLD BIGGEST HAHAHAHAHAHAHAHAHHA <------------------ Written from function f
I want every <--- written from function g/h
to be written exact right. How can i do that? From my thinking i can measure length of each line after being written hello world and subtract and do the math however its seems hard and i dont know any function that measure chr in lines. I need short and simple code.