Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81810

Re: i have to create this patch in python but wasnt having any luck i was wondering if anyone had a solution?

References <6bfc3acd-0a71-4f76-a335-022d0a7fc535@googlegroups.com>
Date 2014-12-02 14:24 -0500
Subject Re: i have to create this patch in python but wasnt having any luck i was wondering if anyone had a solution?
From Joel Goldstick <joel.goldstick@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.16500.1417548252.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Dec 1, 2014 at 2:28 PM, python help required
<19aadan95@gmail.com> wrote:
> def penultimatePatch():
>
>     win = GraphWin("Patch1",(100), 100)
>     amountOfCircles = 5
>
>     #Filled Red Circles
>     fillCircle = Circle(Point(20,20)+100/amountOfCircles)
>     fillCircle.draw(win)
>     fillCircle.setFill("red")
>
>     #Verticle white rectangles
>     rectangleVerticle1 = Rectangle(Point(0,0), Point(10,100))
>     rectangleVerticle1.setFill("white")
>     rectangleVerticle1.setOutline("white")
>     rectangleVerticle1.draw(win)

The above, and all below should be put in a function like so:

def rectangle_function(rectangle_name, Point(0,0), Point(10,100)):
     #Verticle white rectangles
    rectangle_name = Rectangle(Point(0,0), Point(10,100))
    rectangle_name.setFill("white")
    rectangle_name.setOutline("white")
    rectangle_name.draw(win)
>
>     rectangleVerticle2 = Rectangle(Point(41,0), Point(51,100))
>     rectangleVerticle2.setFill("white")
>     rectangleVerticle2.setOutline("white")
>     rectangleVerticle2.draw(win)
>
>     rectangleVerticle3 = Rectangle(Point(81,0), Point(91,100))
>     rectangleVerticle3.setFill("white")
>     rectangleVerticle3.setOutline("white")
>     rectangleVerticle3.draw(win)
>
>     #Horizontal white rectangles
>     rectangleHorizontal = Rectangle(Point(21,11), Point(41,21))
>     rectangleHorizontal.setFill("white")
>     rectangleHorizontal.setOutline("white")
>     rectangleHorizontal.draw(win)
>
>     rectangleHorizontal = Rectangle(Point(61,11), Point(81,21))
>     rectangleHorizontal.setFill("white")
>     rectangleHorizontal.setOutline("white")
>     rectangleHorizontal.draw(win)
>
>     rectangleHorizontal = Rectangle(Point(21,31), Point(51,41))
>     rectangleHorizontal.setFill("white")
>     rectangleHorizontal.setOutline("white")
>     rectangleHorizontal.draw(win)
>
>     rectangleHorizontal = Rectangle(Point(81,31), Point(61,41))
>     rectangleHorizontal.setFill("white")
>     rectangleHorizontal.setOutline("white")
>     rectangleHorizontal.draw(win)
>
>     rectangleHorizontal = Rectangle(Point(21,51), Point(51,61))
>     rectangleHorizontal.setFill("white")
>     rectangleHorizontal.setOutline("white")
>     rectangleHorizontal.draw(win)
>
>     rectangleHorizontal = Rectangle(Point(61,51), Point(91,61))
>     rectangleHorizontal.setFill("white")
>     rectangleHorizontal.setOutline("white")
>     rectangleHorizontal.draw(win)
>
>     rectangleHorizontal = Rectangle(Point(21,71), Point(51,81))
>     rectangleHorizontal.setFill("white")
>     rectangleHorizontal.setOutline("white")
>     rectangleHorizontal.draw(win)
>
>     rectangleHorizontal = Rectangle(Point(61,71), Point(81,81))
>     rectangleHorizontal.setFill("white")
>     rectangleHorizontal.setOutline("white")
>     rectangleHorizontal.draw(win)
>
>     rectangleHorizontal = Rectangle(Point(21,91), Point(51,100))
>     rectangleHorizontal.setFill("white")
>     rectangleHorizontal.setOutline("white")
>     rectangleHorizontal.draw(win)
>
>     rectangleHorizontal = Rectangle(Point(61,91), Point(91,100))
>     rectangleHorizontal.setFill("white")
>     rectangleHorizontal.setOutline("white")
>     rectangleHorizontal.draw(win)
>
>     #Outlined Red circles
>     fillCircle = Circle(Point(20,20)+100/amountOfCircles)
>     fillCircle.draw(win)
>     fillCircle.setOutline("red")
>
> it is supposed to create this design>>> http://i.stack.imgur.com/2dfGi.jpg
> --
> https://mail.python.org/mailman/listinfo/python-list

What results did you get?  If you get a traceback, copy it completely
and paste it in your response.





-- 
Joel Goldstick
http://joelgoldstick.com

Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

i have to create this patch in python but wasnt having any luck i was wondering if anyone had a solution? python help required <19aadan95@gmail.com> - 2014-12-01 11:28 -0800
  Re: i have to create this patch in python but wasnt having any luck i was wondering if anyone had a solution? Joel Goldstick <joel.goldstick@gmail.com> - 2014-12-02 14:24 -0500

csiph-web