[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: Argh!! Can't wrap my head around this Python stuff!
From:       Wanderer <wanderer () dialup4less ! com>
Date:       2017-11-26 15:21:43
Message-ID: 68f49b2e-3119-4c69-9f0d-adbb9703c947 () googlegroups ! com
[Download RAW message or body]

On Sunday, November 26, 2017 at 4:10:12 AM UTC-5, Greg Tibbet wrote:
> I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit
> of Java and trying to learn this new-fangled Python language!
> 
> I've got a small program that uses PIL to create an image, draw some
> primitives (rectanges, ellipses, etc...) and save it.  Works fine...
> no issues.
> 
> I've found in the past, the best way to "really learn" the language
> was to "dig into the guts" and understand it,.. I thought I was making
> progress, but when looking into the PIL library to see what's going on
> behind the scenes, I find the following code in ImageDraw.py
> 
> def ellipse(self, xy, fill=None, outline=None):
> """Draw an ellipse."""
> ink, fill = self._getink(outline, fill)
> if fill is not None:
> self.draw.draw_ellipse(xy, fill, 1)
> <...snipped...>
> 
> ellipse() uses the method  self.draw.draw_ellipse()   Okay, fine...
> but WHERE is draw_ellipse defined??  What magic is happening there?
> I've searched the entire PIL directory tree, and the ONLY two places
> draw_ellipse is mentioned are right there in the ellipse() function...
> WHAT am I missing??  
> 
> Thanks!
> -Stumpy (aka Greg)

I'm googlesmart when it comes to Python. I used to know C. I practically knew what \
the assembly language would look like when it compiled. There was no internet and \
searching through books can be really laborious so you almost had to really know it \
to use it. But with Python, I don't start from first principles. I google what I want \
to do, download the appropriate packages and read through the examples. It can be \
really frustrating when you get bugs, because you don't know what's going on deep \
                down in the code.
-- 
https://mail.python.org/mailman/listinfo/python-list


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic