Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7911743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:21:38+00:00 2026-06-03T13:21:38+00:00

So, I tried to simplify my work and ended up making a mistake when

  • 0

So, I tried to simplify my work and ended up making a mistake when I asked the first time.
What I was trying to ask was why doesn’t this line work?

self.canvas.create_line(A,B,C,D)

Now the question is to specific and wont be of use to other people so I don’t mind if you delete this post. Unfortunately i cant delete it.

from tkinter import Tk, Canvas, Frame, BOTH


class Lsystem(Frame):

    def rule_1(self): #A0
        self.r.append(1)
        self.r.append(0)

        A = self.lastCo[0][0]
        B = self.lastCo[0][1]
        C = self.lastCo[0][0]+self.length
        D = self.lastCo[0][1]+self.length

        self.canvas.create_line(A,B,C,D)


    def rule_2(self): #B1
        self.r.append(1)

    def lindenL(self, num):
        x = 0
        while x < num:
            for cycle in list(range(len(self.q))):
                if self.q[0] == 1: self.rule_1()
                else: self.rule_2()
                self.q.pop(0)
            self.q = self.r
            #print (self.q)
            x += 1

        return self.q

    def setVariables(self):
        self.r = []
        self.q = [1]
        self.line = []
        self.length = 100
        self.maxCo = [800, 600]
        self.lastCo = [[400,600],[0,0]] #0 is A(0), 1 is B(1)

    def __init__(self, parent):
        Frame.__init__(self, parent)   

        self.setVariables()
        self.parent = parent        
        self.initUI()

        print(self.lindenL(2))

    def initUI(self):
        self.parent.title("Shapes")        
        self.pack(fill=BOTH, expand=1)
        self.canvas = Canvas(self)

        self.draw()

        self.canvas.pack()

    def draw(self):
        pass
        #self.canvas.create_line(self.calcCoA())


def main():

    root = Tk()
    ex = Lsystem(root)
    root.geometry("800x600+300+300")
    root.mainloop()  


if __name__ == '__main__':
    main()  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:21:39+00:00Added an answer on June 3, 2026 at 1:21 pm

    You forgot to pack your canvas

    eg.

      canvas = Canvas(self)
      canvas.pack()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've tried to simplify for the purposes of asking this question. Hopefully, this will
I apologize in advance; this is a long question. I've tried to simplify as
At work we are trying to simplify an application that was coded with an
Tried this: $('.link').click(function(e) { $.getScript('http://www.google.com/uds/api?file=uds.js&amp;v=1.0', function() { $('body').append('<p>GOOGLE API (UDS) is loaded</p>'); }); return
Tried a bunch of things but I can't get it to work consistently amid
I'm trying to get Flex 3 and OpenX to work together. Everything works great
I am trying to use lookbehinds in a regular expression and it doesn't seem
So, i'm building my first SL application. I tried to use the MVVM approach,
This is an extension of a previous question I asked. I ran into some
I have tried to simplify and annotate the code which is giving me a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.