+ Reply to Thread
Results 1 to 4 of 4

Thread: Need more program help!

  1. #1
    Michelle Couden
    Join Date
    Mar 2012
    Posts
    237
    Points
    0
    Answers Provided
    22


    0

    Default Need more program help!

    I am still having trouble referencing the shapefile to Add the Field. One person said to use pathname and r to in_table, but that is not working unless I have it typed wrong (see below). I need to reference a shapefile to Add the field. I know I can set workspace and then basename, which would allow me to use a geodatabase with shapefile inside). I need to learn both ways!! Thanks!!

    import arcpy
    ... import os.path
    ... os.path r"C:\Users\Michelle\Desktop\GIS\FA_Urbans.shp"
    ... arcpy.AddField_management ("FA_Urbans", "POPSQMI","TEXT", "20")
    ...

  2. #2
    Michelle Couden
    Join Date
    Mar 2012
    Posts
    237
    Points
    0
    Answers Provided
    22


    0

    Default Re: Need more program help!

    I think part of my problem is I am getting dots in front instead of arrows. How do I correct this?

  3. #3
    Michelle Couden
    Join Date
    Mar 2012
    Posts
    237
    Points
    0
    Answers Provided
    22


    0

    Default Re: Need more program help!

    Canel this help!!

  4. #4
    Bruce Nielsen
    Join Date
    Jan 2011
    Posts
    299
    Points
    130
    Answers Provided
    21


    0

    Default Re: Need more program help!

    This is all you need to do:
    Code:
    import arcpy
    arcpy.AddField_management(r"C:\Users\Michelle\Desktop\GIS\FA_Urbans.shp", "POPSQMI","TEXT", "20")
    If you're cutting/pasting from the interactive window, you will need to edit out the dots in front of the lines.
    GIS Specialist
    USDA-Natural Resources Conservation Service

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts