python 代码片段9

#coding=utf-8

# 字符串指示符号 r表示raw u表示unicode

mystring=u'this is unicode!--by'
print mystring

# 'raw'表示告诉解释器不要转换字符串任何字符

file=r'c:	empfolder
obots.txt'
print file

# 另一个实用raw的地方是正则表达式

# 可以在'''内放任何的字符串,不需要转义,比如xml
s='dongshen'
print '%s is number %d' %(s[:6],1)
hi='''hi

there
'''
print hi
原文地址:https://www.cnblogs.com/yufenghou/p/5097355.html