TL;DR all the necessary steps are in a code snippet at the bottom.

As a student, I see many of my classmates create impressive tools that I want to incorporate into my workflow. But these functions are relegated to either Jupyter Notebooks or a collection of code snippets shared over Slack.

The goal of this article is to give you a working knowledge of how to make a script executable from anywhere on your mac. This tutorial is going to touch on many different topics. In order to keep it short, I will not be going into detail on any of the steps. I will include links for further reading for those curious.

In addition, I use z-shell and a mac. All of these steps will work if you are using either z-shell or bash (replace **zshrc** with **bashrc**).

Tutorial Outline:

1) Check you have python3 and that it is up to date2 ) Create a simple example program to print to stdout3 ) Learn how to make your script executable4 ) Add the script to a new source path so it is callable in any directory

1) Check you have python3 and that it is up to date

If are new to computer science like me, you may not be aware of where you have installed Python3, or if you have it installed at all. Let’s make sure you have it in the correct directory. This article gives an overview of what we are about to do if you are hesitant.

All of the following steps are going to occur inside your terminal.

Image for post

Open your terminal and let’s get coding!

Let’s check that you have python3 installed. To do this, we are going to call the which function. which will search your PATH variable for the location of python3.

#python3 #command-line #python #learning-to-code #data-science

Creating a data scientists tool belt.
1.30 GEEK