Python is a powerhouse programming language capable of supporting your programming needs to upper limits of your imagination. Python is open source and and excellent place to start learning to program. This guide will be a rundown on Python, the open-source programming language built by the hugely intelligent Guido van Rossum.
Hey gang! Tim here from Core Electronics and today we're swerving off into the programming language of Python.
Programming is something that every modern maker should have some grasp of. In this tutorial I'm going to give an overview of Python and a rundown of the main windows you're going to encounter, now put simply programming is the process of creating instructions for a computing device to comprehend and execute. So these instructions are referred to as a software program, once the software program is run on the computing device it will perform the specified tasks, programming language is a set of commands, directives and other syntaxes which gives you a vocabulary to create these software programs.
Python is one of these programming languages built by the hugely intelligent Guido van Rossum in 1991, which allows you to control the computer in whatever way you please. Now worth noting, there are several other programming languages out there that can be used to control computing devices, picking one often comes down to personal preference but Python is an excellent place to start, let me explain why, starting off, Python is available online, open source and is completely free with over 8.2 million developers running it worldwide Python is also ranked as one of the top 10 most popular programming languages, it is compatible with major platforms and systems and as such will run excellently from your full-scale desktop all the way down to your little Raspberry Pi.
Python can also work with other programming languages and is a growing language with more users every single day. A core aim of Python is to keep the programming within its language button, it does this by using syntax with high human readability, the formatting is visually uncluttered and often use full English key words whereas other languages would be using punctuation or abbreviations, programmers can often become preoccupied with minimizing the execution time with their code, however it is worth realizing that development time often usually takes the longest. This language wants to be enjoyed so it's no wonder that python derived its name from Monty Python, the British comedy group, so let's head up some nitty-gritty.
Python is an interpreted high-level object orientated, general-purpose programming language so let me break this down, an interpreted language is one where most of its implementations execute instructions directly and freely without the need to compile the language into machine code, machine code is usually written in binary, I'm talking the ones and zeros and is the lowest level of software within any kind of computing device. A high-level programming language is one which focuses on human usability instead of peak program running efficiency, there is a strong difference between the specific processes of the computing device compared to what is programmed by the human. Object orientated programming is one where the user defines the type of a data structure and the operations that can be applied to that structure. A general-purpose programming language is one which is designed for writing software with the widest variety of application domains, let me be clear Python is an absolute powerhouse programming language capable of supporting your programming needs to the upper limits of your imagination.
The best way to understand Python is to jump right in and practice, so use this video as an initial reference, there are three main Python screens, these are the Python command-line shell, the Python idle shell, the Python program window, this part of the screen it's a Python command line shell, also simplified as the Python shell this window represents a mode in which we can interact with the Python programming language, it allows for programming, operating under a read evaluate print cycle this is also referred to as a looping structure this process is continuously occurring while the Python shell is open. So, after entering a line of code, the looping structure will feed back the results straight away, so examples of this can just be simple addition, whipping out the keyboard check out this “6 6”, gives it to you straight away, feeds back the information instantly. So, the problem with this type of setup is if you make a mistake or if you need to change your previous line in a chain of connected code, you're going to have to redo all of the code.
Moving on here's the Python idle shell which shares a lot of features with a Python command-line shell, idle is short for integrated development environment, like the Python command-line shell it allows for interactive programming with a continuously operating looping structure, I'll show you once again with simple addition “5 3=8, 7 6=13” and it loops through it straight away, crucially this window has several drop-down menus at the top of the window starting over here under the file menu we can save open and make new windows, under the edit menu we have complete editing control including cut and paste and there's also numerous searching capabilities, under the shell menu we have the ability to completely restart Python wiping all the current information.
Under debug menu there are some simple debugging capabilities, the option menu lets you configure the Python idle shell, this is the location to dive deep into Python editing, changing the actual programming which you can do since there's an open source software, the windows menu allows easier navigation between different Python windows you have open, the help menu gives information on the Python version and links to the help documents, help menu also has a turtle demo which shows some really cool examples of code. So, the commands are still one by one so if you make a mistake or if you need a change of previous line you're going to have to re-enter and rewrite all the commands however the Python code hints and syntax checking will occur in this window, finally here's the Python program window, it has not been saved so currently it is named untitled. Files are saved as Python files denoted by “.py” to access the programming window, go into the Python idle shell, go into the file menu and select new file, this will open a new programming window.
This window lets you write complete software programs, you can edit, save and reuse the work you have created this window is not undergoing a continuous looping structures so you can enter multiple command lines, commands will not run after you have typed a line of code. Syntax indentation will also automatically occur, it will also give suggestions on what to write and structure hints as you are coding so looking at the drop-down menus at the top of the window, they are also slightly different, you now have a run menu which allows you to execute all the code written, when you select the run module from this menu it will jump you to the Python idle shell and display the results of the Python programming window, you can also press f5 on your keyboard to run the code if you want to make a change to the code you can then switch back to the Python program shell and change it in there.
It is very common when developing code in Python to be constantly jumping between the Python programming shell and the Python idle shell, there is also a format menu which gives you a lot of control regarding syntax. If Python has you interested you can go to this website to download Python on your computer “python.org/downloads/Windows” or “Mac” depending what you're using, there are also online Python emulators that you can use and there's also several related tutorials and write-ups about this content available on our website to help you become the true Pythonista you deserve to be! I hope this has been helpful and inspired program pursuits in your life until next time stay cosy!
Makers love reviews as much as you do, please follow this link to review the products you have purchased.