Duncan Booth wrote:
> bruno at modulix wrote:
>
>
>>>Otherwise, just to be informed, what advantage does rstrip() have over
>>>[:-1] (if the two cases are considered uneventfully the same)?
>>
>>1/ if your line doesn't end with a newline, line[:-1] will still remove
>>the last caracter.
>>
>
> I
bruno at modulix wrote:
>> Otherwise, just to be informed, what advantage does rstrip() have over
>> [:-1] (if the two cases are considered uneventfully the same)?
>
> 1/ if your line doesn't end with a newline, line[:-1] will still remove
> the last caracter.
>
In particular, if the last line o
> I reeducated my fingers after having troubles with huge files !-)
I'll keep it in mind...the prospect of future trouble with
large files is a good kick-in-the-pants to remember.
>>Otherwise, just to be informed, what advantage does rstrip() have over
>>[:-1] (if the two cases are considered un
Tim Chase wrote:
>>> starLines = [line for line in p.readlines() if line.startswith("*")]
>>
>>
>> files are iterators, so no need to use readlines() (unless it's an old
>> Python version of course):
>>
>> starLines = [line for line in p if line.startswith("*")]
>
>
> Having started with some old
>>starLines = [line for line in p.readlines() if line.startswith("*")]
>
> files are iterators, so no need to use readlines() (unless it's an old
> Python version of course):
>
> starLines = [line for line in p if line.startswith("*")]
Having started with some old Python, it's one of those
thin
Tim Chase wrote:
(snip)
> starLines = [line for line in p.readlines() if line.startswith("*")]
files are iterators, so no need to use readlines() (unless it's an old
Python version of course):
starLines = [line for line in p if line.startswith("*")]
> or you may optionally want to prune of the "
Lorenzo Thurman wrote:
> This is what I have so far:
>
> //
> #!/usr/bin/python
>
> import os
>
> cmd = 'ntpq -p'
>
> output = os.popen(cmd).read()
> //
>
> The output is saved in the variable 'output'. What I need to do next is
> select the line from that output that starts with the '*'
[sni
Lorenzo Thurman wrote:
> This is what I have so far:
>
> //
> #!/usr/bin/python
>
> import os
>
> cmd = 'ntpq -p'
>
> output = os.popen(cmd).read()
> //
>
> The output is saved in the variable 'output'. What I need to do next is
> select the line from that output that starts with the '*'
Wel
This is what I have so far:
//
#!/usr/bin/python
import os
cmd = 'ntpq -p'
output = os.popen(cmd).read()
//
The output is saved in the variable 'output'. What I need to do next is
select the line from that output that starts with the '*'
remote refid st t when poll reach