以下在Python 2.7,MacOS上试过
f = open('ctrla.txt', 'w') f.write('abc') f.write(u'\u0001') f.write('35') f.close()
vim ctrla.txt
1 abc^A35
程序|生活
以下在Python 2.7,MacOS上试过
f = open('ctrla.txt', 'w') f.write('abc') f.write(u'\u0001') f.write('35') f.close()
vim ctrla.txt
1 abc^A35