Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from subprocess import run as proc_run, PIPE as proc_PIPE
- from os.path import splitext
- grep_out = proc_run(['grep', '-rnw', '/var/www/standard_notes/standardnotes-extensions/', '-e', 'filesafe.standardnotes.org', '-o'], stdout=proc_PIPE)
- grep_out = grep_out.stdout.decode('utf-8')
- instances = [x.split(':') for x in grep_out.split('\n') if x != '']
- for instance in instances:
- if splitext(instance[0])[1] != '.py':
- print(instance)
- input("Press Enter to continue...")
- with open(instance[0], 'r') as f:
- text = f.read()
- text = text.replace('filesafe.standardnotes.org', '[your URL here]')
- with open(instance[0], 'w') as f:
- f.write(text)
Advertisement
Add Comment
Please, Sign In to add comment