SlideShare a Scribd company logo
Python for geo-people
www.helsinki.fi/yliopist
o
Automating GIS-processes
FEC 2017
Lecturers: Vuokko Heikinheimo & Henrikki Tenkanen
vuokko.heikinheimo@helsinki.fi
henrikki.tenkanen@helsinki.fi
6.3.2017
Materials: Henrikki Tenkanen, David Whipp, Vuokko Heikinheimo
www.helsinki.fi/yliopist
o
Python for geo-people
Goals of the course
There are basically four goals in this intensive course
1. Introduce the Python programming language
2. Develop basic programming skills
3. Discuss essential (good) programming practices needed by
young scientists
4. Introduce automatization of different GIS tasks in Python
www.helsinki.fi/yliopist
o
Python for geo-people
Goals of this lecture
• Provide an overview of basic computing practices, and
why you should learn them
• Define computers and programming languages, and how
they operate
• Look at the components of a computer program and a
strategy for writing your own code
www.helsinki.fi/yliopist
o
Python for geo-people
Learning to program
• A significant part of this course will be development of
basic programming skills that will help you write and use
simple numerical models
• I know you’re not computer scientists - I’m not either
• Our goal is take small steps to learn together
• Do you really need to know how to program? Yes.
• You might not be a superstar, but learning to write
simple codes can be very useful
www.helsinki.fi/yliopist
o
Python for geo-people
Why learn to program?
• Rather than being restricted to using existing software,
you will have the ability to develop your own solutions
when solutions do not exist or are inefficient
• Many software packages offer the ability to extend
their capabilities by adding your own short programs
(e.g., ArcGIS, ParaView, Google Earth, etc.)
www.helsinki.fi/yliopist
o
Python for geo-people
Python can be called directly from ArcGIS
www.helsinki.fi/yliopist
o
Python for geo-people
Why learn to program?
• Believe it or not, programming is fun! It
involves
• Breaking complex problems down
into simpler pieces
• Developing a strategy for solving the
problem
• Testing your solution
• All of this can be exciting and rewarding
(when the code works…)
www.helsinki.fi/yliopist
o
Python for geo-people
The scientific method…
…and how programming can make you a better
scientist
1. Define a question
2. Gather information and resources (observe)
3. Form an explanatory hypothesis
4. Test the hypothesis by performing an experiment and
collecting data in a reproducible manner
5. Analyze the data
6. Interpret the data and draw conclusions that serve as a
starting point for new hypothesis
7. Publish results
8. Retest (frequently done by other scientists)
www.helsinki.fi/yliopist
o
Python for geo-people
Learning to program can help us…
1. Define a question
2. Gather information and resources (observe)
3. Form an explanatory hypothesis
4. Test the hypothesis by performing an experiment and
collecting data in a reproducible manner
5. Analyze the data
6. Interpret the data and draw conclusions that serve as a
starting point for new hypothesis
7. Publish results
8. Retest (frequently done by other scientists)
www.helsinki.fi/yliopist
o
Python for geo-people
Good programming practices can help
us…
1. Define a question
2. Gather information and resources (observe)
3. Form an explanatory hypothesis
4. Test the hypothesis by performing an experiment and
collecting data in a reproducible manner
5. Analyze the data
6. Interpret the data and draw conclusions that serve as a
starting point for new hypothesis
7. Publish results
8. Retest (frequently done by other scientists)
Python for geo-people
www.helsinki.fi/yliopist
o
Programming
“Computer programming (often shortened to programming) is a process
that leads from an original formulation of a computing problem to
executable computer programs. Programming involves activities such as
analysis, developing understanding, generating algorithms, verification of
requirements of algorithms including their correctness and resources
consumption, and implementation (commonly referred to as coding) of
algorithms in a target programming language.”
-Wikipedia (2015)
“A program is like a recipe. It contains a list of ingredients (called
variables) and a list of directions (called statements) that tell the
computer what to do with the variables.”
- Webopedia (2015)
www.helsinki.fi/yliopist
o
Python for geo-people
What is a program?
• A program is a detailed
list of step-by-step
instructions telling the
computer exactly what to
do
• The program can be
changed to alter what the
computer will do when
the code is executed
• Software is another name
for a program
# Define plot variables
misfit = NA_data[:,0]
var1 = NA_data[:,1]
var2 = NA_data[:,2]
var3 = NA_data[:,3]
clrmin = round(min(misfit),3)
clrmax = round(min(misfit),2)
trans = 0.75
ptsize = 40
Fortran punchcard
Python source code
www.helsinki.fi/yliopist
o
Python for geo-people
What is a programming language?
• A computer language is what we use to ‘talk’ to a
computer
• Unfortunately, computers don’t yet understand our
native languages
• A programming language is like a code of instructions for
the computer to follow
• It is exact and unambiguous
• Every structure has a precise form (syntax) and a
precise meaning (semantics)
• Python is just one of many programming languages
Python for geo-people
www.helsinki.fi/yliopist
o
High level
programming
Low level
programming
Less code
More code
Slower
Faster
Various different programming languages exist
• Python
• Perl
• Ruby
• JavaScript
• Java
• C++
• C
• Fortran
+ Many others
Programming languages remind our spoken languages!
• There are different ways to express the same meaning
• Some languages are more similar to each other than others
• After learning one language it is easier to learn other ones!
Programming
Moikka, Hello, Hej, Hallo, Hola
echo ”Moikka”, print(”Hello”), console.log(”Hej”),
puts(”Hallo”), System.out.println(”Hola”)
Spoken languages Programming languages
Python for geo-people
www.helsinki.fi/yliopist
o
Python is:
• General purpose
• High level
• Cross-platform
• Open source
• Multi-paradigm: Object oriented / imperative / functional / procedural / reflective
• Uses dynamic type-checking
Why to learn / use Python?
• Easy to learn (a good programming language for the beginners)
• Easy to read and understand – elegant code
• Powerful enough – used in scientific programming
• Countless ready-made modules / libraries to use (also GIS stuff)
• Supportive, large and helpful user community
• Widely supported in different GIS-softwares
- ArcGIS, QGIS, Erdas Imagine, IDRISI, uDig, ILWIS, PostGIS …
• Extremely useful for automating GIS processes
Programming
www.helsinki.fi/yliopist
o
Python for geo-people
Developing a program
• Coming up with a specific list of instructions for the
computer to follow in order to accomplish a desired task
is not easy
• The following list will serve us as a general software
development strategy
1. Analyze the problem
2. Determine specifications
3. Create a design
4. Implement the design
5. Test/debug the program
6. Maintain the program (if necessary)
www.helsinki.fi/yliopist
o
Python for geo-people
Let’s consider an example
• As an American, David was raised in a country that uses
Fahrenheit for temperatures
• 70°F is lovely
• 90°F is hot
• Water freezes at 32°F
• The problem here in Finland is that he doesn’t always
know what he should wear to work when he finds
weather reports with temperatures in degrees Celsius
• A simple program could help
www.helsinki.fi/yliopist
o
Python for geo-people
Developing a program
1. Analyze the problem
• Before you can solve a problem, you must figure out
exactly what should be solved
2. Determine specifications
• Describe exactly what the program will do
• Don’t worry about how it will work. Determine the
input and output values and how they should
interact in the program
www.helsinki.fi/yliopist
o
Python for geo-people
Developing a program
1. Analyze the problem
• Before you can solve a problem, you must figure out
exactly what should be solved
2. Determine specifications
• Describe exactly what the program will do
• Don’t worry about how it will work. Determine the
input and output values and how they should
interact in the program
www.helsinki.fi/yliopist
o
Python for geo-people
Developing a program
3. Create a design
• What is the overall structure of the program? How will
it work?
• It is often helpful to write out the code operation in
pseudocode, precise English (or Finnish) describing
the program. Be specific!
4. Implement the design
• If you’ve done a good job with the previous steps, this
should be fairly straightforward. Take your
pseudocode and ‘translate’ it into Python
www.helsinki.fi/yliopist
o
Python for geo-people
Developing a program
3. Create a design
• What is the overall structure of the program? How will
it work?
• It is often helpful to write out the code operation in
pseudocode, precise English (or Finnish) describing
the program. Be specific!
4. Implement the design
• If you’ve done a good job with the previous steps, this
should be fairly straightforward. Take your
pseudocode and ‘translate’ it into Python
www.helsinki.fi/yliopist
o
Python for geo-people
Developing a program
5. Test/debug the program
• Now you can put your new Python code to the test
(literally) by running it to see whether it reproduces the
expected values
• For any test, you should know the correct values in
advance of running your code. How else can you
confirm it works???
6. Maintain the program
• If you’ve written something that will be shared by other
users, a helpful programmer will continue to add
features that are requested by the users
www.helsinki.fi/yliopist
o
Python for geo-people
Developing a program
5. Test/debug the program
• Now you can put your new Python code to the test
(literally) by running it to see whether it reproduces the
expected values
• For any test, you should know the correct values in
advance of running your code. How else can you
confirm it works???
6. Maintain the program
• If you’ve written something that will be shared by other
users, a helpful programmer will continue to add
features that are requested by the users
www.helsinki.fi/yliopist
o
Python for geo-people
References
Zelle, J. M. (2010). Python programming: an introduction to computer science (2nd ed.). Franklin,
Beedle & Associates, Inc.

More Related Content

PDF
What is Python? (Silicon Valley CodeCamp 2015)
PPTX
P1 2018 python
PPT
Py4 inf 01-intro
PDF
Python indroduction
 
PDF
Python for Science and Engineering: a presentation to A*STAR and the Singapor...
PPTX
Python Programming
PPTX
Mixed-language Python/C++ debugging with Python Tools for Visual Studio- Pave...
PPTX
What is python
What is Python? (Silicon Valley CodeCamp 2015)
P1 2018 python
Py4 inf 01-intro
Python indroduction
 
Python for Science and Engineering: a presentation to A*STAR and the Singapor...
Python Programming
Mixed-language Python/C++ debugging with Python Tools for Visual Studio- Pave...
What is python

What's hot (18)

PDF
Python – The Fastest Growing Programming Language
PDF
Open & reproducible research - What can we do in practice?
PPTX
Python programming | Fundamentals of Python programming
PPTX
Python programming
PDF
Python, the Language of Science and Engineering for Engineers
PDF
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
PPTX
11 Unit1 Chapter 1 Getting Started With Python
PDF
IPython: A Modern Vision of Interactive Computing (PyData SV 2013)
PDF
Software Carpentry for the Geophysical Sciences
DOCX
Seminar report On Python
PDF
python for linguists
PPTX
First python project
PPTX
PPTX
Embracing Diversity: Searching over Multiple Languages - Suneel Marthi, Red H...
PPTX
Python | What is Python | History of Python | Python Tutorial
PDF
Lets learn Python !
PDF
Python - the basics
PDF
summer training report on python
Python – The Fastest Growing Programming Language
Open & reproducible research - What can we do in practice?
Python programming | Fundamentals of Python programming
Python programming
Python, the Language of Science and Engineering for Engineers
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
11 Unit1 Chapter 1 Getting Started With Python
IPython: A Modern Vision of Interactive Computing (PyData SV 2013)
Software Carpentry for the Geophysical Sciences
Seminar report On Python
python for linguists
First python project
Embracing Diversity: Searching over Multiple Languages - Suneel Marthi, Red H...
Python | What is Python | History of Python | Python Tutorial
Lets learn Python !
Python - the basics
summer training report on python
Ad

Viewers also liked (20)

PDF
How to Become a Thought Leader in Your Niche
PPT
Generations of Programming Languages
PDF
assembly language programming and organization of IBM PC" by YTHA YU
PPTX
Fuel Up JavaScript with Functional Programming
PPTX
BTCONCEPT.BIZ MAKE MONEY WITH BITCOIN
PDF
Bitcoin, The New Great Opportunity for Entrepreneurs on the Internet
PDF
Understanding bitcoin
PPTX
Bitcoin: the future money, or a scam?
PPTX
Programmable Money - Visual Guide to Bitcoin as a Technology
PDF
Bitcoin Startup Malaysia
PPTX
Intro to bitcoin march 2013
PPTX
C programming-apurbo datta
PDF
Bitcoin
PPTX
Plc programming with fbd
PPT
Programmable logic controllers
PPT
Why Bitcoin's Rate of Adoption is Only Going to Increase
PPT
Eee3420 lecture01 rev2011
PPT
Eee3420 lecture03 rev2011
PPT
Programming logic controllers (plc)
PPT
Automationcontrol7
How to Become a Thought Leader in Your Niche
Generations of Programming Languages
assembly language programming and organization of IBM PC" by YTHA YU
Fuel Up JavaScript with Functional Programming
BTCONCEPT.BIZ MAKE MONEY WITH BITCOIN
Bitcoin, The New Great Opportunity for Entrepreneurs on the Internet
Understanding bitcoin
Bitcoin: the future money, or a scam?
Programmable Money - Visual Guide to Bitcoin as a Technology
Bitcoin Startup Malaysia
Intro to bitcoin march 2013
C programming-apurbo datta
Bitcoin
Plc programming with fbd
Programmable logic controllers
Why Bitcoin's Rate of Adoption is Only Going to Increase
Eee3420 lecture01 rev2011
Eee3420 lecture03 rev2011
Programming logic controllers (plc)
Automationcontrol7
Ad

Similar to FEC2017-Introduction-to-programming (20)

PDF
Obop 210 intro to python programming environment
PPTX
Introduction to Coding
PPT
presentation_intro_to_python
PPT
presentation_intro_to_python_1462930390_181219.ppt
PDF
ProgFund_Lecture_1_Introduction_to_Programming.pdf
PPTX
Coder dojo Limerick - introduction to programming languages
PDF
Download full ebook of Basics Of Programming Dg Junior instant download pdf
PPTX
computer programming: an introduction.pptx
PDF
Learning to code in 2020
PPTX
Introduction to Programming (well, kind of.)
PDF
Programming in Civil Engineering_UNIT 1_NOTES
PDF
one of the best python training in kochi is zoople technologies
PDF
Programming for Problem Solving
PPTX
Developing a Coding Program for Users - SWFLN Makerpalooza - Session 4
PPTX
Coding with Maker Tech
PDF
Python lec 1002_for_biologists
DOC
1 cover page
PDF
Python Programming - I. Introduction
PDF
Basics of Computer Coding: Understanding Coding Languages
PPTX
Week10 final
Obop 210 intro to python programming environment
Introduction to Coding
presentation_intro_to_python
presentation_intro_to_python_1462930390_181219.ppt
ProgFund_Lecture_1_Introduction_to_Programming.pdf
Coder dojo Limerick - introduction to programming languages
Download full ebook of Basics Of Programming Dg Junior instant download pdf
computer programming: an introduction.pptx
Learning to code in 2020
Introduction to Programming (well, kind of.)
Programming in Civil Engineering_UNIT 1_NOTES
one of the best python training in kochi is zoople technologies
Programming for Problem Solving
Developing a Coding Program for Users - SWFLN Makerpalooza - Session 4
Coding with Maker Tech
Python lec 1002_for_biologists
1 cover page
Python Programming - I. Introduction
Basics of Computer Coding: Understanding Coding Languages
Week10 final

Recently uploaded (20)

PPTX
The KM-GBF monitoring framework – status & key messages.pptx
PDF
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
PPT
The World of Physical Science, • Labs: Safety Simulation, Measurement Practice
PPTX
Introduction to Cardiovascular system_structure and functions-1
PPTX
GEN. BIO 1 - CELL TYPES & CELL MODIFICATIONS
PPTX
BIOMOLECULES PPT........................
PDF
VARICELLA VACCINATION: A POTENTIAL STRATEGY FOR PREVENTING MULTIPLE SCLEROSIS
PPTX
Taita Taveta Laboratory Technician Workshop Presentation.pptx
PPTX
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
PDF
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
PPTX
Comparative Structure of Integument in Vertebrates.pptx
PPTX
ANEMIA WITH LEUKOPENIA MDS 07_25.pptx htggtftgt fredrctvg
PDF
bbec55_b34400a7914c42429908233dbd381773.pdf
PDF
. Radiology Case Scenariosssssssssssssss
PDF
Phytochemical Investigation of Miliusa longipes.pdf
PPTX
famous lake in india and its disturibution and importance
PPTX
Derivatives of integument scales, beaks, horns,.pptx
PPTX
EPIDURAL ANESTHESIA ANATOMY AND PHYSIOLOGY.pptx
PPTX
2. Earth - The Living Planet Module 2ELS
PPTX
Classification Systems_TAXONOMY_SCIENCE8.pptx
The KM-GBF monitoring framework – status & key messages.pptx
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
The World of Physical Science, • Labs: Safety Simulation, Measurement Practice
Introduction to Cardiovascular system_structure and functions-1
GEN. BIO 1 - CELL TYPES & CELL MODIFICATIONS
BIOMOLECULES PPT........................
VARICELLA VACCINATION: A POTENTIAL STRATEGY FOR PREVENTING MULTIPLE SCLEROSIS
Taita Taveta Laboratory Technician Workshop Presentation.pptx
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
Comparative Structure of Integument in Vertebrates.pptx
ANEMIA WITH LEUKOPENIA MDS 07_25.pptx htggtftgt fredrctvg
bbec55_b34400a7914c42429908233dbd381773.pdf
. Radiology Case Scenariosssssssssssssss
Phytochemical Investigation of Miliusa longipes.pdf
famous lake in india and its disturibution and importance
Derivatives of integument scales, beaks, horns,.pptx
EPIDURAL ANESTHESIA ANATOMY AND PHYSIOLOGY.pptx
2. Earth - The Living Planet Module 2ELS
Classification Systems_TAXONOMY_SCIENCE8.pptx

FEC2017-Introduction-to-programming

  • 1. Python for geo-people www.helsinki.fi/yliopist o Automating GIS-processes FEC 2017 Lecturers: Vuokko Heikinheimo & Henrikki Tenkanen vuokko.heikinheimo@helsinki.fi henrikki.tenkanen@helsinki.fi 6.3.2017 Materials: Henrikki Tenkanen, David Whipp, Vuokko Heikinheimo
  • 2. www.helsinki.fi/yliopist o Python for geo-people Goals of the course There are basically four goals in this intensive course 1. Introduce the Python programming language 2. Develop basic programming skills 3. Discuss essential (good) programming practices needed by young scientists 4. Introduce automatization of different GIS tasks in Python
  • 3. www.helsinki.fi/yliopist o Python for geo-people Goals of this lecture • Provide an overview of basic computing practices, and why you should learn them • Define computers and programming languages, and how they operate • Look at the components of a computer program and a strategy for writing your own code
  • 4. www.helsinki.fi/yliopist o Python for geo-people Learning to program • A significant part of this course will be development of basic programming skills that will help you write and use simple numerical models • I know you’re not computer scientists - I’m not either • Our goal is take small steps to learn together • Do you really need to know how to program? Yes. • You might not be a superstar, but learning to write simple codes can be very useful
  • 5. www.helsinki.fi/yliopist o Python for geo-people Why learn to program? • Rather than being restricted to using existing software, you will have the ability to develop your own solutions when solutions do not exist or are inefficient • Many software packages offer the ability to extend their capabilities by adding your own short programs (e.g., ArcGIS, ParaView, Google Earth, etc.)
  • 6. www.helsinki.fi/yliopist o Python for geo-people Python can be called directly from ArcGIS
  • 7. www.helsinki.fi/yliopist o Python for geo-people Why learn to program? • Believe it or not, programming is fun! It involves • Breaking complex problems down into simpler pieces • Developing a strategy for solving the problem • Testing your solution • All of this can be exciting and rewarding (when the code works…)
  • 8. www.helsinki.fi/yliopist o Python for geo-people The scientific method… …and how programming can make you a better scientist 1. Define a question 2. Gather information and resources (observe) 3. Form an explanatory hypothesis 4. Test the hypothesis by performing an experiment and collecting data in a reproducible manner 5. Analyze the data 6. Interpret the data and draw conclusions that serve as a starting point for new hypothesis 7. Publish results 8. Retest (frequently done by other scientists)
  • 9. www.helsinki.fi/yliopist o Python for geo-people Learning to program can help us… 1. Define a question 2. Gather information and resources (observe) 3. Form an explanatory hypothesis 4. Test the hypothesis by performing an experiment and collecting data in a reproducible manner 5. Analyze the data 6. Interpret the data and draw conclusions that serve as a starting point for new hypothesis 7. Publish results 8. Retest (frequently done by other scientists)
  • 10. www.helsinki.fi/yliopist o Python for geo-people Good programming practices can help us… 1. Define a question 2. Gather information and resources (observe) 3. Form an explanatory hypothesis 4. Test the hypothesis by performing an experiment and collecting data in a reproducible manner 5. Analyze the data 6. Interpret the data and draw conclusions that serve as a starting point for new hypothesis 7. Publish results 8. Retest (frequently done by other scientists)
  • 11. Python for geo-people www.helsinki.fi/yliopist o Programming “Computer programming (often shortened to programming) is a process that leads from an original formulation of a computing problem to executable computer programs. Programming involves activities such as analysis, developing understanding, generating algorithms, verification of requirements of algorithms including their correctness and resources consumption, and implementation (commonly referred to as coding) of algorithms in a target programming language.” -Wikipedia (2015) “A program is like a recipe. It contains a list of ingredients (called variables) and a list of directions (called statements) that tell the computer what to do with the variables.” - Webopedia (2015)
  • 12. www.helsinki.fi/yliopist o Python for geo-people What is a program? • A program is a detailed list of step-by-step instructions telling the computer exactly what to do • The program can be changed to alter what the computer will do when the code is executed • Software is another name for a program # Define plot variables misfit = NA_data[:,0] var1 = NA_data[:,1] var2 = NA_data[:,2] var3 = NA_data[:,3] clrmin = round(min(misfit),3) clrmax = round(min(misfit),2) trans = 0.75 ptsize = 40 Fortran punchcard Python source code
  • 13. www.helsinki.fi/yliopist o Python for geo-people What is a programming language? • A computer language is what we use to ‘talk’ to a computer • Unfortunately, computers don’t yet understand our native languages • A programming language is like a code of instructions for the computer to follow • It is exact and unambiguous • Every structure has a precise form (syntax) and a precise meaning (semantics) • Python is just one of many programming languages
  • 14. Python for geo-people www.helsinki.fi/yliopist o High level programming Low level programming Less code More code Slower Faster Various different programming languages exist • Python • Perl • Ruby • JavaScript • Java • C++ • C • Fortran + Many others Programming languages remind our spoken languages! • There are different ways to express the same meaning • Some languages are more similar to each other than others • After learning one language it is easier to learn other ones! Programming Moikka, Hello, Hej, Hallo, Hola echo ”Moikka”, print(”Hello”), console.log(”Hej”), puts(”Hallo”), System.out.println(”Hola”) Spoken languages Programming languages
  • 15. Python for geo-people www.helsinki.fi/yliopist o Python is: • General purpose • High level • Cross-platform • Open source • Multi-paradigm: Object oriented / imperative / functional / procedural / reflective • Uses dynamic type-checking Why to learn / use Python? • Easy to learn (a good programming language for the beginners) • Easy to read and understand – elegant code • Powerful enough – used in scientific programming • Countless ready-made modules / libraries to use (also GIS stuff) • Supportive, large and helpful user community • Widely supported in different GIS-softwares - ArcGIS, QGIS, Erdas Imagine, IDRISI, uDig, ILWIS, PostGIS … • Extremely useful for automating GIS processes Programming
  • 16. www.helsinki.fi/yliopist o Python for geo-people Developing a program • Coming up with a specific list of instructions for the computer to follow in order to accomplish a desired task is not easy • The following list will serve us as a general software development strategy 1. Analyze the problem 2. Determine specifications 3. Create a design 4. Implement the design 5. Test/debug the program 6. Maintain the program (if necessary)
  • 17. www.helsinki.fi/yliopist o Python for geo-people Let’s consider an example • As an American, David was raised in a country that uses Fahrenheit for temperatures • 70°F is lovely • 90°F is hot • Water freezes at 32°F • The problem here in Finland is that he doesn’t always know what he should wear to work when he finds weather reports with temperatures in degrees Celsius • A simple program could help
  • 18. www.helsinki.fi/yliopist o Python for geo-people Developing a program 1. Analyze the problem • Before you can solve a problem, you must figure out exactly what should be solved 2. Determine specifications • Describe exactly what the program will do • Don’t worry about how it will work. Determine the input and output values and how they should interact in the program
  • 19. www.helsinki.fi/yliopist o Python for geo-people Developing a program 1. Analyze the problem • Before you can solve a problem, you must figure out exactly what should be solved 2. Determine specifications • Describe exactly what the program will do • Don’t worry about how it will work. Determine the input and output values and how they should interact in the program
  • 20. www.helsinki.fi/yliopist o Python for geo-people Developing a program 3. Create a design • What is the overall structure of the program? How will it work? • It is often helpful to write out the code operation in pseudocode, precise English (or Finnish) describing the program. Be specific! 4. Implement the design • If you’ve done a good job with the previous steps, this should be fairly straightforward. Take your pseudocode and ‘translate’ it into Python
  • 21. www.helsinki.fi/yliopist o Python for geo-people Developing a program 3. Create a design • What is the overall structure of the program? How will it work? • It is often helpful to write out the code operation in pseudocode, precise English (or Finnish) describing the program. Be specific! 4. Implement the design • If you’ve done a good job with the previous steps, this should be fairly straightforward. Take your pseudocode and ‘translate’ it into Python
  • 22. www.helsinki.fi/yliopist o Python for geo-people Developing a program 5. Test/debug the program • Now you can put your new Python code to the test (literally) by running it to see whether it reproduces the expected values • For any test, you should know the correct values in advance of running your code. How else can you confirm it works??? 6. Maintain the program • If you’ve written something that will be shared by other users, a helpful programmer will continue to add features that are requested by the users
  • 23. www.helsinki.fi/yliopist o Python for geo-people Developing a program 5. Test/debug the program • Now you can put your new Python code to the test (literally) by running it to see whether it reproduces the expected values • For any test, you should know the correct values in advance of running your code. How else can you confirm it works??? 6. Maintain the program • If you’ve written something that will be shared by other users, a helpful programmer will continue to add features that are requested by the users
  • 24. www.helsinki.fi/yliopist o Python for geo-people References Zelle, J. M. (2010). Python programming: an introduction to computer science (2nd ed.). Franklin, Beedle & Associates, Inc.