Saturday, 15 January 2011

How to specify a “tab” in python code? -



How to specify a “tab” in python code? -

this question has reply here:

how write “tab” in python? 3 answers

suppose want write "welcome" tab "username" in file. how can specify tab?

f = open(filename, 'w') f.write("welcome:"+tab+"username");

use \t character:

>>> print('\tsomething')

in case be

f.write("welcome:\tusername")

python

No comments:

Post a Comment