title: I cannot find my error and it repeats forever
body: <p>Below while-loop is meant to repeat forever (thus <code>i=0</code> never modified inside the loop). The loop has a <code>checkpoint</code> so every read line continues where it left off.</p>
  <p>But the checkpoint is not working, any way to fix that? Okay, I am not modifying the i var (which is a big suggestion) unless it is done, so it repeats, resumes checkpoint, and writes data, repeat. BUT what I am trying to say is that the checkpoint is broken and the program will not end after it is done reading all of the file.</p>
  <h3>Code</h3>
  <pre><code>i = 0
  while i == 0:
    file1 = open('APPMAKE', 'r')
    Lines = file1.readlines()
   
    count = 0
    checkpoint = 0
    ccount = 1
    modeset = 0
    # Strips the newline character
    for line in Lines:
        count += 1
        ccount += 1
        modeset += 1
        if ccount &gt; checkpoint:
          checkpoint += 1
          if modeset &gt; 2:
             modeset == 1
          if modeset == 1:
             elfexecutable = line
          if modeset == 2:
             appname = line
             checkpoint = count + 1
             break
    #writing data
    file1.close()
    file2 = open(appname + &quot;.app&quot;, &quot;a&quot;)  # append mode
    file2.write(elfexecutable + &quot;\n&quot;)
    file2.close()
      
      
  </code></pre>
  <p>I put this in the APPMAKE file to test:</p>
  <pre><code>elf.elf
  ap.app
  elf.elf
  ap.app
  elf.elf
  ap.app
  elf.elf
  ap.app
  </code></pre>
  <p>Oh, and I made a manual to use this Python script. This <em>might</em> help you understand it:</p>
  <pre class="lang-text prettyprint-override"><code>APP MAKE INSTRUCTIONS
  =====================
  
  First, to generate app, create a APPMAKE file. Next, add repeated code scripts
  that are like this:
  
  [elf file to link to]
  [app file name]
  ...
  
  Then, you made a APPMAKE file! To make more configs, list more of the scripts above.
  Remember yo replace the things in the []s! Also, you can make a app run more than
  1 elf you can make more than 1 configuration for each file. Now, how do you
  run a APPMAKE file? Well first go copy &amp; paste (do this sentence if your project is
  not a template) the elfexepreferences.sh file into the folder with the
  APPMAKE file. (do this even if your project is a template --&gt;) Now, edit the file
  you just pasted and edit the part that looks like this:
  
  elfexecute () {
     [function to execute elf] $1
  }
  
  Edit the []s depending on what system your apps are running on. (the elf
  exepreferences file needs to be in every dir with a APPMAKE file.) And, getting close
  to finished, copy and paste the elfexecuter.sh to your programs's main dir if it is
  not already there. Then, in the same dir as the elfexecuter.sh file, add a
  appexecute file and add a list of the APP files. Now, wanna make an app? To
  execute the APPMAKE file, copy and paste appmake.py to the same dir
  as the programs if it is not already there. Execute it and your app is
  compiled. NOTICE: appexecute conatins names of .app files! Add the extensions!
  
  So, I obeyed with my manual and tested the first few steps and got this to repeat and write a ENDLESS amount of elf.elf to my app file! Can someone please help!
  </code></pre>
  <p>My new edit but it still does not work:</p>
  <pre><code>checkpoint = 0
  i = 5
  while i == 5:
    file1 = open('APPMAKE', 'r')
    Lines = file1.readlines()
   
    count = 0
    ccount = 0
    modeset = 0
    # Strips the newline character
    for line in Lines:
        count += 1
        ccount += 1
        modeset += 1
        if modeset &gt; 2:
             modeset == 1
        if ccount &gt; checkpoint:
          checkpoint += 1
          if modeset == 1:
             elfexecutable = line
          if modeset == 2:
             appname = line
             checkpoint = count + 1
             break
    #writing data
    file1.close()
    file2 = open(appname + &quot;.app&quot;, &quot;a&quot;)  # append mode
    file2.write(elfexecutable + &quot;\n&quot;)
    file2.close()
      
      
  </code></pre>
  <p>SOO, above is my newest edit but it <em>still will not work</em>! Any help is appreciated. I listened to all the suggestions with the new edit.</p>