str.find for multiple strings
Peter Hansen
peter at engcorp.com
Thu Feb 12 13:26:47 EST 2004
More information about the Python-list mailing list
Thu Feb 12 13:26:47 EST 2004
- Previous message (by thread): str.find for multiple strings
- Next message (by thread): c extension works in Linux but not Windows==>?? ImportError: dynamic module does not define init function (initpeak_load)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Peter Hansen wrote: > > Bart Nessux wrote: > > > > Peter Hansen wrote: > > > Bart Nessux wrote: > > > > > >>x = str.find(temp, '120.50') > > >> > > >>I am looking for '120.50' '120.51' '122.78' etc. How can I do this with > > >>just one str.find... I can use re if I must, but I'd like to avoid it if > > >>possible. > > > > > > In addition to Fecundo's questions, here's another. What does "temp" > > > contain? A single temperature string, or a temperature embedded in > > > a bunch of other stuff, or a whole series of temperatures, or what? Ah, trust me to take an industrial-control point of view and not a network software point of view. You meant "temp" to be a temporary variable, not a temperature, and the 120.50, 120.51 stuff are partial IP addresses, not temperatures... how curious of me to confuse them. :-) -Peter
- Previous message (by thread): str.find for multiple strings
- Next message (by thread): c extension works in Linux but not Windows==>?? ImportError: dynamic module does not define init function (initpeak_load)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list