Hi, I have just started using python to make some of my ArcGIS tasks run quicker.
I have some code that effectively takes a line, splits it into points, attaches those points to another set of points that move back in time, so that I can see where the line would be back in time (It is for paleogeography/geology research).
I know the code itself works as I am currently running it by manually editing the 'Age' field and age in the Lines variable, the code then runs for a minute and I do it again:
Lines = r'R:\Paleogeography Maps\Northland\shapefiles\2Ma.shp"'
Age = 2
#then the rest of the code follows#
What I am trying to do is automate this so I can set a start and end point and let it run through it all for me.
The problem I am having is with converting the Age number into a string in the file path, I keep getting error: does not exist or is not supported
The code I tried is:
count = 2
... while count < 28:
... Lines = r'R:\Paleogeography Maps\Northland\shapefiles\'str(count)'+"Ma.shp"'
... Age = count
#and the rest of the code, then at the bottom count = count +1
Any idea how I write the str(count)+Ma.shp part. I just can't get the syntax correct so that it uses the correct file.
Thanks in advance,
Last edited by kadinlucas
on Mon Apr 15, 2013 12:06 am, edited 1 time in total.