What Are Environment Variables?

What the heck is an Environment Variable?

You may have heard someone mention setting your environment variables. Maybe you were troubleshooting getting your Python interpreter to run your script when you first started learning Python. So, what are these things called environment variables? Well, I’ll try to explain what they are in a way that makes sense.

The easiest way to think about environment variables is that it is a specific variable that can be referenced by code to get a file system location. This location may vary from one person’s file system to another. For instance, if you wanted to know the location of the myMagicApplication.exe executable, you need some way to determine where it was installed. Because you can choose where to install it during installation, you can’t just reference the default location in you program, because it will vary from one machine to another. But with an environment variable, you could reference a static variable that will always point to the installation location. This is what environment variables do.

Read More …