Skip to content

Instantly share code, notes, and snippets.

View towersvault's full-sized avatar

Clifford Steyn towersvault

View GitHub Profile
@towersvault
towersvault / PhraseScan.py
Created January 9, 2019 19:09
A script that checks for a given phrase in all text based files in (and deeper) in a directory. Best use case would be with moving a website from one domain to another and then having to deal with static URLs.
import glob
def get_files(scan_folder):
"""
Gets all the files deeper in from the provided scan_folder.
Does a recursive "search" using glob.
"""
if scan_folder[:-1] != '/':
scan_folder += '/'