For (1) I use both Harald and William ways : .sage is for pre-processed files and .py is for common Python file.
I use pre-processed .sage files since long time and because of an old coding choice...I don't remember exactly in which SMC web page pre-processing is explained, maybe in the FAQ (http://doc.sagemath.org/html/en/faq/faq-usage.html) ..I am just a litlle lazy now to search. In one worsheet first cells : #%hide import sys sys.path.append('./modules') import DrawingConstants as dc %load ./modules/RationalTrigonometry.sage And in the directory "modules" in the project, I have files : *DrawingConstants.py (python file):* print "DrawingConstants module loading ..." > # Constants > nd = 5 > # Colors > c0 = "white" > c1 = "black" > c2 = "red" > c3 = "green" > c4 = "brown" > c5 = "orange" > c6 = "pink" > c7 = "blue" > c8 = "yellow" > # Line styles > ls = ":" > # Thickness of lines > th1 = 0.4 > th2 = 0.8 > th3 = 0.2 > th4 = 0.6 > # Font sizes > fs1 = 10 > fs2 = 12 > fs3 = 14 > fs4 = 16 > fs5 = 18 > print "...DrawingConstants module loaded" and in file *RationalTrigonometry.sage :* print "RationalTrigonometry (RT) module loading ..." > > # Given two points p1,p1 returns quadrance Q(P1,P2) > def RT_Quadrance(p1,p2): > [x1,y1] = p1; [x2,y2] = p2 > q = (x1-x2)^2+(y1-y2)^2 > return q Dominique -- You received this message because you are subscribed to the Google Groups "sage-cloud" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud/1c6cd567-46d3-438b-a348-40373937948d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
