Friday, May 18, 2018

GIS Programing:


So here we go... Week 1 GIS Programming.  The focus this class will be Python programming language, as this became the preferred programming language for use in ESRI's ArcGIS in 2010 with version 10.0.  "Pseudocode is a language very close to English that allows us to represent a program concisely" per Agarwal reading.  Pseudocode can be represented in the format of Start-Input-Goal- Tasks-End (review/evaluate/repeat) or could be flowchart format. 

IDE stands for integrated development environment and is used as a script editor. There are several IDE that work with Python.  This week I accessed three.  IDLE is what ships with some Python 2.7 version.  When launched (start button- ArcGIS-Python 2.7-IDLE) The interactive window Python Shell opens.  When you type a line of code and press ENTER, that line is interpreted and run immediately.  PythonWin is another script editor (one way to launch PythonWin start button-ArcGIS-Python-PythonWin).  The interactive window opens by default.  Code can be written and run in this environment but not saved.  Typically the interactive window is used as a tool, kept open, while write script in a script window, that allows you to save.  To open a script window on the pythonwin menu bar click file-new, in the dialog box highlight python script and click ok.  With the script window activated the script can be saved (file-save as-name.py) In the script window you can write code but it does not automatically run when you hit enter.  This allows you to write multiple lines and when you decide to run the script you can either click the run button, or file-run from the menu bar, or CTRL+R.  This brings the run script dialog box.  A third access to python is in ArcGIS (starting with version 10) python window button on the tool bar.  The python window button opens a window with a python interpreter on the left and help on the right. 

I work on windows 10 at home (new this year to me).  When I access the GIS desktop from Argoapps and click on the start button there is not a complete list of my programs, there is also not an all programs option.  This was new to me since, when I am not in this environment, the start button from my laptop does provide a list of programs and an all programs option.  I called the UWF help desk and when the technician remoted in he noticed at once that this is normal for Windows 10.  Once you click the start button you start typing the program you are looking for and it pulls it up.  So for this lab once I started typing “pyth” I was able to see the options for PythonWin and Python IDLE.

This week I accessed python 3 ways.  I experimented writing the same line of code:  print "Hello World" in each environment.  I ran a script provided in the lab that set up the folders in my student drive that I would be using this semester for this class.  The picture above is of those folders created by the provided script.  Week 1, check!

No comments:

Post a Comment