如何解析以下文件,並將每行轉換爲列表元素(每行開始處有空格)?不幸的是我在正則表達式總是吸:/所以把這個:將多行文件的內容更改爲列表
32.42.4.120', '32.42.4.127
32.42.5.128', '32.42.5.255
32.42.15.136', '32.42.15.143
32.58.129.0', '32.58.129.7
32.58.131.0', '32.58.131.63
46.7.0.0', '46.7.255.255
到一個列表:
('32.42.4.120', '32.42.4.127'),
('32.42.5.128', '32.42.5.255'),
('32.42.15.136', '32.42.15.143'),
('32.58.129.0', '32.58.129.7'),
('32.58.131.0', '32.58.131.63'),
最後一行發生了什麼? – SilentGhost 2010-11-18 14:38:44