K
kj
Hi! Does anyone know of an easy way to convert a Unicode string into an image file (either jpg or png)?
TIA!
~k
TIA!
~k
Hi! Does anyone know of an easy way to convert a Unicode string into an image file (either jpg or png)?
The question has no meaning as presently worded.kj said:Hi! Does anyone know of an easy way to convert a Unicode string into an image file (either jpg or png)?
TIA!
~k
In said:n image file (either jpg or png)?
Do you mean you have some text and you want an image containing that
text? PIL's ImageDraw module can do that.
kj said:Thanks for the pointer, but...
<RANT>
The documentation I have found for PIL (at
http://www.pythonware.com/library/pil/handbook) is beyond atrocious.
If this is the only way to learn how to use this library, then I
really don't understand how anyone who is not clairvoyant can do it.
Example: I went to the docs page for ImageDraw. There I find that
the constructor for an ImageDraw.Draw object takes an argument,
but *what* this argument should be (integer? object? string?) is
left entirely undefined. From the examples given I *guessed* that
it was an object of class Image, so I repeated the exercise: I
consulted the docs for the Image module. There I learn that the
constructor for the Image class takes among its parameters one
called "mode" and one called "color", but, here again, what these
parameters are is left completely undefined. ("mode" is left both
syntactically and semantically undefined; "color" is left syntactically
undefined, though the documentation includes a bit by way of semantic
definition of this parameter.)
What's up with this practice of leaving parameters undefined like
this??? Wasn't it obvious to the person writing the Image module
docs that without explaining what these parameters should be the
documentation is nearly useless? Is such poor documentation an
unintended consequence of "duck typing"???
Sorry for the outburst, but unfortunately, PIL is not alone in
this. Python is awash in poor documentation.
The number two complaint I've heard from those who dislike Python
is the poor quality of its documentation, and in particular the
fact that function parameters are typically left undefined, as is
the case in the PIL docs. I like Python a lot, but I have to agree
with this criticism. (The number one complaint has to do with the
syntactic significance of whitespace; of course, I find *this*
criticism silly.)
What is most frustrating about such poor documentation is that it
is exactly the opposite from what one would expect from the
carefulness and thoroughness found in the PEPs...
I have been using Python as my primary scripting language for about
one year, after many years of programming in Perl, and now Python
is my language of choice. But I must say that the documentation
standards I found in the Perl world are *well above* those in the
Python world. This is not to say that Perl documentation is always
excellent; it certainly has its gaps, as one would expect from
volunteer-contributed software. But I don't recall being frustrated
by Perl module docs anywhere nearly as often as I am by Python
module docs. I have to conclude that the problem with Python docs
is somehow "systemic"...
kj said:Example: I went to the docs page for ImageDraw. There I find that
the constructor for an ImageDraw.Draw object takes an argument,
but *what* this argument should be (integer? object? string?) is
left entirely undefined. From the examples given I *guessed* that
it was an object of class Image[...]
Sorry for the outburst, but unfortunately, PIL is not alone in
this. Python is awash in poor documentation. [...]
I have to conclude that the problem with Python docs
is somehow "systemic"...
Sorry for the outburst, but unfortunately, PIL is not alone in
this. Python is awash in poor documentation. [...]
I have to conclude that the problem with Python docs
is somehow "systemic"...
Yes, if everyone else disagrees with you, the problem is obviously
"systemic".
What helps are concrete suggestions to the package maintainers about
how these improvements could be made, rather than huge sprawling
attacks on the state of Python documentation (and trying to tie it
into the state of Python itself) as a whole. ]
Instead, what we get are
huge pointless rants like yours whenever someone finds that something
isn't spelled out for them in exactly the way that they want.
These people are _volunteering_ their effort and their code,
all
you're providing is an over-excess of hyperbole
and punctuation. What
is frustrating to me is seeing people like yourself spend far more
time slamming these projects than actually contributing useful changes
back.
Face the facts dude. The Python docs have some major problems.
They were pretty good when Python was a new, cool, project used
by a handful of geeks. They are good relative to the "average"
(whatever that is) open source project -- but that bar is so low
as to be a string lying on the ground.
Thomas Jollans said:Actually, the Python standard library reference manual is excellent. At least
that's my opinion....
What exactly are you comparing the Python docs to, I wonder? Obviously not
something like Vala, but that goes without saying.
I didn't know Vala had especially good docs.
example, tkinter has been part of the stdlib for at least a decade but
is totally undocumented in the Python library manual.
Actually, the Python standard library reference manual is excellent. At
least that's my opinion.
The Python docs have some major problems.
Actually, the Python standard library reference manual is excellent. At least
that's my opinion.
Granted, it's not necessarily the best in the world. It could probably be
better. But that goes for just about every documentation effort there is.
What exactly are you comparing the Python docs to, I wonder? Obviously not
something like Vala, but that goes without saying. "kj" said that the Perl
docs were better. I can't comment on that. I also won't comment on the sorry
mess that the language "Perl" is, either.
There are a few documentation efforts that I recognize are actually better
than the Python docs: Firstly, the MSDN Library docs for the .Net framework.
Not that I refer to it much, but it is excellent, and it probably was a pretty
darn expensive project too. Secondly, the libc development manual pages on
Linux and the BSDs. Provided you know your way around the C library, they are
really a top-notch reference.
And I have no idea what you think they are.
I have participated in 71 doc improvement issues on the tracker. Most of
those I either initiated or provided suggestions. How many have you
helped with?
Certainly not 71. But there is, for example, http://bugs.python.org/issue1397474
Please note the date on it.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.