Glob returning an empty list when passed a variable

Philipp Pagel pDOTpagel at gsf.de
Fri Feb 9 09:13:18 EST 2007


Neil Webster <nswebster at gmail.com> wrote:

> area_name_string = '"*% s*"' % (Area_name)
> os.chdir(Input)
> filename = glob.glob(area_name_string)

Too many quotation marks.

>>> Area_name='Foo'
>>> '"*% s*"' % (Area_name)
'"*Foo*"'

Unless there are files with funny names containing '"' you will not get a
match.

cu
	Philipp

-- 
Dr. Philipp Pagel                          Tel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics    Fax. +49-8161-71 2186
Technical University of Munich
http://mips.gsf.de/staff/pagel



More information about the Python-list mailing list