function definition doesn't work in startup file

asked 3 years ago

cybervigilante gravatar image

updated 3 years ago

I have this in my jupyter startup file. The os works, but the function definition doesn't take, although I know it works when I paste it in after startup. (I like range to not cut off the last number, but I don't want to type include_endpoint every time.) Do function definitions not work in startup? What does work?

import os os.chdir("allsagemathprogs")

def endrange(a,b,c=1): return srange(a,b,c,include_endpoint=True)

Preview: (hide)

Comments

1

Shouldn't this go to your Sagestartup file ?

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 3 years ago )

I mis-spoke. Yes, it is the sage startup file, and the os part works, so I'm puzzled why I can't define a function.

cybervigilante gravatar imagecybervigilante ( 3 years ago )