jospilon

AttributeError: 'str' object has no attribute 'workspace'

Discussion created by jospilon on Mar 6, 2012
Latest reply on Mar 15, 2012 by GuyDuke
When I type my simple testscript in the Python window in ArcGIS it runs fine.
When I try to debug the same script in PythonWin it can not find the workspace property of the arcpy.env object, it sees the env object as a string. Al the methods from a string object pop up in intellisense.

What's wrong?

import arcpy
from arcpy import env
import os

# Set the workspace for the ListFeatureClass function
#
env.workspace = "c:/data"

# Use the ListFeatureClasses function to return a list of 
#  all shapefiles.
#
fcList = arcpy.ListFeatureClasses()

Outcomes