function definition doesn't work in startup file

asked 2022-03-29 03:53:02 +0200

cybervigilante gravatar image

updated 2022-03-29 03:53:47 +0200

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)

edit retag flag offensive close merge delete



Shouldn't this go to your Sagestartup file ?

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2022-03-29 08:11:51 +0200 )edit

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 ( 2022-03-31 05:36:25 +0200 )edit