From the course: Programming Foundations: Fundamentals

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Running your code

Running your code

- If we were to double click our Python file, it would just open in an editor, but it wouldn't do anything with the code that we put inside. Why is that? Well, it's because Python is an interpretive language. This means we have to interpret it into machine code and we haven't run the interpreter yet. There are three main ways to translate source code into machine code: compile it, interpret it, or an combination of both. Compile, interpret? Let me give you a real world example. Say you need to write a letter to someone who speaks Mandarin, but doesn't speak English. What would you do? You could first write it in English then use a translation service to convert your letter into Mandarin and mail it. The other person would never see your original letter, only the one that was in Mandarin. That's basically what compilers do. They take your high level programming language and turn it into an executable that contains low…

Contents