Re: [Tutor] Comparing a string

2005-05-20 Thread Alan G
> I'm tryin compare a string with a value with style of pattern-matching. > > string = 'i686' > > if string == glob.glob(i?86): Use regular expressions and turn it around: import re s = 'i686' ex = re.compile('i?86') if ex.match(s): print 'they match!' Is that what you mean? Alan G. _

Re: [Tutor] Comparing a string

2005-05-20 Thread jfouhy
Quoting Jonas Melian <[EMAIL PROTECTED]>: > I'm tryin compare a string with a value with style of pattern-matching. > > string = 'i686' > > if string == glob.glob(i?86): This is a task for regular expressions! Have a look at the re module. (and feel free to ask for more help if you're having

[Tutor] Comparing a string

2005-05-20 Thread Jonas Melian
I'm tryin compare a string with a value with style of pattern-matching. string = 'i686' if string == glob.glob(i?86): This is fails because glob() is for listing files in a directory that match a Unix ls-pattern how make it? Thanks! ___ Tutor maillis