Posts

Showing posts from May, 2025

GIS5103 Module 2: Python Fundamentals

Image
               This week’s lab in GIS Programming focused on the fundamentals of Python. We worked with string variables, how to include comments in script in a way that wouldn’t impact the script outcome, how to iterate variables within loops to control script workflow, as well as created loops and conditional statements. Part 1 of lab included being able to assign a variable as a string, splitting that string into a list, and indexing to pluck the last string list item as the output when ran. For this part, we assigned our full name as the variable and indexed the script to print our last name. Part 2 of lab consisted of looking at prewritten script for a dice game and trying to determine the (2) errors that prevented the script from running without error. Part 3 of lab asked that we create a loop that will add (20) random numbers between (0) and (10) to a list. We needed to utilize a while loop that appended a randomly generated number...

GIS5103 Module 1: Python Environments & Flowcharts

Image
     The first week of GIS Programming touched on a brief introduction to the Python programming language and how to think algorithmically with the use of flowcharts. A few notes of interest:  General Command Prompt not the same as Python Command Prompt “dir” – basically tells computer/Command Prompt “What is in the directory?” Python is an interpretive language, NOT a compiled language IDLE = Integrated Development Learning Environment – book refers to as Integrated DeveLopment Environment, however Usually do script in file and send (“Run”) to do interpretation Workflow = flowchart Python in ArcGIS Pro TWO ways to launch Python in ArcGIS – (either will open new Notebook)   Method 1 : Insert Tab -> “New Notebook” (in Project group) Method 2 : Analysis Tab -> “Python” Notebook consists of cells To run CURRENT cell being written in, hit Ctrl + Enter OR click “Run” We used  https://app.diagrams.net  to create a flowchart u...