资源简介
Python实现的一个将Word中的批注转换成脚注的小脚本。
1、删除Word中原有的脚注
2、将Word中的批注转成脚注
3、删除所有批注
三个功能分在三个脚本中,可以分别使用,一个auto.py对三个脚本集成。
代码片段和文件信息
#-*-coding:UTF-8 -*-
import ossystraceback
import delfootnotecomment2footnotedelcomment
src = “src.doc“
lstCommentText = []
lstScopeText = []
def main ():
print “-“*80
srcfile = src
destfile = srcfile[0:srcfile.rfind(‘.‘)] + “_result.doc“
if(len(sys.argv)>1):
srcfile = sys.argv[1]
if(len(sys.argv)>2):
destfile = sys.argv[2]
else:
destfile = srcfile[0:srcfile.rfind(‘.‘)] + “_result.doc“
srcfile = os.path.realpath(srcfile)
destfile = os.path.realpath(destfile)
if(False == os.path.exists(srcfile)):
print (‘源文件不存在: %s‘%(srcfile)).decode(“UTF-8“).encode(“cp936“)
return
“““
if(False == os.path.exists(destfile)):
print (‘目的文件不存在: %s‘%(destfile)).decode(“UTF-8“).encode(“cp936“)
return
“““
print (“源文件:%s“%(srcfile)).decode(“UTF-8“).encode(“cp936“)
print (“目的文件:%s“%(destfile)).decode(“UTF-8“).encode(“cp936“)
print
delfootnote.delfootnote(srcfilesrcfile+“.1.doc“)
print
comment2footnote.comment2footnote(srcfile+“.1.doc“srcfile+“.2.doc“)
print
delcomment.delcomment(srcfile+“.2.doc“destfile)
print “-“*80
if __name__ == “__main__“:
main()
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2010-11-06 10:34 comment2footnote\
文件 1239 2010-09-22 18:45 comment2footnote\auto.py
文件 3843 2010-09-22 19:20 comment2footnote\comment2footnote.py
文件 3019 2010-09-22 18:47 comment2footnote\delcomment.py
文件 3029 2010-11-06 10:32 comment2footnote\delfootnote.py
相关资源
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
- 量化交易(附python常见函数的使用方
- python 名字用字排行
评论
共有 条评论