from subprocess import call
from subprocess import Popen
from subprocess import PIPE
#ganz viel anderes Zeugs
searchPattern = r' ' +str(1+w*wMax)+ r' \| ' +str(2+w*wMax)+ r' \| ' +str(3+w*wMax)+ r' '
count = Popen( ("grep", "-c", searchPattern, slFileName ), stdout=PIPE )
slNodes = int(count.stdout.read())
call( ("grep", searchPattern, slFileName ), stdout=slPerWing )
slPerWing.close()