| ||
设置python版本:
method1: set python3
method2: set path = ( /xxx/xx_Tools/xxx_UTILITIES/python/Python-3.6.4 /xxx/xx_Tools/xxx_UTILITIES/python/Python-3.6.4/lib $path )
查看python版本: which python
coding practice:
#!/usr/bin/python
import sys, re
input = sys.argv[1]
with open(input, 'r') as f:
lines = f.readlines()
for line in lines:
if re.search('^\s*W\s*\(', line, re.IGNORECASE):
p = re.search('^\s*W\s*\(\s*(.*)\s*\)', line, re.IGNORECASE)
content = p.group(1);
#content = p.group(1).split();
print content
m, n, tmp, arrtmp, arr = 0, 1, "", [], []
for character in content:
if re.search("\(", character):
m+=1
arrtmp.append(character)
elif re.search("\)", character):
arrtmp.append(character)
m-=1
else:
arrtmp.append(character)