na.TTF) and it
> keeps cutting the bottom part of the the g's q's and y's off.
I've had the same problems. What worked for me was to use
aggdraw instead of PIL's Draw class.
http://effbot.org/zone/aggdraw-index.htm
Mitja
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> On Apr 26, 8:34 pm, asker <[EMAIL PROTECTED]> wrote:
>> But:>>> print "%15.2f" % a+b
>>
>> Traceback (most recent call last):
>> File "", line 1, in
>> TypeError: cannot concatenate 'str' and 'float' objects
>>
>> Is this correct for Python to issue this error?
>
> Th
Fredrik Lundh wrote:
> Almad wrote:
>
>> However, when constructing dictionary with dictionary in constructor
>> like d = RegisterMap({'k':'v'}), __setitem__ is not called
>
> why should it do that? dict() is a concrete implementation, not a
> template class for the creation of dict-like object
Robert R. wrote:
> Hello,
>
> i would like to write a piece of code to help me to align some sequence
> of words and suggest me the ordered common subwords of them
>
> a trouble i have if when having many different strings my results tend
> to be nothing while i still would like to have one of th
f you explicitly want to leave file descriptors 0-2 present
(Do you gain anything by not closing them? If you know, do
tell...), but pointing do /dev/null, you could do:
null = os.open(os.devnull,os.O_WRONLY)
os.dup2(null,0)
os.dup2(null,1)
os.dup2(null,2)
os.close(null)
Untested.
More info on fil
[EMAIL PROTECTED] wrote:
> Is there a module out there that will generate an image with a random text
> string such as the confirmation images you see on various websites?
They're called captcha images or captchas for short.
Googling for "python captcha" returns several hits; see what you like...
le throw this exception? I thought my
sig.signal(sig.SIGSEGV,
exceed) would kick in.
QUESTION 3:
Similarly, if I do the time-expensive stuff inside the python script, why do I
receive
SIGKILL immediately, instead of one second after SIGXCPU (which the script
should catch)
TIA,
Mitja
--
http://mail.python.org/mailman/listinfo/python-list
zefciu wrote:
> In the tutorial there is an example iterator class that revesrses the
> string given to the constructor. The problem is that this class works
> only once, unlike built-in types like string. How to modify it that it
> could work several times? I have tried two approaches. They bo
[EMAIL PROTECTED] wrote:
> Does anyone know of a way to embed python scripts into html, much like
> you would javascript or php?
Two very different things, JS and PHP... First make sure you know what you're
after.
If you want PHP-like embedding of code, google for "python server pages".
Several
John Salerno wrote:
> [EMAIL PROTECTED] wrote:
>> hi
>>
>> if i have a some lines like this
>> a ) "here is first string"
>> b ) "here is string2"
>> c ) "here is string3"
>>
>> When i specify i only want to print the lines that contains "string" ie
> ...
> And I'm actually ashamed to admit that I
Brian Quinlan wrote:
> The fastest algorithm that I have been able to devise for doing so is:
> O(n * log(len(lst))). Can anyone think or a solution with a better time
> complexity? If not, is there an obviously better way to do this
> (assuming n is big and the list size is small).
If list is
DrConti wrote:
> class ObjectClass:
> """ Test primary Key assignment """
>
> if __name__ == "__main__":
> ObjectClassInstantiated=ObjectClass()
> ObjectClassInstantiated.AnAttribute='First PK Elem'
> ObjectClassInstantiated.AnotherOne='Second PK Elem'
> ObjectClassIn
[EMAIL PROTECTED] wrote:
> On more than one occasion, I found myself wanting to use a "conditional
> loop" like this (with "Invalid syntax" error, of course):
>
> for i in c if :
> print i*2
Maybe there's been a PEP, don't really know...
Currently, the only sensible alternati
Steve R. Hastings wrote:
> I was looking at a Python function to find the maximum from a list.
> The original was more complicated; I simplified it. The built-in max()
> function can replace the simplified example, but not the original.
But you forgot to shuw us the original...
[snip several im
>> i have some regular exp code in perl that i want to convert to python.
>> if $line =~ m#<(tag1)>(.*)#
>>{
>> $variable = $2;
>> }
> regexp = re.compile(r"<(tag1)>(.*)")
> line = "sometext"
> match = regexp.search(line)
> if match:
>variable = match.group(2)
Or, if you pre
swisscheese wrote:
> I figured someone out there must have written a minimal code size prime
> number generator. I did not find one after a bit of searching around.
> For primes up to 100 the best I could do was 70 characters (including
> spaces):
>
> r=range(2,99)
> m=[x*y for x in r for y in r]
[hint: posting the same question in newsgroups generally
does not help to get responses any quicker]
Ernesto wrote:
> The string I'm getting data from looks like this:
> [USELESS DATA]
> Request : Play
> [USELESS DATA]
> Title: Beethoven's 5th
> [USELESS DATA]
> Request : next
> [USELESS
28tommy wrote:
> Hi,
> I'm trying to find scripts in html source of a page retrieved from the
> web.
> I'm trying to use the following rule:
>
> match = re.compile('')
>
> I'm testing it on a page that includes the following source:
>
>