English cricket cuts ties with Zimbabwe Wednesday, 25 June, 2008 text<void(0);><void(0);> <void(0);>email <void(0);>print EMAIL THIS ARTICLE your name: your email address: recipient's name: recipient's email address: <;>add another recipient your comment: Send Mail<void(0);> close this form <http://ad.au.doubleclick.net/jump/sbs.com.au/worldnews;sz=300x250;tile=2;ord=123456789?> The England and Wales Cricket Board (ECB) announced it was suspending all ties with Zimbabwe and was cancelling Zimbabwe's tour of England next year.
BLOCKQUOTE>
该脚本应返回:
English cricket cuts ties with Zimbabwe Wednesday
The England and Wales Cricket Board (ECB) announced it was suspending all ties with Zimbabwe and was cancelling Zimbabwe's tour of England next year
BLOCKQUOTE>
我接受了abarnert的回应。下面是我的最终剧本。注意它非常低效,应该清理一些。同样免责声明我从很久以前就没有编码。
import enchant
from enchant.tokenize import get_tokenizer
import os
def clean_files():
os.chdir("TARGET_DIRECTORY")
for files in os.listdir("."):
#get the numbers out file names
file_number = files[files.rfind("_")+1:files.rfind(".")]
#Print status to screen
print"Working