易截截图软件、单文件、免安装、纯绿色、仅160KB

写了几个有关operaminimod的python小程序

写了几个有关operaminimod的python小程序
firefox->opm书签转换
import re
def pipeiwangzhi(a):
    s=[]
    pp= re.compile(r'<DT><A HREF="(.*)" ADD_DATE=(.*>)(.*)</A>')
    m=pp.search(a)
    s1=[]
    if m!=None:
        s=m.groups()       
        s1.append(s[0])
        s1.append(s[2])
    return s1
fnlang='f:\\bookmarks.html'
f1 = open(fnlang,'rb')
ffbk=f1.readlines()        
f1.close()
opbkmg=[]
for i in ffbk:
    a=i.decode('utf-8')
    ss=[]
    ss=pipeiwangzhi(a)
    if ss!=[]:
        opbkmg.append(ss)
#print(opbkmg)
tou="""<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<!--This is generated file from Opera Mini mod v.3.12.
It will be read and overwritten.
Do Not Edit! -->
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><P>\n"""
x1='<DT><img src="" alt="" width="12" height="12" /><A HREF="'
x2='">'
x3='</A><PARAM NAME="fav" VALUE="0:/">\n'
wei='</DL><P>'
opbk=''
for i in opbkmg:
    opbk+=x1+i[0]+x2+i[1]+x3
   
opbk=tou+opbk+wei
   
   
#print(opbk.encode('utf-8'))
fnlang='f:\\bookmarks.htm'
f1 = open(fnlang,'wb')
f1.write(opbk.encode('utf-8'))        
f1.close()


相关文档:

Python 3 的新特性

Python 3 是 Guido van Rossum 功能强大的通用编程语言的最新版本。它虽然打破了与 2.x 版本的向后兼容性,但却清理了某些语法方面的问题。本文是系列文章中的第一篇,介绍了影响该语言及向后兼容性的各种变化,并且还提供了新特性的几个例子。
Python 版本 3,也被称为 Python 3000 或 Py3K(仿效 Microsoft® Windows ......

保存指定文件夹下的目录和文件名到文件中 Python 脚本

真是倒霉,刚买不久的移动硬盘,昨天删除一个分区失败后,几个分区都不见了,拿去修,未果
换了个新的,但其中数据全没了。那是我平时收集的很有用的资料
很多都可以重新下载,但怎能想起硬盘中的所有东西
今天换硬盘回来
就像写一个保存指定路径下所有文件夹和文件名的程序
这样,如果东西丢了,看看那里有些什么,也 ......

[Python module] threading

threading — Higher-level threading interface
This module constructs higher-level threading interfaces on top of the lower level _thread module. See also the queue module.
The dummy_threading module is provided for situations where threading cannot be used because _thread is missing.
  ......

[Python module] multiprocessing


multiprocessing — Process-based “threading” interface
Introduction
multiprocessing is a package that supports spawning processes using an API similar to the threading module. The multiprocessing package offers both local and remote concurrency, effectively side-stepping the Glo ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号