随笔分类 - python
摘要:#regex replace character in string re.sub(r"[():;,]"," ",line) #check whether a string is an existed file if os.path.isfile(fldPnNanmeValueFile) is not True: continue # print with paramters prin...
阅读全文
posted @ 2016-01-07 16:21
鱼悠游
摘要:#1. keep strings in double quote as one word when split string to words #e.g. str = ‘a b "is si" d ’ #to #['a','b','is si','d'] #use shlex module import shlex words = shlex.split(line) #2. join s...
阅读全文