满意答案
阿克希亚巴鲁斯
2015.06.11
采纳率:44% 等级:12
已帮助:8217人
[python] view plaincopy
str="a|and|hello|||ab"
alist = str.split('|')
print alist
str="a hello{这里换成5个空格}world{这里换成3个空格}"
alist=str.split(' ')
print alist
统计英文单词的个数的python代码
[python] view plaincopy
# -*- coding: utf-8 -*-
import os,sys
info = os.getcwd() #获取当前文件名称
fin = open(u'c:/a.txt')
info = fin.read()
alist = info.split('