Skip to content

Instantly share code, notes, and snippets.

@davaymne
Created December 13, 2020 19:00
Show Gist options
  • Save davaymne/278babaf87879675d48dcfcbb5ce03ea to your computer and use it in GitHub Desktop.
Save davaymne/278babaf87879675d48dcfcbb5ce03ea to your computer and use it in GitHub Desktop.
# Requires argument tsv file: b32 id name allocation
import sys
import subprocess
with open(sys.argv[1], 'r') as f:
for line in f:
print(line)
b32, id, name, allocation = line.strip().split('\t')
#print(id, model)
# graph indexer rules never $id
cmd = ['graph', 'indexer', 'rules', 'never', id]
print(cmd)
p = subprocess.Popen(cmd, stdout=subprocess.PIPE,stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
#print(id, model)
print(stdout.decode('utf-8'), stderr.decode('utf-8'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment