Skip to content

Instantly share code, notes, and snippets.

@gph03n1x
Created August 9, 2015 17:24
Show Gist options
  • Save gph03n1x/bf8de1d0a063b7d7166d to your computer and use it in GitHub Desktop.
Save gph03n1x/bf8de1d0a063b7d7166d to your computer and use it in GitHub Desktop.
import os, sys
wordtolook = raw_input(">")
for root, directories, filenames in os.walk(os.getcwd()):
for filename in filenames:
if os.path.join(root,filename) != sys.argv[0]:
fileobject = open(os.path.join(root,filename), 'r')
if wordtolook in fileobject.read():
print "{0} at :{1}".format(wordtolook, fileobject.name)
fileobject.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment