View Single Post
Old 01-17-2011, 03:26 PM   #10
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by Tegan View Post
I still haven't quite worked out what the lambda call does.
Python supports the creation of anonymous functions (i.e. functions that are not bound to a name), using the "lambda" construct.

Quote:
Line by line:

Code:
for tag in soup.findAll(lambda tag: tag.name.lower()=='img' and tag.has_key('src')):
This is the bit that confuses me most.
Simple - it finds img tags (convert to lower case first and compare tag name to "img") that have a key of "src."

Quote:
Is there a beginners guide to soup?
http://www.crummy.com/software/Beaut...mentation.html

Quote:
How would that change with the new names? Where does one find the names of the Magick calls?
We'll have to let Kovid answer that or point us to documentation.

Quote:
I see a bunch of different calls to the image editor, but I can't find any documentation on how those calls should be phrased in the recipe. I've been Googling like mad, and still can't figure out some of the basics. I think there is a level of programming that I'm missing.
All that's needed are the Magick calls that read the img, tell us the height and width for the compare, rotate the image if needed, and write it back.

Quote:
Can this bit of code be rewritten to apply to the current GoComics and Comics.com recipes so they will be automagically rotated for me?
Yes, provided that the image rotate function is available. I haven't had a chance to go Googling on this.
Starson17 is offline   Reply With Quote