0

I wrote this python code and when i run it nothing happened and it's success

import arcpy

# Set environment settings
arcpy.env.workspace = 'C:/ShapeFile'

# Set local variables
inFeatures = ['New_Shapefile.shp']
outLocation = 'C:/ShapeFile/test.gdb'

# Execute TableToGeodatabase
arcpy.FeatureClassToGeodatabase_conversion(inFeatures, outLocation)
3
  • 4
    Please edit the question to explain what you mean by "nothing happened".
    – Vince
    Jan 7, 2016 at 12:16
  • 1
    From a syntax perspective, everything looks fine. That leads me to believe something is wrong with your shapefile or GDB. Perhaps you have one of the names incorrect?
    – Aaron
    Jan 7, 2016 at 12:34
  • the code is working fine but when i publish it as geoProcessing service and submit a job in a rest service it raise and error : the dataset "New_Shapefile.shp" doesn't exist or not supported.
    – Hassan
    Jan 9, 2016 at 21:14

1 Answer 1

1

Edit your code from this:

arcpy.FeatureClassToGeodatabase_conversion(inFeatures, outLocation)

into this:

try:
    arcpy.FeatureClassToGeodatabase_conversion(inFeatures, outLocation)
    print "success"
except:
    print "error"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.