我有数据“行”
FF= ['123451234512345678901234512345', '123451234512345678901234512345']我要切开1-5,6-10,11,12-22行。我该如何切片?
data= []
for col in FF:
data.append(col)发布于 2011-02-16 03:55:03
类似于:
a = [(s[:5], s[5:10], s[10], s[11:]) for s in FF]发布于 2011-02-16 03:56:30
和struct在一起。
>>> struct.unpack('5s5sc11s8x', '123451234512345678901234512345')
('12345', '12345', '1', '23456789012')https://stackoverflow.com/questions/5008760
复制相似问题