summaryrefslogtreecommitdiff
path: root/bin/snippet.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2020-07-15 09:29:55 -0400
committerluxagraf <sng@luxagraf.net>2020-07-15 09:29:55 -0400
commit768a4df311c1a0b296481860258a7f58d3a87fa6 (patch)
tree2e0b10a24ebc607b9bdfcc727f99f802ee89348d /bin/snippet.py
parentfe4d14419e52e4afbc2a7feefdc34cae2f30a3e1 (diff)
added latest tweaks to my setup
Diffstat (limited to 'bin/snippet.py')
-rwxr-xr-xbin/snippet.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/snippet.py b/bin/snippet.py
new file mode 100755
index 0000000..e3acad4
--- /dev/null
+++ b/bin/snippet.py
@@ -0,0 +1,9 @@
+import re
+with open('/home/lxf/documents/textsnippets.txt', 'r') as f:
+ data = f.read()
+snips = re.split("---", data)
+for snip in snips:
+ # strip the blank line at the end
+ s = '\n'.join(snip.split('\n')[1:-1])
+ #make sure we output the newlines, but no strong wrapping single quotes
+ print(repr(s.strip()).strip('\''))