Created
July 28, 2016 11:54
-
-
Save srakrn/c2ceefba9eb6850decc6084bae4467c9 to your computer and use it in GitHub Desktop.
204111 Boost Camp Python Grep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################# | |
#NAME: Sirakorn Lamyai | |
#ID: 5910500023 | |
#PROGRAM: myGrep.py | |
#DATE: 28 Jul 2016 | |
############################################# | |
import sys | |
f = open(sys.argv[1]) | |
keyword = sys.argv[2] | |
array = f.readlines() | |
for line in array: | |
if(line.find(keyword)>-1): | |
print(line), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment