Could use some help with this. Python 2.4.3 on RHEL 5.x.

In the functions file that gets imported:

def append_customer(line_list):
        global customers
        cust = line_list[0]     // list with Customer info in [0]
        cust = clean_word(cust)  // Trims white space

        if len(cust) and cust not in customers:
                host_list[cust] = {}
                customers.append(cust)


In the calling file:

import functions
import sys

customers = []

.
.
.
for line in input_file:
    line = line.strip()
    if not len(line):
        continue
    line_list = line.split(',')
    functions.append_customer(line_list)


Error message:
Traceback (most recent call last):
  File "./host_tools.py", line 55, in ?
    functions.append_customer(line_list)
  File "/home/lhall/lang/functions.py", line 27, in append_customer
    if len(cust) and cust not in customers:
NameError: global name 'customers' is not defined



-- 
Mind on a Mission <http://leamhall.blogspot.com/>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to