Skip to content

Instantly share code, notes, and snippets.

@lanky
Created June 30, 2020 21:11
Show Gist options
  • Save lanky/a3a06c2bd0a7fa2beab6e99cb70131f4 to your computer and use it in GitHub Desktop.
Save lanky/a3a06c2bd0a7fa2beab6e99cb70131f4 to your computer and use it in GitHub Desktop.
In [2]: import os
In [3]: for mfilename in os.listdir('tobythings/'):
...: with open('tobythings/' + mfilename, 'r+') as minfile:
...: if mfilename.endswith('_modified'):
...: r = 'POST THING'
...: print (mfilename)
...:
server.yaml_modified
haproxy1.yaml_modified
dealer.yaml_modified
(tobysthing)$ ls -1 tobythings/
dealer.yaml
dealer.yaml_modified
haproxy1.yaml
haproxy1.yaml_modified
server.yaml
server.yaml_modified
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment