ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 28 Oct 2015 18:58:34 +0100Custom Input Transformationhttps://ask.sagemath.org/question/30320/custom-input-transformation/ Greetings. I am trying to emulate the << >> functionality of OCaml in python on cloud.sagemath.com. For instance, if I type:
<<stuff>>
I want it to call default_parser("stuff"). I have it working if << and >> are on the same line, but I want it to be able to span multiple lines. Here's my code:
from IPython.core.inputtransformer import (StatelessInputTransformer)
@StatelessInputTransformer.wrap
def quotations(line):
if line is not None:
line = line.replace("<<", 'default_parser("""')
line = line.replace(">>", '""")')
return line
ip = get_ipython()
ip.input_splitter.logical_line_transforms.append(quotations())
ip.input_transformer_manager.logical_line_transforms.append(quotations())
It can't handle this:
<<
stuff
>>
It replaces the << in the first line just fine, but apparently once it goes into triple quote mode, it stops calling my transformation function.
jediknight219Wed, 28 Oct 2015 18:58:34 +0100https://ask.sagemath.org/question/30320/python turtle graphics in sagemath cloudhttps://ask.sagemath.org/question/24450/python-turtle-graphics-in-sagemath-cloud/The turtle module seems to be available in the cloud, but it wants to open a remote window. It would be ideal if it could display the graphics in the browser. Otherwise, X forwarding would work in some circumstances, if I'm not behind a firewall or a NAT.David GuichardThu, 09 Oct 2014 20:21:15 +0200https://ask.sagemath.org/question/24450/Accessing mysql database from ipython notebookhttps://ask.sagemath.org/question/7546/accessing-mysql-database-from-ipython-notebook/Is it possible in Sage Cloud?
bucaroSat, 25 Jan 2014 15:54:35 +0100https://ask.sagemath.org/question/7546/is it possible to run a sage in ipython notebook?https://ask.sagemath.org/question/10666/is-it-possible-to-run-a-sage-in-ipython-notebook/I want run some sage commands in ipython notebook (in cloud.sagemath.com), is it possible?
And the same question but local, i.e., using ipython notebook via canopy and insert some command of sage.
Thanks.hsigristSun, 27 Oct 2013 21:28:21 +0100https://ask.sagemath.org/question/10666/