Using Cocalc to Teach Python

Harold Nelson

9/19/2021

Cocalc

Cocalc (Collaborative Calculation) was created by Professor William Stein of the University of Washington to make Sage, a computer algebra system (CAS) widely available. It was originally known as SageMath Cloud.

In addition to Sage, it incorporates many computer languages including Python, R, and C++.

For questions on this presentation, contact Harold Nelson of Saint Martin’s University ().

Create an Account and a Project

Go to Cocalc.com and sign into your project.

Add to your project

First I’ll show you how to add things. The following video assumes that you have created an account and a project at cocalc.com.

Note: Left-click doesn’t work in this environment. To see a video, right-click and select New Window.

https://www.youtube.com/watch?v=pGs8iEwrDcg

Now add the following yourself.

  1. A course
  2. An assignments folder
  3. A handouts folder
  4. A notes folder
  5. A terminal

Add some students

Use an email address or the name of someone with an account.

Here’s a video how-to.

https://www.youtube.com/watch?v=XJXo3Juu9W8

Add an Assignment

First I’ll show you how.

https://www.youtube.com/watch?v=bWqC1J8JkTk

Now, please create and distribute an assignment to your students.

Submitting an Assignment.

I ask my students to covert their completed notebook files to pdf format and submit them in our LMS, Moodle.

Let me show you how to do this.

https://www.youtube.com/watch?v=CjVrYVLBMmo

Other Ways to Run Python on Cocalc

When students find material on python on the web, it probably won’t be in Jupyter notebooks. Cocalc actually does include the common other ways to run python. I will show you two of these.

  1. REPL mode
  2. Create a .py file and direct python to to run it.

https://www.youtube.com/watch?v=snyxHh3CrZY

The Files System

There are reallly three modes of the interface.

  1. Working in a “file”.
  2. Moving around in the file system.
  3. Doing something to a file beyond edits.

In the following video, I will show you how to tell what mode you’re in and how to change modes.

https://www.youtube.com/watch?v=-IazrPujncQ

Exercise: Spend a few minutes working with what you’ve just seen.

Using Time Travel

Sometimes when you’re editing a file, you make mistakes. Time travel is possible in Cocalc. Let me show you how.

https://www.youtube.com/watch?v=zKcodqIW1_o

Exercise: Create a file and edit it for a minute. Use time travel to get back to an earlier version.

Paying for it

I have a very basic account, for which I pay $7.00 per month.

There are optional ways to get students paid accounts. I’ll show you how.

https://www.youtube.com/watch?v=eRoflJKyuB0

More to Read

If you are interested in using Cocalc to teach, you should visit https://doc.cocalc.com/teaching-instructors.html