Globbing in List Search?

Ed Suominen ed-no at spam-eepatents.com
Wed Mar 24 19:24:23 EST 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