On Mon, Oct 23, 2006 at 06:13:51PM +0200, Vibe Grevsen wrote:
|| Hi again,
||
|| > Kasper> Here are two test runs. First one with incorrect parameter
|| > Kasper> format as in your example. Second with correct scaling
|| > Kasper> parameter:
|| > ...
|| > Skip> Whoops! Thanks, I'll fix that pronto.
|| >
|| > Belay that. Here's what's in the SpamBayes source:
|| >
|| > scale = options["Tokenizer", "ocrad_scale"] or 1
|| > charset = options["Tokenizer", "ocrad_charset"]
|| > ...
|| > ocr = os.popen("ocrad -s %s -c %s -x %s -f %s 2>/dev/null" %
|| > (scale, charset, orf, pnmfile))
|| >
|| > So I already allow the user to adjust the scaling factor and properly use
|| > the -s flag. I think the incorrect usage was confined to my postings.
||
|| Ok, I see.
||
|| What is the meaning of the last '2' in the os.popen()-call?
|| If I send that to ocrad after the input-file I get the ocr followed by
'Cannot open 2'.
2>/dev/null is /bin/sh syntax for redirecting standard error to /dev/null.
Csh or a derivative will not recognize 2> as special, but pass 2 as
argument to ocrad. Then ocrad will interpret it as a filename and try
to open that file, with the shown consequence.
--
Vincent Zweije <[EMAIL PROTECTED]> | "If you're flamed in a group you
<http://www.xs4all.nl/~zweije/> | don't read, does anybody get burnt?"
[Xhost should be taken out and shot] | -- Paul Tomblin on a.s.r.
_______________________________________________
[email protected]
http://mail.python.org/mailman/listinfo/spambayes
Check the FAQ before asking: http://spambayes.sf.net/faq.html