Results 1 to 2 of 2
Apr 28, 2013, 05:58 #1
Can you explain some syntax to a non-python person?
Not a python coder here. Can someone please explain (or even better link to something that explains) the bit in red.
MyVar = line.split()[4:-1]
Apr 30, 2013, 12:13 #2
- Join Date
- Apr 2005
- 0 Post(s)
- 0 Thread(s)
It is the slice operation (or substring) of a String.
The red bit will return the 5th char to the to 2nd last char. (as everything is indexed from 0).
You can read through http://docs.python.org/2/tutorial/introduction.html