Presentation is loading. Please wait.

Presentation is loading. Please wait.

Let's Learn Python and Pygame

Similar presentations


Presentation on theme: "Let's Learn Python and Pygame"— Presentation transcript:

1 Let's Learn Python and Pygame
Aj. Andrew Davison, CoE, PSU Hat Yai Campus 1. Starting

2 0. Computers and Programs
A computer is a machine that stores data. A program is a set of instructions that tells a computer what to do with the data.

3 Why Learn to Program? Makes you a clever user of computers It's fun!
You make stuff (programs) that do things Helps you learn problem solving skills Programmers get jobs

4 Why Learn Python? The Python programming language is aimed at beginners It's easy to learn and use Powerful Lots of program libraries Free Runs on everything Lots of users; lots of help online Used in the real world

5

6 1. Installing Python on your PC
1. Go to the Python webpage 2. Download version (or higher) 3. Wait a while ... 4. Start Installer 5. Click PATH and press "Install Now" 6. Click "Close" at end 7. Check the Menu for Python

7 Python Webpage click here

8 Python Download Page click here

9 Wait for Installer to Appear on your PC

10 Start Installer click here

11 Click PATH & Press "Install Now"

12 Setup in Progress

13 Press Close at End of Installer

14 Check the Menu for Python

15 2. Start IDLE (a Python editor)

16 Inside IDLE I typed help() and <enter> to start "help"
I typed quit to leave "help" but still be in IDLE

17 Get Python to do Things I typed these and <enter>

18 Some Math Operations no fraction part
remainder 2 to the power 5 no fraction part and ( ... ) around the maths, if you want

19 Some Maths to Try

20 Leaving IDLE and Python

21 Other Ways to Leave IDLE
>>> exit() Any one of these >>> quit() There are various ways to quit interactive Python. There are two commands which are equivalent for our purposes: quit() and exit(), but the simplest is the key sequence [Ctrl]+[D]. >>> Ctrl D +

22 3. Programming with Python in IDLE

23

24 4. Writing a Python Program
1. Start IDLE 2. Create a new program file 3. Write a Python program into the file 4. Save the program file. give the file a name, e.g. test1 5. Check the file is on your PC

25 Create a new Program File

26 Write a Program into the File

27 Save the program file

28 Type in a File name I'm saving the file as "test1" on the Desktop

29 Check the file is on your PC
The file is called "test1.py" on the Desktop

30 5. Running your Program in IDLE

31 Open (Load) test1.py

32 Run the program using "Run Module" (F5)

33 Python Runs (Executes) your Program

34 6. Python Documentation (docs)

35 Or from Help in IDLE

36 The First Doc Page


Download ppt "Let's Learn Python and Pygame"

Similar presentations


Ads by Google