Teaching Python:

Command line or Jupyter Notebook?

Maneesha Sane

Teaching Python to….

….scientists

https://software-carpentry.org/lessons/

http://www.datacarpentry.org/lessons/

….a general audience

http://phillypythonworkshop.github.io/

Teaching beginners

We want novices to explore code before writing stand alone scripts. We want them to see immediate feedback from lines of code that they write.

So we want somethign where you write a line of code, and immediatey get a response or result. So for teaching novices, we really want to look at a command line environment where we enter in some commands or code and get some response or reslts back, or look at a browser based graphical enviroment that also lets you enter commands and get something back. The question then becomes, which one should we do first?

Computers are everywhere….

  • Desktops and laptops
  • Phones
  • Watches
  • Home assistants
  • Appliances

….but the code isn’t

So let’s visit Jupyter

So let’s visit Jupyter

So let’s visit Jupyter

Software Carpentry and Data Carpentry teach computational tools to scientists and researchers. The ability to explore, analyze, and visualize data is important.

So let’s visit Jupyter

So let’s visit Jupyter

Notebooks can be published

Jupyter has overhead

Jupyter does a lot!

  • Formerly IPython Notebook
  • You can add bash shell commands, markdown text, html, etc. and so you need to know a bit more of what’s what
  • You can’t take everything your Jupyter notebook back to a pure Python environment

Jupyter does a lot!

So we need give extra attention to what’s what. The exact same code can have different results.

Jupyter does a lot!

So we need give extra attention to what’s what. We can’t mix Jupyter magic with Python code

You need to know how to use the command line

Most online resources assume you can navigate within the command line.

You need to know how to use the command line

www.python.org

Which command line?

You need to know how to use the command line

  • Software Carpentry and Data Carpentry have a separate section teaching people how to work in their computer’s terminal so we know they’re getting comfortable with it elsewhere

  • Teaching to a general audience, goals may be different so we don’t go through getting Jupyter and other libraries installed. Without another context, we teach from the command line.

Sometimes the command line is faster

Get connected

Request a Software Carpentry or Data Carpentry workshop

  • Workshops are offered on demand; no set schedule
  • $2500 + instructor travel costs paid by host site

Attend a Philly Python Users Group event

  • Monthly free events: project nights and speaker events
  • Intro to Python workshops: 1-2 weekends each year (nominal registration fee)

Questions?

More information

Software Carpentry www.software-carpentry.org

Data Carpentry www.datacarpentry.org

Philly Python Users Group www.meetup.com/phillypug/

Maneesha Sane

email: maneesha@carpentries.org

twitter: @maneeshasane

slides: tiny.cc/bmcjd