i have created lines in graphwin but i did it the long way is there a simpler way using loops ?
cheers
graphic Lines
def drawlines():
win = GraphWin("lines", 200, 200)
line = Line(Point(100, 100), Point(200, 200))
line1 = Line(Point(100, 100), Point(150, 200))
line2 = Line(Point(100, 100), Point(100, 200))
line3 = Line(Point(100, 100), Point(50, 200))
line4 = Line(Point(100, 100), Point(0, 200))
line5 = Line(Point(100, 100), Point(200, 0))
line6 = Line(Point(100, 100), Point(200, 50))
line7 = Line(Point(100, 100), Point(200, 100))
line8 = Line(Point(100, 100), Point(200, 150))
line0 = Line(Point(100, 100), Point(100, -50))
line10 = Line(Point(100, 100), Point(-50, 100))
line20 = Line(Point(100, 100), Point(150, -50))
line30 = Line(Point(100, 100), Point(-50, 150))
line40 = Line(Point(100, 100), Point(-50, 50))
line50 = Line(Point(100, 100), Point(50, -50))
line60 = Line(Point(100, 100), Point(-200, -200))
line.draw(win)
line1.draw(win)
line2.draw(win)
line3.draw(win)
line4.draw(win)
line5.draw(win)
line6.draw(win)
line7.draw(win)
line8.draw(win)
line0.draw(win)
line10.draw(win)
line20.draw(win)
line30.draw(win)
line40.draw(win)
line50.draw(win)
line60.draw(win)
drawlines()
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.