On Jun 29, 2012, at 6:54 PM, Walter Carlip wrote:

> This would, at least, be a relatively simple command to enter, though I don't 
> like the idea of students having to switch
> back and forth from "sage" to "gap".  (Even my tutors kept coming for help in 
> our practice session, only to realize they
> had somehow switched to "sage".  The drop-down menu for this switch is not 
> easily accessible if you have a long 
> worksheet.)
> 
> In any case, I did  try again (both set to "sage" and to "gap") and got the 
> reply:
> 
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "_sage_input_6.py", line 10, in <module>
>     exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 
> -*-\\n" + 
> _support_.preparse_worksheet_cell(base64.b64decode("Z2FwLmV2YWwoLi4uLiwgYWxsb3dfdXNlX2ZpbGU9RmFsc2Up"),globals())+"\\n");
>  execfile(os.path.abspath("___code___.py"))
>   File "", line 1, in <module>
>     
>   File 
> "/private/var/folders/XY/XY6U7DQjGfyP4U0KWM0W-++++TI/-Tmp-/tmpcBPUqv/___code___.py",
>  line 2
>     gap.eval(Ellipsis., allow_use_file=False)
>                       ^
> SyntaxError: invalid syntax

Sorry, the .... was meant to be replaced with the command you are trying to 
evaluate.  something like

gap.eval( 'Print("Hi\n")', allow_use_file=False)

though of course that is short enough that it doesn't cause problems anyway.

Nevertheless, it's not a solution to your problem, just a way to demonstrate 
that we know where the problem is.  The solution would be to create the 
init.sage file.  You can do this from inside GAP (since you understand it 
better than python) with


#Find the correct place to put init.sage
dotsage := Filtered(GAPInfo.SystemEnvironment,
      x-> Length(x) > 9 and x{[1..9]} = "DOT_SAGE=")[1];
dotsage := Concatenation( dotsage{[10..Length(dotsage)]}, "init.sage" );

# Write the init.sage file -- WARNING -- this overwrites it completely!
FileString( dotsage, "gap._eval_using_file_cutoff = 1000\n");


That should eliminate any possibility of putting it in the wrong place.

I just looked and the GAP interface doesn't respect _eval_using_file_cutoff 
being False to mean don't use a file.  Anyway, setting the limit high enough 
should be okay. 

-Ivan

> On Friday, June 29, 2012 11:24:57 AM UTC-5, kcrisman wrote:
> 
> I also tried executing 
> 
> gap._eval(...., allow_use_file=False)
> 
> 
> Just gap.eval, I think.
>  
> in the notebook, both under sage (which I thought would be correct) and under 
> gap, and both reported back syntax
> errors and did not work.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to