I have a funny problem.
I am trying to split a string.
DEVICE_IP = '164.178.7.30'
ip = DEVICE_IP.spilt('.')
print ip[0]+'-'+ip[1]+'-'+ip[2]+'-'+ip[3]
The above code throws the error
Traceback (most recent call last):
File "/home/englotk/test", line 2, in <module>
ip = str(DEVICE_IP).spilt('.')
AttributeError: 'str' object has no attribute 'spilt'
However this works fine if i enter the line in the above code individually at the python prompt. i get the above error if i have the above code in a file 'test.py' and say 'python test.py'
Please let me know why is this so..
Thanks.