Writing python scripts

1189
3
07-14-2017 02:20 PM
ShahriarFerdous
New Contributor

i'm new in arc gis. i would like to get proper direction to advance in writing python scripts for different analysis tools. it would be great honour to get a path from the very beginning. thank you

0 Kudos
3 Replies
RebeccaStrauch__GISP
MVP Emeritus

Hi Shahriar Ferdous ,

welcome to the world of ArcGIS and Python.  There is a tremendous amount of information you can find in the Help documents What is geoprocessing?—Help | ArcGIS Desktop  and many of the tools will include syntax for using the commands in Python.

I would like to mention that there are differences between writing a python script using arcpy and other Python modules, vs the newer ArcGIS API for Python, which is the group you posted this in. The API for Python uses Jupyter notebooks and a has a few steps for installation and can be used for administering AGOL, popping up a quick map and doing some analysis.  It can be thought of as working more with Pro because of the Python version and installation, but is also somewhat of a standalone platform.  You can find out more about that at https://developers.esri.com/python 

i wanted to point out that they are different so it may help when you get other responses to you post.  It may help to clarify which you are trying to learn.

Assuming you are just trying to write scripts, etc. Dan Patterson‌  has great blogs wi many resources and it's worth book marking /blogs/dan_patterson/2016/05/09/the-links?sr=search&searchId=e9e4f51a-1066-424e-ac70-fa20765a9136&se...

There are also many thread on gelling (which the above blog might have links to already) that have learning resources and suggestions.  Many of these might end up being reappearing here, but worth sing what has already been posted.

as far as how to get started?  

  • creating a model builder model and converting to Python script can help you see how things are set up, but at least in the past, this save-as tool, wasn't the best at being efficient or best written code.  But it does give you a start.  
  • Another trick, if you run a tool that you want in a script, open the Results-window, right click on the tools that was successfully run and choppy the Python snippet.  This can be pasted in you code so you can see the arguments you need in your own code.
  • the help docs, as mentioned above
  • Search geonet for what you are trying to do...you may find code that is written already that is similar to what you want and be able to use or modify it.  You don't have to reinvent the wheel if you can use what others have done.

I took a while to write this, so much of this might have already been said.  Python is great for working with GIS and can be very fun.  Good luck with you learning and don't hesitate to post questions....but it would help to know what version of the software you are using in the future.

ShahriarFerdous
New Contributor

Thank you very much

Sent from Mail for Windows 10

0 Kudos
ShahriarFerdous
New Contributor

Thank you very much

Sent from Mail for Windows 10

0 Kudos