Splitting device addresses into parts

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Wed Sep 27 17:39:47 EDT 2006


In message <efbl8h$kf2$03$1 at news.t-online.com>, Fabian Steiner wrote:

> I often have to deal with strings like "PCI:2:3.0" or "PCI:3.4:0" and
> need the single numbers as tuple (2, 3, 0) or (3, 4, 0). Is there any
> simple way to achieve this? So far I am using regular expressions but I
> would like to avoid them ...

Good for you for wanting to avoid REs if you can. Bookmark this page
<http://docs.python.org/lib/string-methods.html> and refer to it often.



More information about the Python-list mailing list