Site_2fLinux_2fProgramming
# cat Site_2fLinux_2fProgramming #title 리눅스 프로그래밍 ....
Site/Linux/Programming 리눅스 프로그래밍
import sys import os import re import urllib filelist = [] maxdepth = 0 for file in os.listdir('./text'): if re.match("^Site_2f|^man_2f",file): depth = file.count('_2f') filelist.append(file) if depth > maxdepth: maxdepth = depth infopath = 'dirinfo' fhandle = [-99] for i in range(1, maxdepth+1): filename = "{0}{1}{2}".format(infopath,"/depth.",i) fhandle.append(open(filename,'w')) for file in filelist: depth = file.count('_2f') f = open("text/"+file) title = f.readline() if title.find("#title") != -1: titles = re.split(" +", title,1) title = titles[1] else: title = 'no title\n' file = file.replace('_', '%') fhandle[depth].write("{0} {1}".format(urllib.unquote(file),title)) f.close()
Copyrights © - Joinc, All Rights Reserved. Inherited From - Yundream Rebranded By - Joonphil
설명
Recent Posts
Archive Posts
Tags