Coding environment (and the shell)

Module 1

Let’s Do Digital Team

The coding environment

Today’s hands-on sessions

  • We will be using the GitHub Codespace development environment.
  • This is a browser version of the well known desktop VS Code development environment.
  • In the context of this course, a development environment is synonymous with the teaching environment.

Codespace light theme

Codespace dark theme

Codespace layout

Useful terminal (shell) commands

Commands

  • A command is a piece of code that carries out a specific task.
  • These tasks can be as simple as showing you what folder you are in, to printing, changing settings, and updating the operating system.

Using the terminal

  • Also called the command line interface (CLI) or the shell.

Steps:

  • Select the terminal (aka click on it).
  • Type in your command (this needs to be typed out exactly).
  • Press enter to run the command.

Pro tip:

  • If you want to run a previously run command, you can select it with the ↑ and ↓ arrow keys on the keyboard.

Altering the command to run

  • Use the ← and → arrows to move the cursor on the terminal line (the mouse does not allow you to move the cursor). Then make any corrections with backspace and keystrokes as needed.
  • For example to change
$ streamlit run exercise_1.py

to

$ streamlit run exercise_2.py

List files and folders command

  • The ls command.

Change directory command

  • The cd command.
  • cd .. takes you back to the previous (parent) folder.

Where am I?

  • pwd is the print working directory command.

Time to try it out for yourself

Codespace view

Lesson 1

  • Make sure you have a GitHub account.
  • Join your tutor group in the named Zoom break out rooms.
  • Go to the page at https://github.com/letsdodigital/coding-hands-on
  • Click on the <> Code button and then the Codespaces tab.
  • Click on Create codespace on main

Codespace load

Codespace load

Ignore the extensions

  • Ignore when a small window in the bottom right that pops up. Just close these.

Get to your first lesson

  • Change the directory (don’t type the $. This is just how we show this is the command line):
    $ cd programming_in_healthcare/module_1
  • And then
    $ python lesson_1.py
  • Did it work? If so, open up the lesson_1.py file.
  • Any problems, just ask your tutor for help.
  • There is no such thing as a stupid question, only the question left unanswered.
  • We will give you 30 minutes for lesson 1.