André wrote:
Docpicture 0.2 has been released. You can download it from
http://code.google.com/p/docpicture/
Docpicture's goal is to enable embedding pictures inside Python
docstrings using some custom domain specific language (dsl).
docpicture includes a plugin architecture enabling users
Docpicture 0.2 has been released. You can download it from
http://code.google.com/p/docpicture/
Docpicture's goal is to enable embedding pictures inside Python
docstrings using some custom domain specific language (dsl).
docpicture includes a plugin architecture enabling users to extend
In message [EMAIL PROTECTED], Pete Forman wrote:
Maybe someone would like to play with the data URL scheme (RFC 2397)
to meet the OP's desire to embed the image. AFAIK a downside is that
MS are only starting to support that in IE8.
Firefox, Konqueror and Safari already support it. So it's
Scott David Daniels [EMAIL PROTECTED] writes:
or you could even use:
'''docpicture name=fig1.png code=base64 version=1
1234567890ABCDEF...
/docpicture'''
A comment _not_ a docstring (only found by scanning the source).
which is easy enough to hunt for.
-1 for XML
Steven D'Aprano wrote:
And if not, it's no big deal. Your help string has a clearly labeled few
lines of hex:
Help on function spam:
spam(...)
spam spam spam spam spam spam
spam spam spam spam with a fried egg on top
=== begin docpicture ===
1234567890ABCDEF...
=== end
André:
Ok, the following is my first attempt at implementing this idea.
I suggest you to change the program you use to encode your images,
because it's 1000 bytes, while with my program the same 256 colors
image needs just 278 bytes:
iVBORw0KGgoNSUhEUgAAABYeCAMfOR5kBGdBTUEAAL
Steven D'Aprano:
Unless bearophile is willing to share his code,
There's no code: all I do is written in my post, and so far I have
done it manually :-)
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
(...)
spam spam spam spam spam spam
spam spam spam spam with a fried egg on top
=== begin docpicture ===
1234567890ABCDEF...
=== end docpicture ===
Or similar. I'm sure people will cope, especially since it should be
relatively rare.
or you could even use
on top
=== begin docpicture ===
1234567890ABCDEF...
=== end docpicture ===
Or similar. I'm sure people will cope, especially since it should be
relatively rare.
or you could even use:
'''docpicture name=fig1.png code=base64 version=1
1234567890ABCDEF
On Oct 14, 1:56 pm, [EMAIL PROTECTED] wrote:
André:
Ok, the following is my first attempt at implementing this idea.
I suggest you to change the program you use to encode your images,
because it's 1000 bytes, while with my program the same 256 colors
image needs just 278 bytes:
(base64) and
str.decode(base64), you don't need to import modules.
Bye,
bearophile
+.5 docpicture. For encoding, it might read in from a file, try
multiple different formats, including SVG, and uses whichever one is
shortest. It might be nice, if they take too many lines, to store
them
André:
A more complete example is now available at
http://code.activestate.com/recipes/576538/
Nice.
The idea for this recipe was mentioned on the Python mailing list as something
desirable and apparently done by someone
That someone has a nickname you can use, I am known in the cookbook
In Python code that processes some geometrical data I want to explain
what each variable like w1, w2, h2, h3, etc, means in the geometrical
objects. In such situation I don't use longer and more clear variable
names because in geometry I'm used to use short vertex/line/length
names, finding them
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
Steven I can't imagine Python having direct syntactic support for it,
Steven but I don't see any reason why the standard library couldn't
Steven some day grow a docpicture module, complete with a tiny (?)
Steven Tkinter app to display the diagram when requested.
Heck, if you go
On Mon, Oct 13, 2008 at 1:43 PM, [EMAIL PROTECTED] wrote:
Steven I can't imagine Python having direct syntactic support for it,
Steven but I don't see any reason why the standard library couldn't
Steven some day grow a docpicture module, complete with a tiny (?)
Steven Tkinter
Benjamin So, the IDEs will support it. what happens when you run the
Benjamin interpreter from the command line?
Probably get ignored. What else would you propose? It's not executable
code anyway, just a special comment or portion of a docstring.
S
--
On Mon, Oct 13, 2008 at 2:48 PM, Joe Strout [EMAIL PROTECTED] wrote:
On Oct 13, 2008, at 12:09 PM, Benjamin Kaplan wrote:
Heck, if you go to the point of including a docpicture module, might as
well
just support the feature in IDLE... Other IDEs would probably pick up the
feature as well
On Oct 13, 2008, at 2:43 PM, Benjamin Kaplan wrote:
I mean what happens when you type help() into the interactive
console on the command line? You will see the docstrings, and there
will be a whole bunch of random hex characters there.
Good point. It might be better put in a
Nothing. It's just a doc string containing a bunch of hex codes. Doc
strings are ignored by the interpreter (AIUI).
Benjamin I mean what happens when you type help() into the interactive
Benjamin console on the command line? You will see the docstrings, and
Benjamin there
labeled few
lines of hex:
Help on function spam:
spam(...)
spam spam spam spam spam spam
spam spam spam spam with a fried egg on top
=== begin docpicture ===
1234567890ABCDEF
1234567890ABCDEF
1234567890ABCDEF
1234567890ABCDEF
=== end docpicture ===
Or similar
21 matches
Mail list logo