Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Automating-GIS-processes/FEC2017-exercise1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Automating GIS processes/ FEC 2017 / Exercise 1

Automating GIS processes/FEC 2017/Exercise 1

This exercises is meant to help you better understand data types and lists in Python, and practice saving files to GitHub. Below you have a series of "problems" in which you will be asked to either download and modify, or create new script files. After making you changes, you will need to upload them to GitHub.

The answers to the questions in this week's exercise should be given by modifying the end of this document in the section titled Answers.

Problem 1 - Upload a script file to GitHub

During the first lesson we did a small exercise where we made python to print the text "Hello World!". Copy the code into a script file HelloWorld.py and upload the file to this repository. Your code should look something like this (with and update on the last line):

"""
Hello world!
Author:

"""

#Define text variables:
a = "Hello again"
b = "World!"

#Print out "Hello again World!" using variables a and b
print() # update this line of code!

Problem 2 - What is the favourite treat of Garfield?

Your task is to make some modifications to the broken script cattreats.py that is included in this repository. The script should allow users to find a cat's favorite treat by setting the SelectedCat variable. Fix this script so that it works as expected, and don't worry about the case of a user entering a cat name that is not on the list.

Manually downloading a script-file from GitHub:

  1. Open the script cattreats.py in GitHub
  2. Press "Raw" at the top of the script
  3. Right-click on the page and select Save Page As...
  4. Navigate to your local folder and save the file (keep the original name cattreats.py!)

Now you should open the script in Spyder and fix it. After major fixes, or at least once you are done, remember to upload your file back to GitHub!

Uploading script manually to GitHub:

  1. Click "Upload Files"
  2. Add the file (Drag and drop or browse..)
  3. Add a message under "Commit changes", for example ""
  4. Click "Commit changes"

Problem 3 - Modifying the Readme.md -file

In this task you will practice how to make some changes to this README.md using the Markdown-syntax.

  1. List the changes (in regular English, not Python code) you needed to make to the code in Problem 1 to get it working. You can read about how to format numbered lists on the GitHub page about GitHub-flavored Markdown, or search from this cheatsheet.

  2. Replace the image below with a new image containing a map along with a short caption describing it's content. You can add an image by linking to a website, or by uploading an image to your GitHub repository and linking to that.

Since we've spoken briefly about software licencing, we suggest that you search for images in a repository that includes licencing information such as Wikimedia Commons or Pixabay. You are, of course, also welcome to upload your own images.

Answers

This is a sub-heading

This is some text. You can use italics or bold text easily. You may want to read a bit more about formatting text in Github-flavored Markdown. You can see an example of how to display an image with a caption below.

Text shown if image does not load
Figure 1: A green tree python

Here is a bit more text beneath the image. Have fun!

About

Exercise 1 for AUTOGIS/FEC2017 -course

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages