I made the following code in GAP to generate all monic irreducible polynomials of degree n with coefficients 1,-1 or 0 and non-zero constant term:
n:=7;d:=n-1;x:=Indeterminate(Rationals,1);U:=Tuples([-1,1,0],n);UU:=Filtered(U,x->(x[1]=0)=false and x[n]=1);W:=[];for i in UU do Append(W,[UnivariatePolynomial(Rationals,i,1)]);od;WW:=Filtered(W,x->IsIrreducible(x)=true);WW;
Now I wanted to use the resulting list WW in Sage to do operations only Sage can do. But how do I get WW now in Sage? It seems very complicated and using https://sagecell.sagemath.org/ (where the language is set to "GAP") produces no output, while the output is displayed when I use a terminal for GAP. Is there an easy solution for my problem (other than programming it in Sage, which would also be interesting but it seems it is easier to deal with the generation of polynomials via GAP)?