Coding environment (and the shell)

Module 0

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.

Codespace light theme

Codespace light theme screen shot

Codespace dark theme

Codespace dark theme screen shot

Codespace layout

Codespace layout

Codespace what / where?

Codespace layout with areas highlighted

Useful terminal (shell) commands

Screen shot of the command line

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.

List files and folders command

  • The ls command.
Screen shot of running 'ls' in the command line

Change directory command

  • The cd command.
  • cd .. takes you back to the previous (parent) folder.
Screen shot of running 'cd' in the command line

Where am I?

  • pwd is the print working directory command.
Screen shot of running 'pwd' in the command line

Time to try it out for yourself

Codespace view

Screen shot of Codespace

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

Break out room button

Screen shot of the breakout room button in Zoom

Codespace load

Screen shot of Github website with arrows showing how to start up Codespace

Ignore this

  • Ignore the pop out about extensions you may get in the bottom right of Codespace
Screenshot of python extensions pop out

Get to your first lesson

  • Change the directory (don’t type the $. This is just how we show that this is the command line):
    $ cd programming_in_healthcare/module_0
  • 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 40 minutes for lesson 1.