'''
Created on 2012-5-1
@author: Maca
'''
str1 = "<<>>&&"
print str1.replace("<",">")
str2 = "abc"
for (a,b) in (("a","d"),("b","e"),("c","f")):
str2 = str2.replace(a,b)
print str2
import cgi
str3 = ' < >
& " '
str3 = cgi.escape(str3,quote = True)
print str3
str3 = ' < >
& " '
str3 = cgi.escape(str3,quote = False)
print str3
>>>>&&
def
< > & "
< > & "
沒有留言:
張貼留言