假设我要在文件中写入“ welcome” TAB“ username”。如何指定此选项卡?
f = open(filename, 'w')
f.write("welcome:"+TAB+"username");
使用\t
字符:
>>> print('\tsomething')
something
在你的情况下
f.write("welcome:\tusername")
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句