[sage-support] Re: Loading a module causes the __name__ == '__main__' block to execute

2017-07-07 Thread Jacob Bond
This happens both in Sage 7.3 on Ubuntu Linux (Chromebook) and in Sage 7.6 on CoCalc. On Friday, July 7, 2017 at 1:03:15 PM UTC-4, Jacob Bond wrote: > > > > I have a module that can also be run from the command line: > > def func(): > print('Hello!') &

[sage-support] Loading a module causes the __name__ == '__main__' block to execute

2017-07-07 Thread Jacob Bond
I have a module that can also be run from the command line: def func() print('Hello!') if __name__ == '__main__': func() When I try to load it in Sage, the main block is executed: sage: load('module.sage') Hello! sage: The bigger problem is that my main bl

[sage-support] Mathematica interface without a temp file

2015-10-27 Thread Jacob Bond
I am working on our department servers so I don't have root access. I have aliased the math command to call mathematica. When I use the Mathematica interface (Sage version 6.3), it tries to use a temp file because at some point, allow_use_file is set to True. Is there anyway to call mathemati