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 based version of the well known desktop VS Code development environment.

Codespace what / where?

Codespace layout with highlighted areas

Useful terminal (shell) commands

Screen shot of terminal in Codespace

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.

Arrow keys

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

Tab

  • You can use the tab key to autocomplete a file or folder name
$ cd prog
Press TAB
$ cd programming_in_healthcare

Altering the command line

  • 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 the backspace and keyboard 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.
Screen shot of 'ls' being run in terminal

Change directory command

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

Where am I?

  • pwd is the print working directory command.
Screen shot of 'pwd' being run in the terminal

Review

  • You will be using the above commands in the hands-on sessions.
  • Come back to these slides if you need to refresh your memory.

Python slides