Some SMC Questions

47 views
Skip to first unread message

Thomas Judson

unread,
Dec 4, 2016, 11:59:56 AM12/4/16
to sage-...@googlegroups.com
(1) Is it possible to call subroutines in a Sage worksheet that were written in a different worksheet?

(2) When I am creating a course in SMC, what is the best way to add a batch of students. If I only have 15 students in course, it is pretty easy to add them one-by-one, but if I am adding 200 calculus students to a course, I would like to find an efficient way of doing this.

(3) What is the best way to move file, folders, and courses from one project to another?

Thanks.
Tom

Harald Schilly

unread,
Dec 4, 2016, 12:22:48 PM12/4/16
to sage-cloud
On Sun, Dec 4, 2016 at 5:59 PM, Thomas Judson <twju...@gmail.com> wrote:
> (1) Is it possible to call subroutines in a Sage worksheet that were written in a different worksheet?

No, the best way to accomplish this, is to write them into a separate
.py python file.

>
> (2) When I am creating a course in SMC, what is the best way to add a batch of students. If I only have 15 students in course, it is pretty easy to add them one-by-one, but if I am adding 200 calculus students to a course, I would like to find an efficient way of doing this.

You can add a comma separated list of email addresses.

>
> (3) What is the best way to move file, folders, and courses from one project to another?

Select it in the files view and copy them to another project.
Afterwards, delete them. I'm not sure about moving courses, though.
Maybe the best way is to add new collaborators to the project and
maybe remove some others? It would be interesting to know what you are
actually trying to accomplish by this.

-- harald

William Stein

unread,
Dec 4, 2016, 12:31:00 PM12/4/16
to sage-...@googlegroups.com
Or .sage file

--
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 sage-cloud+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud/CAGG4CB7-4EgZtDSQZXkw6tkeYk_Epg0rGq5JGcKb-4o4yDGAig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Dominique Laurain

unread,
Dec 5, 2016, 2:46:53 PM12/5/16
to sage-cloud
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

Reply all
Reply to author
Forward
0 new messages