import os import re globalitems re compile global item function proced

1
2
3
4
5
6
7
8
import os
import re
globalitems = re.compile("global.*?^ *?(?P<item>(function|procedure)\(.*?\))",re.S + re.M)
filename = "./MyFile.txt"
mypage = open(filename, 'r').read
m = globalitems.match(mypage)
print m