Re: Submit form, open result in a browser

2007-07-27 Thread theju
 Is there a way to submit a form and then open the resulting page in the
 default browser? (Writing the form submission code is not a problem by
 the way)

There is a library called Client Form that does this for you.
wwwsearch.sourceforge.net/ClientForm/

 I guess what I'm asking is how I can get the resulting URL and feed it
 to the webbrowser module.

After the form is submitted through ClientForm open the resulting
response using the webbrowser module.

Cheers
Thejaswi Puthraya

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Usage of the __and__ method

2007-05-31 Thread theju
Thank you folks for reminding me that the logical AND cannot be over-
ridden and that the __and__ method represents the bit-wise AND
operation.

Thank You
Thejaswi Puthraya
http://thejuhyd.blogspot.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Usage of the __and__ method

2007-05-30 Thread theju
Hello all,
I've two objects (both instances of a class called Person) and I want
to use the __and__ method and print the combined attributes of the two
instances.

To be precise, here is my code

class Person:
def __init__(self,name):
self.name = name
def print_name(self):
print self.name
def __and__(self,other):
self.name = '%s AND %s' %(self.name,other.name)
return self.name

p = Person(John)
q = Person(George)

r = p and q
print r.print_name()

Output:
---
George
None

I've also tried this:
class Person:
def __init__(self,name):
self.name = name
def print_name(self):
print self.name
def __and__(self,other):
a = Person()
a.name = '%s AND %s' %(self.name,other.name)
return a

p = Person(John)
q = Person(George)

r = p and q
print r.print_name()

Output:
---
George
None

The above output in both cases is giving me a doubt if __and__ method
is over-ridable or not?

The output that I am accepting is:
John AND George

What are the changes if to be made?

Thanking You
Thejaswi Puthraya
http://thejuhyd.blogspot.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to change font direction?

2006-09-15 Thread theju
Well here are some self explanatory functions that I've written for
displaying the text vertically and from right to left. As for rotation
gimme some more time and i'll come back to you. Also I don't guarantee
that this is the best method(cos I myself am a newbie), but I can
guarantee you that it works.
Here it goes...

im=Image.open(imgfile.jpg)
draw=ImageDraw.Draw(im)

def verdraw(width,height,spacing,a=Defaulttext):
for i in range(0,len(a)):
draw.text((width,height),a[i],(options))
height+=spacing

def right2leftdraw(width,height,spacing,a=Defaulttext):
for i in range(0,len(a)):
draw.text((width,height),a[len(a)-i-1],(options))
width += spacing

options is a 3 field length tuple is mentioned in the PIL-Handbook.
Hope you find it useful
-Theju

Daniel Mark wrote:
 Hello all:

 I am using PIL to draw some graphics and I need to draw some texts
 in vertical direction rather than the default left-to-right horizontal
 direction.
 
 Is there anyway I could do that?
 
 
 Thank you
 -Daniel

-- 
http://mail.python.org/mailman/listinfo/python-list