title: Define context variables in behave python
body: <p>Sometimes, you need to define values dynamically, (like datetime now, random strings, random integers, file contents, etc.) and use them across different steps without being explicit or hard-coding the value.</p>
  
  <p>So, my question is how could I define variables inside of steps (the correct way to do it) to use these variables in the following steps.</p>
  
  <p><strong>Some example</strong></p>
  
  <pre><code>Given A random string of length "100" as "my_text"
  And I log in to my platform
  And I ask to add the following post:
   | title                    | description |
   | Some example of title    | {{my_text}} |
  When I submit the post form
  Then The posts table shows these posts:
   | title                    | description |
   | Some example of title    | {{my_text}} |
  And I delete any post containing in the description "{{my_text}}"
  </code></pre>
  
  <p>This is a basic example trying to explain why I would like to define variables in steps and save them in the context to use it in the following steps.</p>
  
  <p>My idea was to modify before_step and after_step methods... to set a variable in context to store my custom variables like this:</p>
  
  <pre><code>def before_step(context):
      if not hasattr(context, 'vars'):
         context.vars = {}
  
      if hasattr(context, table) and context.table:
         parse_table(context)
  
  def parse_table(context):
      # Here use a regex to check each cell and look for `"{{&lt;identifier&gt;}}"` and if match, replace the cell value by context.vars[identifier] so the step "the posts table shows these posts will never know what is `{{my_text}}` it will be abstract seeing the random string.
  </code></pre>
  
  <p>Scenarios Outline, use something like this defining variables like <code>"&lt;some_identifier&gt;"</code> and then for each example replace the value in the step.</p>
  
  <p>It's basically to reproduce the behaviour but for any kind of step, simple or using tables.</p>
  
  <p><strong>Is it the right way to do something like this?</strong></p>