Ask Your Question

rexroni's profile - activity

2020-08-04 02:45:17 +0200 received badge  Famous Question (source)
2018-12-18 00:51:53 +0200 received badge  Notable Question (source)
2018-12-18 00:51:13 +0200 received badge  Nice Question (source)
2018-12-17 09:15:04 +0200 received badge  Popular Question (source)
2015-09-13 17:07:34 +0200 commented answer Can I alias a sage command?

Ah, thank you. That was the second half of the answer I was looking for. When I have 15 rep someday I'll come back and upvote your comment.

2015-09-08 13:17:43 +0200 received badge  Student (source)
2015-09-02 19:42:08 +0200 commented answer Can I alias a sage command?

Ok, I did know about that, but I figured there must be a way to use the aliases, since aliases exist. Any insight into the aliasing then, if it isn't useful for sage commands?

2015-08-31 20:44:42 +0200 received badge  Editor (source)
2015-08-31 20:42:56 +0200 asked a question Can I alias a sage command?

If I type alias, I get a list of aliases, but they all look very "bashy", and not like sage commands. Can I set an alias for a sage command? Like alias 'meh'='load("meh.sage")'?

I have looked on this site, the "SAGE for newbies" document I found by Ted Kosan, doc.sagemath.org, and the general web, and I haven't found any documentation on aliases in sage.

When I run that, I get the following output:

sage: alias 'meh'='load("meh.sage")'
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-118-7d3257e61ed9> in <module>()
----> 1 get_ipython().magic(u'alias \'meh\'=\'load("meh.sage")\'')

/usr/lib/sagemath/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
   2302         magic_name, _, magic_arg_s = arg_s.partition(' ')
   2303         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2304         return self.run_line_magic(magic_name, magic_arg_s)
   2305 
   2306     #-------------------------------------------------------------------------

/usr/lib/sagemath/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
   2223                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
   2224             with self.builtin_trap:
-> 2225                 result = fn(*args,**kwargs)
   2226             return result
   2227 

/usr/lib/sagemath/local/lib/python2.7/site-packages/IPython/core/magics/osm.pyc in alias(self, parameter_s)

/usr/lib/sagemath/local/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
    191     # but it's overkill for just that one bit of state.
    192     def magic_deco(arg):
--> 193         call = lambda f, *a, **k: f(*a, **k)
    194 
    195         if callable(arg):

/usr/lib/sagemath/local/lib/python2.7/site-packages/IPython/core/magics/osm.pyc in alias(self, parameter_s)
    117         # Now try to define a new one
    118         try:
--> 119             alias,cmd = par.split(None, 1)
    120         except TypeError:
    121             print(oinspect.getdoc(self.alias))

ValueError: need more than 1 value to unpack