Paint-by-Example icon indicating copy to clipboard operation
Paint-by-Example copied to clipboard

What is {:06} means

Open QixingJiang opened this issue 2 years ago • 1 comments

Thank you for your outstanding contribution to community! I noticed that in main.py, line 621:
"filename": "{epoch:06}-{step:09}", and line 553: "filename": "{epoch:06}", I wonder if it's missing "format", or what is the meaning of this {:06}?

QixingJiang avatar Feb 13 '23 11:02 QixingJiang

This is Python's syntax for formatting strings. You can read more about it in the Documentation. In this example, the integer epoch will be left-padded with zeros to a length of 6:

"{epoch:06}".format(epoch=12)
'000012'

99991 avatar Aug 22 '23 07:08 99991