Re: [sage-support] Mixing GP and @interact inside Sage Cell

2020-01-12 Thread Pedja Terzic
Thank you, it works!

On Sun, Jan 12, 2020 at 7:54 PM Dima Pasechnik  wrote:

> e.g. something like
>
> sage: gp.eval("square(x)=x^2")
> '(x)->x^2'
> sage: gp.function_call("square",[20]).sage()
> 400
>
> So one can have
>
> def foo(x):
> return gp.function_call("square",[x]).sage()
>
> to create a Sage function that will square a number using GP
>
> On Sun, Jan 12, 2020 at 2:26 PM Dima Pasechnik  wrote:
> >
> > this way Python does not know anything about GP functions.
> > You need to pass the input/output from/to Python.
> >
> > On Sun, 12 Jan 2020, 14:06 Pedja,  wrote:
> >>
> >> Why the following code doesn't work inside Sage Cell?
> >>
> >> gp("""
> >> square(x)=x^2;
> >> """)
> >>
> >> @interact
> >> def _(x=2):
> >> print(square(x))
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups "sage-support" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an email to sage-support+unsubscr...@googlegroups.com.
> >> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-support/25a5f980-f93d-4721-94d4-e5f1677b285d%40googlegroups.com
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-support/CAAWYfq0rwwUEQFxmexC9vn8PaLczFSBFGSekYQFQMKi5bTPFFw%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAJBHNMBw4-CPs5sTG59bF_055yRnHgNa1BTy-Ha5dGADPO98DQ%40mail.gmail.com.


Re: [sage-support] Sage9.0 installation ubuntu

2020-01-12 Thread Dima Pasechnik
On Sun, Jan 12, 2020 at 7:49 PM 'Alexander Pepper' via sage-support
 wrote:
>
> installing as such, will I have any trouble importing preinstalled python 
> packages?

this way you have another (non-system) instance of Python3 where you
can install and import Python packages.

>
> Alex
>
> On Sunday, January 12, 2020 at 10:46:32 AM UTC-5, Eric Gourgoulhon wrote:
>>
>> Hi,
>>
>> Le dimanche 12 janvier 2020 10:25:50 UTC+1, Jean-Florent Raymond a écrit :
>>>
>>> Hello Alex,
>>>
>>> You can download binaries at the following address:
>>> https://www.sagemath.org/download-linux.html
>>> There is nothing to build in this case. See the "Usage" paragraph for
>>> instructions how to use them.
>>>
>>
>> Basically, this is
>>
>> bunzip2 sage-9.0-Ubuntu_18.04-x86_64.tar.bz2
>> tar xvf sage-9.0-Ubuntu_18.04-x86_64.tar
>> cd SageMath
>> ./sage -n jupyter
>>
>>
>> You can combine the first two commands into a single one thanks to the 'j' 
>> option of tar:
>>
>> tar jxvf sage-9.0-Ubuntu_18.04-x86_64.tar.bz2
>>
>> Eric.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/759b4964-6e08-424d-a9eb-98fe69a54469%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAAWYfq2AzS0HMEVGWFfMuKObacd3tyQgd_xvg_czjMsQdoKasw%40mail.gmail.com.


Re: [sage-support] Sage9.0 installation ubuntu

2020-01-12 Thread 'Alexander Pepper' via sage-support
installing as such, will I have any trouble importing preinstalled python 
packages?

Alex

On Sunday, January 12, 2020 at 10:46:32 AM UTC-5, Eric Gourgoulhon wrote:
>
> Hi,
>
> Le dimanche 12 janvier 2020 10:25:50 UTC+1, Jean-Florent Raymond a écrit :
>>
>> Hello Alex, 
>>
>> You can download binaries at the following address: 
>> https://www.sagemath.org/download-linux.html 
>> There is nothing to build in this case. See the "Usage" paragraph for 
>> instructions how to use them. 
>>
>>
> Basically, this is
>
> bunzip2 sage-9.0-Ubuntu_18.04-x86_64.tar.bz2
> tar xvf sage-9.0-Ubuntu_18.04-x86_64.tar
> cd SageMath
> ./sage -n jupyter
>
>
> You can combine the first two commands into a single one thanks to the 'j' 
> option of tar:
>
> tar jxvf sage-9.0-Ubuntu_18.04-x86_64.tar.bz2
>
> Eric.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/759b4964-6e08-424d-a9eb-98fe69a54469%40googlegroups.com.


Re: [sage-support] Mixing GP and @interact inside Sage Cell

2020-01-12 Thread Dima Pasechnik
e.g. something like

sage: gp.eval("square(x)=x^2")
'(x)->x^2'
sage: gp.function_call("square",[20]).sage()
400

So one can have

def foo(x):
return gp.function_call("square",[x]).sage()

to create a Sage function that will square a number using GP

On Sun, Jan 12, 2020 at 2:26 PM Dima Pasechnik  wrote:
>
> this way Python does not know anything about GP functions.
> You need to pass the input/output from/to Python.
>
> On Sun, 12 Jan 2020, 14:06 Pedja,  wrote:
>>
>> Why the following code doesn't work inside Sage Cell?
>>
>> gp("""
>> square(x)=x^2;
>> """)
>>
>> @interact
>> def _(x=2):
>> print(square(x))
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-support+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-support/25a5f980-f93d-4721-94d4-e5f1677b285d%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAAWYfq0rwwUEQFxmexC9vn8PaLczFSBFGSekYQFQMKi5bTPFFw%40mail.gmail.com.


Re: [sage-support] Sage9.0 installation ubuntu

2020-01-12 Thread Eric Gourgoulhon
Hi,

Le dimanche 12 janvier 2020 10:25:50 UTC+1, Jean-Florent Raymond a écrit :
>
> Hello Alex, 
>
> You can download binaries at the following address: 
> https://www.sagemath.org/download-linux.html 
> There is nothing to build in this case. See the "Usage" paragraph for 
> instructions how to use them. 
>
>
Basically, this is

bunzip2 sage-9.0-Ubuntu_18.04-x86_64.tar.bz2
tar xvf sage-9.0-Ubuntu_18.04-x86_64.tar
cd SageMath
./sage -n jupyter


You can combine the first two commands into a single one thanks to the 'j' 
option of tar:

tar jxvf sage-9.0-Ubuntu_18.04-x86_64.tar.bz2

Eric.


-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/1409fdfd-3274-4456-9806-d99b38642f97%40googlegroups.com.


Re: [sage-support] Mixing GP and @interact inside Sage Cell

2020-01-12 Thread Dima Pasechnik
this way Python does not know anything about GP functions.
You need to pass the input/output from/to Python.

On Sun, 12 Jan 2020, 14:06 Pedja,  wrote:

> Why the following code doesn't work inside Sage Cell?
>
> gp("""
> square(x)=x^2;
> """)
> @interactdef _(x=2):
> print(square(x))
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-support/25a5f980-f93d-4721-94d4-e5f1677b285d%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAAWYfq0jijYnRgkrsBz__rEmjf_%2BSFWMXZ3-K2T5kAxf8D-yQA%40mail.gmail.com.


[sage-support] Mixing GP and @interact inside Sage Cell

2020-01-12 Thread Pedja
Why the following code doesn't work inside Sage Cell?

gp("""
square(x)=x^2;
""")
@interactdef _(x=2):
print(square(x))

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/25a5f980-f93d-4721-94d4-e5f1677b285d%40googlegroups.com.