From: Fernando P. <Fer...@co...> - 2005-07-06 16:17:29
|
John Hunter wrote: >>>>>>"Fernando" == Fernando Perez <Fer...@co...> writes: > > > Fernando> Stephen Walton wrote: > >> Fernando Perez wrote: > >>> Well, it could be something like $HOME/.tex.cache, where $HOME > >>> can be determined via a routine like the below (this is what > >>> ipython uses to try and guess a sensible value for $HOME): > >> I *like* it. > > Fernando> Though I'd personally vote for matplotlib holding > Fernando> $HOME/.matplotlib/ as a directory, and putting in there > Fernando> a tex.cache dir, the matplotlibrc file, and anything > Fernando> else it may need in the future. > > I am in the process of moving all of matplotlib's config files and > outputs to HOME/.matplotlib. Great! > what I am really after is a simple print >> sys.stderr. Is there > anything wrong with using sys.stderr for this kind of thing, error > mavens? I know when we discussed this many moons ago we converged on > using exceptions and the warnings module everywhere. But now I am a > bit confounded by the inability to make the warnings print pretty > messages that the typical user will read and understand. Or is there > a way to tell warning.warn to just print the error message with no > lineno/traceback info? Dunno, sorry. In ipython, I have a trivial warn() routine which is just a print >> sys.stderr wrapper. I've never used the stdlib's warnings module. Cheers, f |