fiendniu

cannot import my own module using PythonWin

Discussion created by fiendniu on Mar 26, 2012
Latest reply on Mar 27, 2012 by fiendniu
import types

class TableDict:
    def __init__(self):
        data={}
    def addRow(cid, cx, cy, cbear, nid, nx, ny, nbear):
        # New Row
        nrow =types.DictType.__new__(types.DictType, (), {})
        nrow={'ClusterID':cid, 'C_LON_X':cx, 'C_LAT_Y':cy, 'C_Bearing':cbear, 'NearbyPtID':nid,'NearbyLON_X':nx,'NearbyLAT_Y':ny,'NearbyBearing':nbear}
        
        data[str(nid)] = nrow
    def removeRow(n):
        data.pop(n)


But, I got problem:


>>> import TableDictionary
>>> a=TableDict()
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
NameError: name 'TableDict' is not defined


I already set the System Environment Path to "PYTHONPATH = C:\TempArcGISCalculate\PythonScript\"

Outcomes