Globbing in List Search?

Ed Suominen ed-no at spam-eepatents.com
Thu Mar 25 01:24:23 CET 2004


To answer my own post,

k = x.index(filter(lambda x: x.startswith(term), x)[0])

where "term" acts like it has an implicit "*" at the end.

Any better ideas?

Ed Suominen wrote:

> Does Python have a globbing-type list search capability, like "lsearch
> -glob $list" in TCL?




More information about the Python-list mailing list