Documentation 10. Input Devices 11. Applications and Implications 12. Output Devices 13. Interface and Application Programming 13.1. Interface and Application Programming 13.2. Installing Python 13.3. Hello World! Assignment
'No one prays for the events that teach us a lesson and make us wiser.'
African Proverbs

Interface and Application Programming

What is Interface and Application Programming?

An interface is a description of the actions that an object can do. An interface is a programming structure/syntax that allows the computer to enforce certain properties on an object (class) (Reference). It is a description of all functions that an object must have in order to be regarded as a member of that class. For example, say we have a car class and a scooter class and a truck class. Each of these three classes should have a start_engine() action.

There are lots of Interface programming (Java, C++, C, Python, Processing, etc), out which Python sits at the top of the chain due to its ease-of-use, and its ease-of-being-understood. Therefore, I will be laying a little emphasis on how to get going with this programming language. You can thank me latter.

Python

Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python's design philosophy emphasizes code readability with its notable use of significant whitespace. Its language constructs and object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects (Reference). I cannot help but wonder why the creator chose the name 'Python'. I can only guess it is due to the similarities between gigantic and nonvenomous nature of the 'Pythonidae' snake out of which its name was derived to represent the enormity of the rpogramming language to interface with other languages, as well as its ease-of-use and ease-to-learn representing the nonvenomous nature of its earthly progenitor.

Did you know

'Abomey', a town in the 17th century Dahomey Kingdom in now Benin Republic (A West African country), means 'inside the belly of a snake!' However, history did not make mention of the type of snake being referred to here. One can only guess that any snake big enough to harbour a whole town could be from the Pythonidae family. So I guess they would be natural Python programmers! Another thing about the Dahomey is that the Fon People believed that they are the descendant of a great 'Black Panther'! The Black Panther movie was a close representation of the Dahomeys, this includes the usage of Fierce Female Warriors, as well as the 'Crosshand Greetings'. Wakanda Forever!

Installing Python

Python can be downloaded and installed HERE. See picture below.


Once done downloading the software package, you also need an easy to use IDE. My Fab Instructor recommended 'PyCharm'. This con be downloaded from this Website. Please ensure to download the community version.


After the download, you are now ready to start creating some cool interfaces. So launch the installed software, and if needs be you have to install some packages. This will be treated in the succeeding section below.

How to install a Library Package on Python
  • 1. Go to File
  • 2. Settings
  • 3. Click Project Settings
  • 4. Select Python Interpreter
  • Note: Please note that the 'Python Interpreter' will display the settings you already have installed on your program. Just as depicted below. To add



  • 5. To add more library packages, click on the plus (+) sign on the far right wing of the page. See picture above. Search through the list for the package you require, then click 'Install Package' to finalize the job.


  • Hello World!

    After having successfully installed the python IDE, now we need to get going learning how to code like the gods. Just as the first word a baby utters is a thing of joy to the parent, here you will learn how to make your first statement in Python.

    In Python, making your first statement is as simple as just ordering the IDE to print something. However, the syntax of the language must be understood in order to avoid frustration. To order the IDe in a meaningful way, you need to write the command

    print("...")

    You need to understand the following about the code given above:

  • 1. Parenthesis is mandatory to make the code run.
  • 2. Double quotation marks are needed so the machine can identify the text as a string.
  • 3. There is no need for a semi-colon (;), which is used to execute lines of code in other object-oriented programming languages like C++, C etc.
  •     
            #Hello World Welcome to Python
          
    print("Hello World!") print("Just testing some line of codes") print("Still printing rubbish") print("Always printing")

    The result is displayed at the bottom of the picture below.

    Lastly, you can now proceed to this week's assignment HERE.