def stripFile(oldFile, newFile): '''remove the space or Tab or enter in a file, and output a new file in the same folder''' f = open(oldFile, 'r+', encoding='utf8') newf = open(newFile, 'w',encoding='utf8') for eachline in f.readlines(): newStr = eac
s = '<SPAN style="FONT- SIZE: 9pt">开始1~3<SPAN lang=EN-US>& lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN>' import re d = re.sub('<[^
一.查询python安装路径,一般默认是/usr/lib64/ [root@host2 ~]# python Python (r266:, Jul , ::) [GCC (Red Hat -)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>>
我们编译python代码时, 经常出现各种因为tab和空格的问题, 例如: IndentationError: unindent does not match any outer indentation level 有个简便的办法: 用python的IDLE打开python 代码, 选中所有代码, 点击菜单项Format/Untabify Region