Meta

Category: python

You need Python! And, when it is not installed on your computer, this post is for you. The instructions are for Windows users, because mac users have Python pre-installed and Linux users can figure out how to install Python on their own.

Go to the Python website and download the latest Python version. Currently, there are two major Python versions. The old Python, which is version 2.7.xx and the new Python 3.xx.xx. A lot of external libraries did not yet get a compatibility update for Python 3, so I use Python 2.7. More information about the differences between the two Python versions can be found here.

Once you’ve downloaded the installer msi-file, run the file and choose to Install it for all users. In the Select Destination Directory window, you have the option to choose where to install Python. I prefer to install it in C:\Python27\. This is a clean path without any spaces, which will make life easy when we start coding. Continue the installation until it has finished.

Now you have Python installed on your computer, but the system does not know where to find the Python executable yet. You will need to add two paths to your system path variable. And of course, windows makes that so easy that it is just 25 clicks away. Therefore, I made a video tutorial, so you can easily follow my instructions.

Now we know that we can run Python, we want to create our first Python script. Create a new text file on your desktop and call it ‘MyFirstScript.py’. Edit the file and add the following code:

This small program prints a message, asks a user for input and then responds based on the user input. To run your program, we need to start the cmd where we created the Python file. I told you to do this on your desktop, so we will start a cmd there. The easiest way to start a cmd in a certain folder is to shift-right-click in that folder and then choose ‘Open command window here’.

In the cmd window, type python MyFirstScript.py and press enter. The program will ask you a question and you can answer with Y or N. Confirm your answer by pressing enter and the program will respond. You just created your first Python program!

Before I start posting about what I created, I thought it would be nice to make a short overview of software tools that I use for creating stuff.

My favorite 2D software tool is Inkscape. It is a vector drawing program and completely free (unlike Adobe Illustrator). To me it is the go-to program for everything that I need to lasercut. It automatically contours bitmap images, can do boolean operations on shapes, imports a lot of formats and exports to almost any file format.

For most of my 3D design, I use Google Sketchup. I really love the simplicity of the 3D drawing, which is completely different from any other CAD program I’ve used. I can sketch things like houses or furniture very quickly to get an idea of how an interior will look like. But also basic parts can be created for 3D printing with a proper STL export plugin.

Some 3D models are better to create as parametric designs. OpenSCAD is a program for creating 2D and 3D shapes in a kind of programming language. For a software developer like me, it makes sense to use this tool. But I can imagine that this program has a very steep learning curve for the ‘normal’ people.

To 3D print your designs, you will need to slice your 3D objects (STL file) into layers and calculate the machine code for the 3D printer (gcode). Cura is such a free slicer, which is created by the same guys of the Ultimaker. I love this software for its simplicity and it gives me very good 3D prints.

I use several programming languages, but my go-to language for making stuff will always be Python. This language is open source and comes pre-installed on OSX. The language has a peculiar syntax that will scare any Java or C++ programmer at first. But once you embrace the simplicity of this language and its millions of free external libraries, you see how powerful Python really is. Python works for a simple 10-line script up to an application with a full GUI with 3D interaction possibilities.

I believe that these 5 programs should be installed on the computer of every real maker. If you don’t agree, let me know in the comments ;-).