Glob returning an empty list when passed a variable

Neil Webster nswebster at gmail.com
Fri Feb 9 09:03:51 EST 2007


Hi,

I was wondering whether anybody could help me out.

I have a program, for part of it I am trying to pass a variable to a
glob function, this returns an empty list.  The strange thing is when
I hard code in the variable the glob section works.

Does anybody have any ideas as why it is not working?

The section of code that is not working is:

# The variable to be passed to the glob function
area_name_string = '"*% s*"' % (Area_name)

os.chdir(Input)

filename = glob.glob(area_name_string)

Thanks in advance

Neil




More information about the Python-list mailing list