Re: Weird bahaviour from shlex - line no

2013-09-28 Thread Piet van Oostrum
Peter Otten <__pete...@web.de> writes: > Dave Angel wrote: > >> On 28/9/2013 02:26, Daniel Stojanov wrote: >> >>> Can somebody explain this. The line number reported by shlex depends >>> on the previous token. I want to be able to tell if I have just popped >>> the last token on a line. [...] > T

Re: Weird bahaviour from shlex - line no

2013-09-28 Thread Peter Otten
Dave Angel wrote: > On 28/9/2013 02:26, Daniel Stojanov wrote: > >> Can somebody explain this. The line number reported by shlex depends >> on the previous token. I want to be able to tell if I have just popped >> the last token on a line. >> > > I agree that it seems weird. However, I don't th

Re: Weird bahaviour from shlex - line no

2013-09-28 Thread Dave Angel
On 28/9/2013 02:26, Daniel Stojanov wrote: > Can somebody explain this. The line number reported by shlex depends > on the previous token. I want to be able to tell if I have just popped > the last token on a line. > I agree that it seems weird. However, I don't think you have made clear why it'

Re: Weird bahaviour from shlex - line no

2013-09-28 Thread Andreas Perstinger
On 28.09.2013 08:26, Daniel Stojanov wrote: Can somebody explain this. The line number reported by shlex depends on the previous token. I want to be able to tell if I have just popped the last token on a line. [SNIP] second = shlex.shlex("word1 word2,\nword3") Punctuation characters like th