[Pdx-pm] help with archivemail (python) ??
Eric Wilhelm
scratchcomputing at gmail.com
Sat Feb 10 00:56:39 PST 2007
# from John Springer
# on Friday 09 February 2007 08:19 pm:
> Sorry for the foreign language
>request but I'm calling it from a perl script so i should
>get partial credit.
Only if you're giving a talk on Inline::Python in the next 4 months. If
you're calling it from a system call, you better use a list context and
check the return value or else you have to buy the beer :-D
>It's using /tmp and it needs to be /usr/tmp on my system because]
>/tmp is a small partition. It's crashing with out-of-space on
> self.mbox_file.write(body)
...
> import tempfile
...
> temp_name = tempfile.mktemp("retain")
The neat thing about open-source, and particularly interpreted languages
(no matter how lame) is that you can go find the code and see what it
does. Maybe it uses an environment variable.
perl -e 'print join(", ", @INC), "\n"'
becomes:
python -c 'import sys; print sys.path'
.pm becomes .py, $ENV becomes env() or something.
If you get lost, try `python --help`, then get mad at how blindingly
stupid that error message is while you follow its instructions (but
maintain your sense of humor and take a moment to laugh at the irony of
how it refuses to take its own (singular and unambiguous) advice on
your behalf.)
--Eric
--
"If you only know how to use a hammer, every problem begins to look like
a nail."
--Richard B. Johnson
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------
More information about the Pdx-pm-list
mailing list