Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Using the Terminal on macOS (Summary)

In this Code Conversation, you followed the conversation while Philipp and Martin performed common tasks in the terminal on macOS.

In this video course, you’ve learned how to:

  • Show the current working directory
  • List the contents of a folder
  • Add text to files without opening them
  • Display the content of a file
  • Run Python scripts
  • Copy and move files

If you’d like to get to know the terminal even better, then you can check out the following command-line application projects:

You can also read the companion tutorial, The Terminal: First Steps and Useful Commands, to review what you’ve learned here and expand your skills by learning how to use pip and Git from the terminal.

Download

Course Slides (.pdf)

5.5 MB

00:00 Congratulations, you’ve made it to the last lesson of this video course.

00:05 In this course, you learned how to open the terminal, create files and folders. You saw how to navigate the file system, show and edit files, and copy and move them. Also, you learned how to run Python files in the terminal.

00:20 The more you use the terminal, the more comfortable you’ll get. A fun way to introduce the terminal into your own workflows as a Python developer is to create Python scripts with command-line interfaces.

00:32 Here are some example projects. In Build a Quiz Application With Python, you’ll build a Python quiz application for the terminal. Your app will ask you multiple choice questions that you can use to strengthen your own knowledge or challenge your friends to test theirs.

00:49 Or how about building a site connectivity checker in Python? While building this app for the command line, you’ll integrate knowledge related to making HTTP requests with standard-library tools, creating command-line interfaces, and managing concurrency.

01:04 The concurrency part might be a bit advanced, but you only add the async functionality at the last step, and the implementation is not mandatory for the connectivity checker to work.

01:15 Another classic project is building a to-do app. In this step-by-step project, you will create a to-do application for your command line using Python and Typer.

01:25 While you build this app, you’ll learn the basics of Typer, a modern, versatile library for building command-line interfaces. In the next project, you’ll create a directory tree generator application for your command line.

01:38 You’ll code the command-line interface with argparse and traverse the file system using pathlib. In Raining Outside? Build a Weather CLI App With Python, you’ll write a nicely formatted Python command-line interface app that displays information about the current weather in any city you provide the name for.

01:59 These projects are a great way of getting to know the Mac terminal better and make the terminal a less scary place. Even though you can substitute some workflows in the terminal with apps that contain a graphical user interface, you may need to open the terminal at some point in your life as a Python developer anyway. So, when you’re comfortable using the terminal, then you’ll probably be able to perform actions on your operating system faster and with more control than when using your mouse and clicking buttons.

02:28 Thanks for joining me on this Code Conversation about the terminal. My name is Philipp, and I hope you had as much fun as I had. See you next time at realpython.com.

Avatar image for 8858oboe

8858oboe on Feb. 10, 2023

I understood everything except that when I ran the course alongside the course on my Imac, the terminal was a black and white screen - how, on the Mac do i get to see the coloured output shown in the course.

Avatar image for Philipp Acsany

Philipp Acsany RP Team on Feb. 13, 2023

Thanks for pointing this out, @8858oboe! 🙂 We tried to keep the terminal as basic as possible. But apparently we forgot to disable one plugin: ohmyz.sh/ There is also ohmyposh.dev if you want to add more color into your terminal. You can find installation instructions here: realpython.com/advanced-visual-studio-code-python/#installing-oh-my-posh

Become a Member to join the conversation.