Download presentation
Presentation is loading. Please wait.
Published byMarlene Wood Modified over 9 years ago
1
Introduction to Python By Neil Cook Twitter: njcuk9999 Email: neil.james.cook@gmail.com Slides/Notes: star.herts.ac.uk/~ncook/pythonneil.james.cook@gmail.com
2
3.0 Interacting with your script
3
The input function 1 3.0 Interacting with your script
4
The input function 2 3.0 Interacting with your script
5
The input function 3 3.0 Interacting with your script
6
Type function 3.0 Interacting with your script
7
The input function 4 3.0 Interacting with your script
8
The input function 5 3.0 Interacting with your script
9
The raw_input function 1 3.0 Interacting with your script
10
The raw_input function 2 3.0 Interacting with your script
11
The raw_input function 3 3.0 Interacting with your script
12
Exercise 3.0a 3.0 Interacting with your script
13
Solution 3.0a 1 3.0 Interacting with your script
14
Solution 3.0a 2 3.0 Interacting with your script
15
3.1 Functions
16
Defining Functions 3.1 Functions
17
Syntax 1 3.1 Functions
18
Syntax 2 3.1 Functions
19
Syntax 3 3.1 Functions
20
Syntax 4 3.1 Functions
21
Syntax 5 3.1 Functions
22
Syntax 6 3.1 Functions
23
Exercise 3.1a 3.1 Functions
24
Solution 3.1a 3.1 Functions
25
Built-in functions 3.1 Functions A full list of built-in functions is available here. http://docs.python.org/2/library/functions.html http://docs.python.org/2/library/functions.html Note that there are not that many - these are only the most common functions. Most functions are in fact keep inside separate modules (i.e. in numpy, matplotlib etc).
26
Scope 1 3.1 Functions
27
Scope 2 3.1 Functions
28
Global Scope 1 3.1 Functions
29
Global Scope 2 3.1 Functions
30
Local vs Global 1 3.1 Functions
31
Local vs Global 2 3.1 Functions
32
Exercise 3.1b 3.1 Functions
33
Solution 3.1b 3.1 Functions
34
3.2 Defining Modules
35
Defining Modules 3.2 Defining Modules
36
Syntax 1 3.2 Defining Modules
37
Syntax 2 3.2 Defining Modules
38
More on Importing Modules 1 3.2 Defining Modules
39
More on Importing Modules 2 3.2 Defining Modules
40
Executing Modules as Scripts 3.2 Defining Modules
41
The Module Search Path 1 3.2 Defining Modules
42
The Module Search Path 2 3.2 Defining Modules
43
The Module Search Path 3 3.2 Defining Modules
44
3.3 Reading and Writing Files
45
In the rest of this sub-section we will be using this file: co2data.txt
46
3.3 Reading and Writing Files
47
Reading Files 1 3.3 Reading and Writing Files
48
Reading Files 2 3.3 Reading and Writing Files
49
Reading Files 3 3.3 Reading and Writing Files
50
Reading a file line by line 3.3 Reading and Writing Files
51
Separating the data columns 1 3.3 Reading and Writing Files
52
Separating the data columns 2 3.3 Reading and Writing Files
53
Creating a script 3.3 Reading and Writing Files
54
Exercise 3.3a 3.3 Reading and Writing Files
55
Solution 3.3a 3.3 Reading and Writing Files
56
Exercise 3.3b 3.3 Reading and Writing Files
57
Solution 3.3b 3.3 Reading and Writing Files
58
Convenient Function 1 3.3 Reading and Writing Files
59
Convenient Function 2 3.3 Reading and Writing Files
60
Writing Files 1 3.3 Reading and Writing Files
61
Writing Files 2 3.3 Reading and Writing Files
62
Exercise 3.3c 3.3 Reading and Writing Files
63
Solution 3.3c 3.3 Reading and Writing Files
64
Problems 3 3.4 Problems 3
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.