title: Call one function after another python, wrapping?
body: <p>I have two functions "a" and "b". "b" gets called when a user uploads a file. "b" renames the file and returns the new filename. After that the file is supposed to be edited. Like this:</p>
  
  <pre><code>def a():
      edits file
  def b():
      renames file  
      return file
  </code></pre>
  
  <p>So if b happens and ends, a is supposed to happen. Once "b" returns file the function is over and nothing happens after. Exactly at this point I want "a" to happen, how is this possible? Right now I call "a" with a timer</p>
  
  <pre><code>t=Timer(1.0,a)
  t.start() 
  </code></pre>
  
  <p>but that's not a good solution. I tried with global variables but it doesn't work. I also tried <code>return file, a()</code> cause I thought then a would maybe get started. And finally wrapping it: </p>
  
  <pre><code>def b():
      global filename
      renames filename
      def a():
           edits filename  
      return filename
  </code></pre>
  
  <p>Is there something like <code>if b(): a()</code> ?</p>
  
  <p>Anyone a suggestion?</p>