What is the use of ‘\’ tags in python string. For example, I have to execute this command:
cmd = 'exec ' + cs_bin + ' ' + \
vmtree.rsplit('-', 1)[1].split('/')[0] + ' --xml ' \
+ tmp_corefile + ' | ' + XML2HTML
what are ‘\’ used for?
Thank you.
\is used for line continuation.However you should only use it when required:
Quoted from PEP-8:
IMO this looks better:
The reason why the lines are continued instead of having one huge line is also mentioned in PEP-8: