I have a program whos output is too long to be displayed in the terminal where I run sage. Is there a possiblity that the output of SAGE is automatically "copied" (as if I mark it and use ctrl+c) and then I can paste it into a text file? Or is there another way that the result can be automatically be saved into a text file or a way to make the terminal allow larger text before the text gets cut off?
Here the code Im talking about:
le_relations = lambda P: [(a,b) if P.le(a,b) else (b,a) for a,b in P.comparability_graph().edges(labels=None)] cover_relations = lambda P: [(a,b) if P.le(a,b) else (b,a) for a,b in P.hasse_diagram().edges(labels=None)]
format_pt = lambda k: "'x{0}'".format(k+1) format_relations = lambda relations: [[format_pt(a),format_pt(b)] for a,b in relations] format_pts = lambda P: [format_pt(a) for a in P] format_poset = lambda P: [format_pts(P), format_relations(cover_relations(P)), format_relations(le_relations(P))]
what_you_want = lambda n: [format_poset(P) for P in posets(n) if P.is_lattice]
print(what_you_want(8))
which is from the thread https://ask.sagemath.org/question/38865/obtaining-all-posets-in-a-certain-form-with-sage/ )