bagardne

What is wrong with this code?

Discussion created by bagardne on Oct 28, 2013
Latest reply on Oct 28, 2013 by bagardne
#add arcpy, sys and traceback modules
import arcpy, os, sys, traceback

#set workspace to data folder
arcpy.env.workspace = "L:\\school\\GEO614\\PythonPrimer\\Chapter06\\Data\\cursors.gdb"
#overwrite
arcpy.env.overwriteOutput = True

lake_fc = 'Lakes' #Lakes feature class in the cursors.gdb
lake_table = 'Lake_Info' #Lake_Info in the cursors.gdb

lake_fl = 'Lakes FL' #Lakes feature layer
lake_tv = 'Lakes TV' #Lakes table view

#variables for table creation
outpath = "L:\\school\\GEO614\\PythonPrimer\\Chapter06\\MyData\\exercise6.gdb"
outname = 'mytable'

try:
    #create a new table in the file geodatabase
    arcpy.CreateTable_management(outpath, outname)

    #add fields
    arcpy.AddField_management(outname, 'LakeFC_ID', 'SHORT')
    arcpy.AddField_management(outname, 'Lake_Name', 'TEXT', '50')
    arcpy.AddField_management(outname, 'Lake_Info_ID', 'LONG')
    arcpy.AddField_management(outname, 'Lake_Temp', 'SHORT')


I am getting this error

ARCPY ERRORS:
Failed to execute. Parameters are not valid.
ERROR 000732: Input Table: Dataset mytable does not exist or is not supported
Failed to execute (AddField).


PYTHON ERRORS:
Traceback Info:
  File "L:\school\GEO614\PythonPrimer\Chapter06\exercise06_Gardner.py", line 37, in <module>
    arcpy.AddField_management(outname, 'LakeFC_ID', 'SHORT')

Error Info:
     <class 'Queue.Empty'>:

My professor can't even figure out where the mistake is located.

Outcomes