Hey guys I have a question, in my linux I usually grep something in file and print output or print count, How can I do the same in python script. For e.g
Linux Command : grep name filename.txt | wc -l
Python 3.5.2 Command : os.system("grep name filename.txt | wc -l")
This gives me exact result as of linux command, but I need to store this in variable and then print how can I achieve that. Thanks in Advance.