Gnuplot woes.

Jacek Generowicz jmg at ecs.soton.ac.uk
Sat May 20 14:45:34 CEST 2000


Huaiyu Zhu wrote:

> I've seen similar behavior on my Linux laptop, probably because the OS does
> not write out file promptly (due to apm?).  Experimental result:
>
> for i in range(10):
>    g.plot(something)
>    time.sleep(sleeptime)
>
> works if sleeptime >=0.5, fails if sleeptime <=0.2, and partially fails in
> between.

The problem in my case seems to be that the file it tries to use has already
been replaced by the next temporary file . . . so when it tries to use ####.1,
####.2 has already replaced it . . . however, the following always works:

-------------------
while string.lstrip(string.rstrip(command)) != 'quit':

    g.plot( [[1,1],[2,2],[3,3],[4,4]] )
    command = raw_input('plot> ')
    os.system('ls /usr/tmp')
    g.hardcopy( 'hmm.ps' )
--------------------

On the other hand, the follwing NEVER works

--------------------
while string.lstrip(string.rstrip(command)) != 'quit':

    g.plot( [[1,1],[2,2],[3,3],[4,4]] )
    command = raw_input('plot> ')
    time.sleep(1)
    g.hardcopy( 'hmm.ps' )
---------------------

Is there any logic behind this madness ?

Jacek





More information about the Python-list mailing list