Ask Your Question
0

newby has trouble with "load" in cloud.sagemath.com

asked 2013-05-29 16:06:48 -0600

anonymous user

Anonymous

updated 2015-01-24 14:50:57 -0600

FrédéricC gravatar image

I get a syntax error when trying the command

load "example.sage"

in a workspace in cloud.sagemath.com:

Error in lines 1-1
Traceback (most recent call last):
  File "/mnt/home/VCQT9SWb/.sagemathcloud/sage_server.py", line 412, in execute
    exec compile(block, '', 'single') in namespace, locals
  File "<string>", line 1
    load "example.sage"
                      ^
SyntaxError: invalid syntax
edit retag flag offensive close merge delete

4 answers

Sort by » oldest newest most voted
1

answered 2013-06-02 17:15:16 -0600

William Stein gravatar image

It's best to use load('example.sage'), which is just a normal Python function call, but will do what you want. These "% magics" have got a bit out of hand, at least in cases when they are not needed.

edit flag offensive delete link more
0

answered 2013-09-18 00:21:04 -0600

Vijay gravatar image

William,

I used load command and in my .SAGE file I have another load for *.pyx file. I am observing following while running .SAGE script:

load('hopf_animate.sage') Compiling ./fib_param.pyx...

It is taking lot of time, so am I missing something here.

Thanks & Regards, Vijay

edit flag offensive delete link more
0

answered 2013-09-18 00:56:26 -0600

Vijay gravatar image

William,

Problem is resolved. Please ignore my last question.

Thank you Vijay

edit flag offensive delete link more
0

answered 2013-05-29 20:38:07 -0600

Hi,

Even with a standard Sage installation, the command load "example.sage" will not work. Use

%runfile example.sage

instead (but I do not know whether it would work on the cloud).

edit flag offensive delete link more

Comments

Yes, with standard sage, "load" provokes a message "DeprecationWarning: Use %runfile instead of load", but loads it anyway. But in a "worksheet", "%runfile" doesn't work, either, resulting in "NameError: name 'runfile' is not defined"

Daniel R. Grayson gravatar imageDaniel R. Grayson ( 2013-05-30 01:09:28 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-05-29 16:06:48 -0600

Seen: 1,000 times

Last updated: Sep 18 '13