garry saddington wrote:
> This code on linux works without a problem
> ispell = os.popen("echo " + word +
> | /opt/scholarpack/ancillary/ispell/bin/ispell -a")
> sentence = ispell.readline()
What if the word is like `rm -rf /` for example?
Doing something like that above is completely
creazy :( There are actually 3 different popen()
variants - 2 of them give you stdin too so you better
use this to write the "word" to ispells stdin.
Don't use echo or something like this!
> however on windows it throws a string index out of range at the
> sentence constructs.
> the popen command on windows is:
> ispell=os.popen("echo" +word+ "\scholarpack\ancillary\ispell\bin\ispell
> Anyone know what the difference is on the two platforms?
As Andreas already said (and you can easily see by
comparing the strings, can you? ;)
Python has os.path.join() to construct paths
for the actual platform.
(And since this is a 3rd party tool anyway, you
might want to make it configurable - of course not
Zope maillist - Zope@zope.org
** No cross posts or HTML encoding! **
(Related lists -