import

77 views
Skip to first unread message

Henri Girard

unread,
Sep 26, 2021, 4:31:49 AM9/26/21
to sage-support
Hi,

Iq there a way to import function from a sage notebook to another notebook ?

I have long graphic one about 30 lines and I would like to show the
graphic in another notebook, like with an attach method "show(g)" with
import  and be able to add functions ?

Any help welcome

best

Henri

Dima Pasechnik

unread,
Sep 26, 2021, 4:36:57 AM9/26/21
to sage-support
They have a tool, nbmerge, to merge notebooks. https://github.com/jupyter/nbconvert/issues/253

Beyond this, no, you really would need to have code either in *.sage file, and load() it in a Sage notebook,
or have a *.py file, and import it in the usual Python way.

HTH
Dima

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/8d263aea-08c8-20b5-d412-b5db2bcc7ca0%40gmail.com.

slelievre

unread,
Sep 26, 2021, 9:06:59 AM9/26/21
to sage-support
A web search for [ import ipynb ]


also reveals tools such as ipynb and import-ipynb,
which can be pip-installed.  --Samuel

cyrille....@univ-orleans.fr

unread,
Oct 4, 2021, 10:39:40 AM10/4/21
to sage-support
Navré de vous déranger Samuel,

mais mon compte semble ne plus fonctionner et malgré tous mes efforts je n'arrive pas à le récupérer. Que dois-je faire ?

Incidemment,  je recherchait comment avoir accès aux signes <= ou >= dans une inégalité (.lhs() pour le terme de gauche, .rhs() pour le terme de droite mais pour le signe ?

Cordialement

Cyrille Piatecki


De: "slelievre" <samuel....@gmail.com>
À: "sage-support" <sage-s...@googlegroups.com>
Envoyé: Dimanche 26 Septembre 2021 15:06:59
Objet: Re: [sage-support] import

--
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...@googlegroups.com.

Emmanuel Charpentier

unread,
Oct 6, 2021, 7:50:28 AM10/6/21
to sage-support

Je ne peux rien pour votre compte. En revanche, ceci devrait vous éclairer :

sage: Ex = x > 3
sage: Ex.lhs()
x
sage: Ex.rhs()
3
sage: Ex.operator()
<built-in function gt>
# Kekcékçà ?
sage: import_statements(Ex.operator())
from _operator import gt
# Et d'ailleurs :
sage: Ex.operands()
[x, 3]

À la vôtre !

cyrille....@univ-orleans.fr

unread,
Oct 7, 2021, 12:09:36 PM10/7/21
to sage-support
Merci. J'ai encore une question  très simple. J'ai essayé e convaincre une mathématicienne de mon université d'abandonner Scilab et de passer à Sagemath (Python s'universalise partout et les banques ne veulent plus payer les droits exorbitants de logiciels comme SAS). Son argument est qu'un logiciel de qui fait de la théorie est plus lent qu'un logiciel de calcul numérique. Mais non seulement Sagemath délègue mais en plus on peut compiler. Connaissez vous des études ou ds articles qui pourraient appuyer mon propos ?


De: "Emmanuel Charpentier" <emanuel.c...@gmail.com>
À: "sage-support" <sage-s...@googlegroups.com>
Envoyé: Mercredi 6 Octobre 2021 13:50:27
Objet: Re: [sage-support] import

HG

unread,
Jun 6, 2022, 5:53:19 AM6/6/22
to sage-support
No answer ? 
I endly found a good work around at least for me at the moment

%run name.ipynb

Reply all
Reply to author
Forward
0 new messages