Saturday, May 5, 2018

My First Program "Hello world!" and Gettign Help Inside Python

Our first program will be called hello_world . It will use the print function.

Open the GUI (see previous post).
In the top menu, clisk save as and give your file the name hello_world . Save it anywhere you want.
The first thing to learn is comments.
If you put the sympol # you can write text about your program and it will be ignored and recognized as notes.

So we will start with this:
# My first program to print "Hello world!"    hit the ENTER key
Notice that because it is a comment it turns red.


Whenever you add something it is always good to save so you don't lose your work. Remember though that save will also overwrite you previous file. So, if you use the same name and location for 2 files you will lose the old one. It will be gone forever! Be careful. Also, if you had many hours in a project, it would be advisable to save it in stages in case you ever messed things up and wanted to go back without having to start all over. To do that, you might save hello_world 2, then hello_world 3. Even better would be to add a date such as: hello_world jan25,18 .

Next type print ("hello world") and push ENTER
This is the print function. It displays a value on the screen.


Did you notice my spelling error?
Save your work.

Getting Help in Python
If you type help() and hit ENTER, you will enter Python's help utility.
To exit the utility, type quit at the prompt and ENTER
To get help on a module, keyword, symbol ot topic, type it in the brackets. For example:
Trype help(print) to get help with the print function.


Getting Started: The Software

I will be working on a Windows environment. My computer has Windows 7. I will be installing a newer verion of Python. It is 3.4.1 The reason I am uning this verwion is that it was required by my college course.
You can download Python online at: https://www.python.org/downloads/

Once I installed it, I have several things available in the Windows Start All Pograms Menu. The actual programs are:
1. IDLE (Python GUI)
2. Python (Commend Line)

If I click on IDLE (python GUI), I will see this:


GUI stands for "Graphical User Interface"

Is this a real graphical interface? Yes, but it is very limited. The menu is the main benefit but there are not mcuh else to help you out. If you want to know more about what a graphical interface is, watch this: https://www.youtube.com/watch?v=U1Oy4X5Ni8Y

Now let's open the Python (Command Line) and see what we get.


Notice that there are no menus and just a flashing cursor waiting for you input. This interface is very difficult to use because you must memorize commands to do things that the GUI can do automatically.

Introduction: Why this blog?

I am taking a college course about computer programming. We are using the Python computer languge. I am having a lot of difficulty. Even in our manual there are many mistakes. I get exercises and even if I copy and paste the examples, they don't work. I have looked at tutorials online and they also aren't very good. So, I will write about my journey here in order to help some of you navigate the learning process.
If you find mistakes here, please let me know so I can make it easier for the next learner!

Many times when experts teach something, they are approaching it from there own knowledge, not my lack of it! So, some things they assume we know may be very difficult for us. So, if while you are here you get tired of easy and simple explanations, sorry. And, if I make something too complcated for a begiiner, again, please let me know! Thank you!!!

Feeling like this!