Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: Graph Plotting - Reprise



At 11:22 PM 8/17/00 -0500, Timothy Wilson wrote, apparently
quoting an off-list discussion:
On Thu, 17 Aug 2000, Ludwik Kowalski wrote:

> > My program
> > is for a case when y are always positive; it knows that y=-1
> > is the end of data mark (not to be counted as data item).

1) It is not good programming practice to use -1 (or any other "magic"
value) to signal end-of-file. Python, like any halfway-decent computer
language, has an EOF exception and you might as well get into the habit of
using it:

while 1:
try:
x = input('? ')
except EOFError:
break
...

2) What is the objective here?
-- If the goal is to have fun writing programs and learning new languages,
that's a reasonable thing to do, but...
-- If the goal is to analyze and plot the data, there are much better
ways of going about it. For example
http://www-rocq.inria.fr/scilab/
is free and will give much better results with less work.