为了在输出上实现合适的格式化,我如何改进以下代码?
import os
print("file\tsomething")
for root, dirs, files in os.walk(".", topdown=False):
for name in files:
print('{}\t{}'.format(name, 'a'))
当前输出
file something
logging_test.py a
sample.log a
test.py a
__init__.py a
所需的输出
file something
logging_test.py a
sample.log a
test.py a
__init__.py a