I'll be fairly brief in my comments here...First of all, in what I'll call the 'main' script you posted, you are missing lines importing other modules/scripts this main script depends on:import arcpyimport osimport csvimport domainvalues...and with that, let's pay particular attention to the last line of that import set (you already have ArcGIS 10.0, correct?...in other words, the ability to import arcpy??). That line imports a 'helper' py file called domainvalues (which you should have downloaded with this package, contained in the 'scripts' folder) and this should handle converting any db domain descriptor values you have defined (if converting a db table). This script has to be in a python-recognizable location, so provided you have a default install, you could place the domainvalues.py in this common library location for '3rd party modules':C:\Python\Lib\site-packages\About that convention on lib files, you can read more here:http://docs.python.org/2/using/windows.html#finding-modulesAlso in the download, there's a tbx that likely contains an already 'wired' tool interface (check this out in your download) -- I strongly recommend you implement that so that you can call this as a script tool. I think you should be able to then use the script unaltered - you may have to 'wire' the script to this toolbox interface but that is easy via ArcToolbox (or Catalog in ArcMap). If the script tool has been saved with relative paths, you may only need to run the tool through your toolbox interface from your download location (the one you unzipped to).Having said all that, you can make this run without arcpy or domainvalues - but this was written to leverage your ArcGIS install, so why cripple it, working out a different hack when it appears your problem seems to be only with install details?Hope that helps,Wayne...one more FYI: enclose all code in tags-- use the hash tool on the toolbar, or type after the code and before the code. So this would be the actual priginally published py code from earlier in this thread, part of the package you downloaded:
"""
This script will convert a table to a .csv file. It will transfer domain
descriptions, rather than just their coded values
"""
import arcpy
import os
import csv
import domainvalues
def export_to_csv(dataset, output, dialect):
"""Output the data to a CSV file"""
# create the output writer
out_writer = csv.writer(open(output, 'wb'), dialect=dialect)
# return the list of field names and field values
header, rows = domainvalues.header_and_iterator(dataset)
# write the field names and values to the csv file
out_writer.writerow(map(domainvalues._encodeHeader, header))
for row in rows:
out_writer.writerow(map(domainvalues._encode, row))
if __name__ == "__main__":
# Get parameters
dataset_name = arcpy.GetParameterAsText(0)
output_file = arcpy.GetParameterAsText(1)
delim = arcpy.GetParameterAsText(2).lower()
dialect = 'excel'
if delim == 'comma':
pass
else:
dialect = 'excel-tab'
try:
export_to_csv(dataset_name, output_file, dialect)
except Exception as err:
arcpy.AddError('Error: {0}'.format(err))