I'm trying to do some simple parsing
as example:
import csv
import os,sys
spamWriter = csv.writer(open('eggs.csv', 'wb'), delimiter=' ',quoting=csv.QUOTE_MINIMAL)
string = "cat /home/myfile.txt |grep -m 1 "my game" "
string2=os.system(string)
spamWriter.writerow([string2])
home]# python excel2.py
File "excel2.py", line 4
string = "cat /home/myfile.txt |grep -m 1 "my game" "
^
SyntaxError: invalid syntax
home]# cat /home/myfile.txt |grep -m 1 "my game"
my game is football
What am i doing wrong here?