Presentation is loading. Please wait.

Presentation is loading. Please wait.

User Interfaces and Libraries

Similar presentations


Presentation on theme: "User Interfaces and Libraries"— Presentation transcript:

1 User Interfaces and Libraries

2 User Interface What do we mean by a user interface?
The user is the person who is using the computer. A user interface is what he or she sees (or hears) when software is running on the computer. It controls how they operate and interact with the computer

3 Types of User Interface
What methods can people use to input data or operate computers? Graphical user interface / WIMP Command line interface Natural language Speech recognition Hand-writing recognition

4 Command Line The computer is operated using a limited number of specialised commands, e.g. DOS

5 Menu Driven Applications have menus, but they are part of the program – unlike menus in Windows

6 Graphical User Interface
There are no commands to learn! Also known as WIMP (windows, icon, mouse, pointer)

7 Form-Based Applications
Applications with a GUI tend to work in a slightly different way – they use fields, buttons and other controls on forms and functions are triggered by events.

8 WYSIWYG What you see is what you get:

9 WYSIWYG Applications haven’t always been like that – this is WordStar, a popular word processor from the 1980s:

10 Open the pod bay doors, HAL
Natural Language Talking to the computer as though it were a person… Open the pod bay doors, HAL

11 Voice Recognition For control or dictation

12 Programming the Interface
Natural language interfaces and voice recognition are a bit beyond the GCSE course! Menu-based applications don’t require any programming techniques that we haven’t looked at already. Form-based applications can also be created in Python using a library called tkinter.

13 Library Functions Libraries contain functions that aren’t part of Python but can be used in programs. You may already have used a library function to create random numbers. You can use library functions in one of two ways, e.g. import os gives access to all of the functions in the os library, but they must be prefixed with the library name, e.g. os.system(‘cls’) from random import randint allows access to the function without using the prefix

14 Useful Functions When creating a menu-based application, you might find the following functions useful: The following function will clear the screen: import os if os.name == ‘nt’: os.system(‘cls’) else: os.system(‘clear’) Note: some library functions are OS specific.

15 Useful Functions The following function will clear the screen: from msvcrt import getch option = getch() This is a way of getting user input without using input() or raw_input(). It only allows you to enter a single character, but you do not need to press the enter key after pressing the key. This can be useful for choosing menu options.

16 Tkinter tkinter is a library that allows you to create form-based applications in Python. We are not going to look at form-based applications now, but you can do some investigation using the examples I have linked to this week’s assignments. If you really want to create form-based applications, my personal recommendation would be to use another programming language, such as Visual Basic.


Download ppt "User Interfaces and Libraries"

Similar presentations


Ads by Google