import sys
import clingo
options = ["0"]
ctl = clingo.Control(options)
for path in sys.argv[1:]:
ctl.load(path)
if not sys.argv[1:]:
ctl.load("-")
ctl.ground([("base", [])])
with ctl.solve(yield_=True) as handle:
for m in handle: print("Answer:\n{}".format(m))
print(handle.get())
Maybe as entry point
Should look sth like this: