title: Saving a file.txt with a name from TextInput
body: <p>I'm quite new to python and kivy and I'm trying to create simple drawing App on my tablet. I would like to save the output as a .txt file with the name from TextInput (username). 
  (also sorry for my english)</p>
  
  <p>How can I also to make the timer start first after clicking on the Submit button?</p>
  
  <pre class="lang-py prettyprint-override"><code>from kivy.app import App
  # kivy.require("1.8.0")
  from kivy.uix.widget import Widget
  from kivy.graphics import Line
  from kivy.core.image import Image
  from kivy.uix.button import Button
  
  import os
  import time
  
  from kivy.config import Config
  Config.set('graphics', 'width', '700')
  Config.set('graphics', 'height', '700')
  Config.write()
  
  from kivy.uix.gridlayout import GridLayout
  from kivy.uix.boxlayout import BoxLayout
  from kivy.uix.textinput import TextInput
  from kivy.uix.label import Label
  from kivy.lang import Builder
  from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
  from kivy.properties import ObjectProperty
  
  # changing color to white
  from kivy.core.window import Window
  from kivy.graphics import Color
  Window.clearcolor = (1, 1, 1, 1)
  # mode rgba
  
  # Exact date
  # now = time.localtime(time.time())
  # str(now[3]) + ":" + str(now[4]) + ":" + str(now[5])
  
  class MainScreen(Screen):   
  
      username = ObjectProperty(None)
  
      def btn(self):
          x = str(self.username.text)
          print(x)
          return x
  
  class SecondScreen(Screen):
      pass
  class AnotherScreen(Screen):
      pass
  class ScreenManagement(ScreenManager):
      pass   
  
  class DrawInput(Widget):
  
      filename = MainScreen().btn
  
      time_start = time.time()
  
      def on_touch_down(self, touch):
  
          # print(touch.spos, touch.pos)
          timing_ms = time.time() - self.time_start
  
          if os.path.isfile(self.filename+".txt") is True:
              x = open(self.filename+".txt", "a")
              x.write(str(timing_ms) + "\t"
                      + str(touch.spos[0]) + "\t" + str(touch.spos[1]) + "\t" +
                       str(touch.pos[0]) + "\t" + str(touch.pos[1]) + "\t" + "touch" + "\n")
          else: 
              x = open(self.filename+".txt", "w")
              x.write(str(timing_ms) + "\t"
                      + str(touch.spos[0]) + "\t" + str(touch.spos[1]) + "\t" +
                       str(touch.pos[0]) + "\t" + str(touch.pos[1]) + "\t" + "touch" + "\n")              
          with self.canvas:
              Color(0, 0, 0)
              touch.ud["line"] = Line(points = (touch.x, touch.y))
  
  
  
      def on_touch_move(self, touch):
  
          # print(touch.spos, touch.pos)       
          timing_ms = time.time() - self.time_start
  
          if os.path.isfile(self.filename+".txt") is True:
              x = open(self.filename+".txt", "a")
              x.write(str(timing_ms) + "\t"
                      + str(touch.spos[0]) + "\t" + str(touch.spos[1]) + "\t" +
                       str(touch.pos[0]) + "\t" + str(touch.pos[1]) + "\t" + "move" + "\n")
          else:
              x = open(self.filename+".txt", "w")         
              x.write(str(timing_ms) + "\t"
                      + str(touch.spos[0]) + "\t" + str(touch.spos[1]) + "\t" +
                       str(touch.pos[0]) + "\t" + str(touch.pos[1]) + "\t" + "move" + "\n")
  
          touch.ud["line"].points += (touch.x, touch.y)
  
      def on_touch_up(self, touch):     
  
          # print("Released!", touch)
          timing_ms = time.time() - self.time_start
  
          if os.path.isfile(self.filename+".txt") is True:
              x = open(self.filename+".txt", "a")
              x.write(str(timing_ms) + "\t"
                      + str(touch.spos[0]) + "\t" + str(touch.spos[1]) + "\t" +
                       str(touch.pos[0]) + "\t" + str(touch.pos[1]) + "\t" + "released" + "\n")
          else:
              x = open(self.filename+".txt", "w")
              x.write(str(timing_ms) + "\t"
                      + str(touch.spos[0]) + "\t" + str(touch.spos[1]) + "\t" +
                       str(touch.pos[0]) + "\t" + str(touch.pos[1]) + "\t" + "released" + "\n")
  
  
  presentation = Builder.load_file("applepen.kv")
  
  class ApplePen(App):
  
      def build(self):
          return presentation
  
  if __name__=="__main__":
      ApplePen().run()
  
  </code></pre>
  
  <pre><code># File name: ApplePen.py
  #: import FadeTransition kivy.uix.screenmanager.FadeTransition
  
  ScreenManagement:
      transition: FadeTransition()
      MainScreen:
      SecondScreen:
      AnotherScreen:
  
  &lt;MainScreen&gt;:
      name: "main"
      # define global variable username
      username: username
  
      GridLayout:
          cols:1
          # organise the window
          size: root.width, root.height
  
          GridLayout:
              cols: 2
              Label: 
                  text: "Username: "
                  color: 0.5,0.5, 0.5, 1
              TextInput:
                  id: username
                  multiline: False
  
          Button:
              color: 0,1,0,1
              font_size: 50
              #size_hint: 0.5, 0.5
              text: "Submit"
              on_press: root.btn()
              on_release: app.root.current = "drawing"
  
  
  &lt;SecondScreen&gt;:
      name: "drawing"
  
      FloatLayout:
          DrawInput
          Button:
              color: 0,1,0,1
              font_size: 25
              size_hint: 0.3, 0.3
              text: "finished"
              on_release: app.root.current = "other"
  
  
  &lt;AnotherScreen&gt;:
      name: "other"
      Button:
          on_press: app.stop()
          text: "Finished"
          font_size: 50
  
  </code></pre>
  
  <p>The error: 
  if os.path.isfile(self.filename+".txt") is True:
   TypeError: unsupported operand type(s) for +: 'method' and 'str'.
  I tried str() but then the name of the file is something like this: bound method MainScreen.btn of