docpicture
Steven D'Aprano
steve at REMOVE-THIS-cybersource.com.au
Mon Oct 13 12:46:51 EDT 2008
On Mon, 13 Oct 2008 08:34:03 -0700, bearophileHUGS wrote:
> So in this situation I have sometimes created a quite small image (1
> bit/pixel) that encoded in png image format may require just few hundred
> bytes. With Python I encode is binary data string in base64, and I paste
> that as a string into the Python souce code. It probably takes only 4-7
> lines or so.
[...]
> Have you ever done this? Do you think such "documentation picture"
> (analogous to a docstring) is an acceptable practice?
I've never done it, but I've often wished to be able to store diagrams in
my code.
> I don't need to do
> that often enough, so I think it doesn't deserve to become supported by
> Python itself.
I can't imagine Python having direct syntactic support for it, but I
don't see any reason why the standard library couldn't some day grow a
"docpicture" module, complete with a tiny (?) Tkinter app to display the
diagram when requested.
I think this would be useful. If you choose to share your code under an
appropriate licence, I would like to experiment with it.
--
Steven
More information about the Python-list
mailing list