First time here? Check out the FAQ!

Ask Your Question
0

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

asked 11 years ago

anonymous user

Anonymous

updated 10 years ago

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
Preview: (hide)

4 Answers

Sort by » oldest newest most voted
1

answered 11 years ago

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.

Preview: (hide)
link
0

answered 11 years ago

Vijay gravatar image

William,

Problem is resolved. Please ignore my last question.

Thank you Vijay

Preview: (hide)
link
0

answered 11 years ago

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

Preview: (hide)
link
0

answered 11 years ago

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).

Preview: (hide)
link

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 ( 11 years ago )

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 ( 4 years ago )

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: 11 years ago

Seen: 1,647 times

Last updated: Sep 18 '13