0
我有这个Python脚本,我没有得到如何.strip能够删除“/ n”。从文档中你必须提供.strip()字符以从字符串中删除,并返回字符串w.o它们。/n某种特殊情况是.strip()忽略并返回一个字符串w.o它?不理解Python String Strip()方法
from urllib import urlopen
WORD_URL = "http://learncodethehardway.org/words.txt"
WORDS = []
# load up the words from the website
for word in urlopen(WORD_URL).readlines():
WORDS.append(word.strip())
print "*" * 134
print urlopen(WORD_URL).readlines()
print "*" * 134
print WORDS
真棒谢谢 –