Ask Your Question
0

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

asked 2013-05-29 23:06:48 +0100

anonymous user

Anonymous

updated 2015-01-24 21:50:57 +0100

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-03 00:15:16 +0100

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 07:56:26 +0100

Vijay gravatar image

William,

Problem is resolved. Please ignore my last question.

Thank you Vijay

edit flag offensive delete link more
0

answered 2013-09-18 07:21:04 +0100

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-05-30 03:38:07 +0100

vdelecroix gravatar image

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 08:09:28 +0100 )edit

Still won't work. Sage saves as a .sobj file but on load says .sobj files are not recognized. Should be a simple save, load but they're making it awful hard.

cybervigilante gravatar imagecybervigilante ( 2020-10-16 02:02:55 +0100 )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 23:06:48 +0100

Seen: 1,585 times

Last updated: Sep 18 '13