Re: newbie question concerning formatted output
- From: Scott David Daniels <scott.daniels@xxxxxxx>
- Date: Tue, 29 Nov 2005 18:27:57 -0800
Thomas Liesner wrote:
... i want to print always three of them in a single line and
> after that a linebreak.
How about:
def emit(aFile):
for line in aFile:
for word in line.split():
yield word f = open('xyplan.nobreaks', 'r')
gen = iter(emit(f)).next
try:
while True:
for i in range(2):
print gen(),
print gen()
except StopIteration:
pass
f.close()
print--Scott David Daniels scott.daniels@xxxxxxx .
- References:
- newbie question concerning formatted output
- From: Thomas Liesner
- newbie question concerning formatted output
- Prev by Date: Re: How to write an API for a Python application?
- Next by Date: Re: run runs away
- Previous by thread: Re: newbie question concerning formatted output
- Next by thread: Re: newbie question concerning formatted output
- Index(es):
Relevant Pages
|