Say I have a python program and I want to perform this
grep "username" accounts.txt
in 1 line
accounts.txt is in the same folder as my py file. I know in C there is some function like System(grep "username" accounts.txt) and would work wondering if there something like that in python. Normally python is too slow to read accounts.txt since its a large file. However in bash or linux its much faster, so wondering if I can use bash to find a username line then python prints it out.
If there is none, what would be an efficient way to integrate a large file of usernames that I can call on in my python code to print out the line associated with it.