tomer 发表于 2014-11-07 09:59

string没有split属性?

本帖最后由 tomer 于 2014-11-07 10:01 编辑


import string
ip=string.split('192.168.1.12','.')
print(ip)
AttributeError: 'module' object has no attribute 'split'

Linux_manne 发表于 2014-11-07 10:06

2版本 有的阿 你这个是不是3版本额

ssfjhh 发表于 2014-11-07 10:10

In : ip=str.split('192.168.1.12','.')

In : ip
Out: ['192', '168', '1', '12']

In : '192.168.1.12'.split('.')
Out: ['192', '168', '1', '12']

In : 楼主灌水灌得挺happy呀。

tomer 发表于 2014-11-07 10:13

回复 2# Linux_manne

是的
    我的版本3.4。3

tomer 发表于 2014-11-07 10:14

高版本不兼容低版本啊。我日

ssfjhh 发表于 2014-11-07 12:08

回复 4# tomer


    什么兼容不兼容呀,有没有看懂我的回复,这点小功能,根本就用不到库。python自带技能。
页: [1]
查看完整版本: string没有split属性?