title: TypeError: missing 2 required positional arguments: 'number' and 'open_number'
body: <p>I'm writing a little program that tweets numbers starting from zero and then adds 1, writes it to a text document and then tweets it again with the new written value. Here is my current code I have: </p>
  
  <pre><code>def tweet(number, open_number):
      print(number)
      threading.Timer(20.0, tweet).start()
      while int(number) &gt;= 0:
          api.update_status(number)
          number = number + 1
          number_str = str(number)
          open_number.truncate()
          open_number.write(number_str)
          break
      print(number)
  def main():
      open_number = open("number.txt", "r+")
      print(open_number)
      number = int(open_number.read())
      tweet(number, open_number)
  main()
  </code></pre>
  
  <p>Im taking in the number.txt file which has my starting number, in my case it is 0. I then create a number variable that reads the text document and turns it into an integer as seen in my main function:</p>
  
  <pre><code>    def main():
      open_number = open("number.txt", "r+")
      print(open_number)
      number = int(open_number.read())
      tweet(number, open_number)
  main()
  </code></pre>
  
  <p>from there I call my tweet function that has a timer every time it breads and restarts after 20 seconds. After it makes the first tweet of "0" it then waits 20 seconds and when it tries to make the second tweet I get the following error:</p>
  
  <pre><code>TypeError: tweet() missing 2 required positional arguments: 'number' and 'open_number'
  </code></pre>
  
  <p>another issue Im running into is when it writes the new number It ends up just appending it after the zero e.g.</p>
  
  <p>first run: </p>
  
  <pre><code>0
  </code></pre>
  
  <p>second run:</p>
  
  <pre><code>01
  </code></pre>
  
  <p>rather than just overwriting the entire .txt file. </p>
  
  <p>Not sure how to fix these two issues, any help is appreciated! :) </p>