title: How to pass input parameter from a text file in Python?
body: <p>I have been working on a GUI timer where time has to be given in the parameter. But the time can vary so I want to give the input from a text file. </p>
  
  <p>The code is taken from the 1st answer.</p>
  
  <p><a href="https://stackoverflow.com/questions/10596988/making-a-countdown-timer-with-python-and-tkinter">Making a countdown timer with Python and Tkinter?</a></p>
  
  <p>What I have tried:</p>
  
  <pre><code>f = open('f.txt', 'r')
  data = f.read()     
  f.close()               
  print data  
  s = 'data'
  self.countdown(s)
  </code></pre>
  
  <p>The f.txt file has a number 10.</p>
  
  <p>But not working due to datatype and getting the error below:</p>
  
  <pre><code>Traceback (most recent call last):
  File "new.py", line 33, in &lt;module&gt;
  app = ExampleApp()
  File "new.py", line 15, in __init__
  self.countdown(s)
  File "new.py", line 28, in countdown
  self.label.configure(text="%d" % self.remaining)
  TypeError: %d format: a number is required, not str
  </code></pre>
  
  <p>Any help would be appreciated. </p>