Python Programming For Beginners Lesson 1 - Installing IDE/Hello World
Introduction
Hello Everyone and welcome to my first lesson of a new series about the Python language. I have just finished a series on the Java programming language which can be found here https://steemit.com/programming/@robertlyon/java-programming-for-beginners-course.
This python course will cover the same format but will obviously be focusing on the Python language which although has similarities to the Java language, it is actually quite different and I would say a lot easier to learn.
In this first lesson, I will be covering how to set up your computer so that you have the tools to work with the python language and how to create and run your first Python program which will be a simple Hello World application.
So let's dive straight in.
Installing Python
To find the download for the latest version of Python you will have to go to the Python Website which can be found below
https://www.python.org/downloads/
This link will bring up a webpage that looks like the one below.
Figure 1. Download screen on the Python website.
As you can see above I have added a print screen of the downloads page on the official Python website. On this page, you will want to download the latest version of the software which is marked out with a red circle. Also, take note of the second red circle. If you have a do not use Windows then you can find the download file for your own OS.
After you have downloaded the installer you need to execute the installer, you can then execute the program. The first screen you will be presented with is the one below.
Figure 2. Python install wizard screen 1
On the screen above, click Install Now which is shown by the red circle.
After you have clicked Install Now, the install wizard will install all of the necessary Python files and you will be presented with the following screen.
Figure 3. Python install wizard screen 2
This window just tells you that the install was successful, click on the close button marked by the red circle to carry on.
After pressing close, use the search feature of your operating system to search for IDLE, this is the IDE that comes standard with Python and it is the one which we will be using for the remainder of this series.
Figure 4. Searching for the Python IDLE
Once you have clicked on the idle application you will be presented with the following screen.
Figure 5. The Python Shell
The program in the image above is named the Python Shell, you can think of this like the command line, this is where your program will run and will become more apparent throughout the series.
Now you are going to start writing your first Python program.
Hello World Program
To start this program we need a text editor. Luckily the Python IDLE program contains a text editor to access that we need to go to file and click new file(alternatively you could press "Ctrl + N"). See image below for a demonstration.
Figure 6. Creating a new file.
Now we will write out the program. If you are familiar with my Java tutorial series or a language such as C++, you will see how much simpler Python is for creating small programs such as this. Have a look at the image below, the syntax is fairly self-explanatory but I will cover the key points.
Figure 7. Hello World program
As we can see above this program only consists of 1 single line. The function print()
in python prints out whatever is contained within the parentheses to the console which we can see in the next two images below which will show you how to execute the program.
Figure 8. How to run a Python file in the shell
Figure 9. Output from a Hello World application
As you can see above, while you are on the text editor screen you go to the run menu and click on run module(or you can just press F5).
On the second image, you can see that the program has printed out the string value "Hello World" to the Python shell.
Congratulations you have just created and run your first program.
Conclusion
This program was designed just to be a very simple introduction to the IDLE program for python and a test to make sure that the language was downloaded and installed properly on your machine. Hopefully, you now have the python language and the IDLE program installed on your computer and you are now able to run Python programs.
Look forward to my next lesson on variables.
As always if there are any improvements you think I can make to this post then please leave a comment and I will consider adding it.
Thank you for reading and I hope that someone will get some use out of these tutorials.
Message to readers
Thanks for taking the time to read my post, if you are interested in Science, Technology or Computer Science then check out my blog, content is a little sparse at the moment but I am making an effort to provide good quality original content to the Steemit community.
Come and learn how AI processes images :)
Thanks, i'll check it out :)
Hello @Robertlyon
I love the initiative you took to start a python tutorial for we steemians. I'd really love to be a part of this course but I don't have a pc. My pc was stolen not long ago but I actually did some googling and I found an ide made for the android os. Here is a link to where the project is. I want to ask if it's a good idea to learn with the android os. I look forward to your response.
@geniusvillain
Thanks for your comment :). I have used QPython very briefly before and I would say that you could learn the basics on with QPython on Android but it will be more difficult and creating larger projects would be harder after you have learned the basics. Although if Android is your only option then you should give it a go and see how far you can get :).
I guess I'd have to follow up and manage with an android device till I get me another PC.
Yeah, you will still be able to understand the basics of the language and programming in general but progress would be a little bit slower. Have a look at the QPython guide here http://www.qpython.org/en/guide.html This should be able to get you up to speed with the app and get you started :)
Nice tutorial, I'm working on a JavaScript course... Something that I recently started using is giphy CAPTURE in order to capture gifs for the readers to better follow along, I feel like it significantly improved my lesson...
Thanks for the comment :), I will have a look into that, giphs sound like a good way to go. Sometimes I feel that I am putting too many pictures into a post so a giph would be a good way to cut that down.
This post series is perfectly timely for me! I know quite a few languages, but python is not one of them. I just learn the intro to cs class I’m helping teach is going to use Python and I need to get in gear and get ready to teach it!
Awesome, I will only be covering the basics of the language here mainly covering the basics of programming but I will cover the basic language syntax. If you have any questions about Python feel free to leave a comment and ill try my best to answer them for you :)
This is great! You should consider doing a 'installing Python with virtual environments' tutorial. Or maybe another version of this showing procedures with different OS's? Good write-up though. THe more people working on their programming skills, the better. It'll be (and kind of already is) the 'tradesman' skill of the future.
Good points, I like the idea of doing a virtual environment tutorial but usually, people that know how to set up a virtual machine will usually know how to install a simple application such as Python and those who don't will probably need to be shown how to set up the virtual machine which could be a tutorial series in its own right. Thanks for the ideas though. :)
I agree programming could be set to become a working-class job soon. We need more of a coding community here on Steemit.
Hmmm. That's totally fair. It's a weird mish-mash of beginner knowledge and intermediate knowledge.. Maybe something more dialed in to "why virtual environments are useful". Either way -- I dig the post and will definitely follow for more. Keep it up.
Yeah, it has given me an idea for another series of tutorials so there could be some virtual machine/Linux stuff coming in the future. Thanks for following :)
Congratulations @robertlyon! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOP
This post received a 8% upvote from @morwhale team thanks to @robertlyon! For more information, click here! , TeamMorocco! .
You got a 4.68% upvote from @upme requested by: @robertlyon.
Send at least 1.5 SBD to @upme with a post link in the memo field to receive upvote next round.
To support our activity, please vote for my master @suggeelson, as a STEEM Witness
This post has received a 2.35 % upvote from @buildawhale thanks to: @robertlyon. Send at least 1 SBD to @buildawhale with a post link in the memo field for a portion of the next vote.
To support our daily curation initiative, please vote on my owner, @themarkymark, as a Steem Witness