Skip to content

Instantly share code, notes, and snippets.

@suriyadeepan
Created November 16, 2017 09:25
Show Gist options
  • Save suriyadeepan/4c09537c8373cd3b9ea3ee7e77fac7c9 to your computer and use it in GitHub Desktop.
Save suriyadeepan/4c09537c8373cd3b9ea3ee7e77fac7c9 to your computer and use it in GitHub Desktop.
sauce
#!/usr/bin/python3
import os
import pyperclip
def find(name, path):
for root, dirs, files in os.walk(path):
if name in files:
return os.path.join(root, name)
if __name__ == '__main__':
file_ = None
path = './'
while not file_:
file_ = find('activate', path)
path = path + '../'
pyperclip.copy('source ' + file_ + '\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment