我得到傳入的字符串並且想要以原始格式打印緩衝區(打印雙反斜槓) 如何告訴string.format()這是一個'原始'字符串,並不使用反斜槓字符?在Python中打印帶反斜槓的字符串2.7
>>> machines=['\\JIM-PC', '\\SUE-PC', '\\ANN-PC']
>>> for machine in machines:
... print 'Machine Found %s' % (machine)
...
Machine Found \JIM-PC
Machine Found \SUE-PC
Machine Found \ANN-PC
嘗試'print(repr(machine))' –