title: RobotFramework: Define a Python keyword in RobotFramework
body: <p>Good morning,</p>
  
  <p>I've seen in the RobotFramework documentation that it is possible to create keyword in python directly
  (<a href="http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#creating-user-keywords" rel="nofollow noreferrer">http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#creating-user-keywords</a>)</p>
  
  <p>for instance the do_nothing function.</p>
  
  <pre><code>def hello(name):
      print "Hello, %s!" % name
  
  def do_nothing():
      pass
  </code></pre>
  
  <p>It works very well, but the issue is that this has to be added in the variable PYTHONPASS, or in the directory that contains the file.</p>
  
  <p>The issue is that the tests can be performed on more than one computer, and it means that the this variable should be modified on every computer that should run the tests.</p>
  
  <p>Second point, unfortunately my file will be used in several dir.</p>
  
  <p>eg:</p>
  
  <pre><code>A
  A/B
  A/B/C   &lt;== use here
  A/B/D
  A/B/E   &lt;== use here
  ...
  </code></pre>
  
  <p>and so one..</p>
  
  <p>Is it possible to add directly the function at A level only once for instance?</p>
  
  <p>Or is it possible to add it once in the section Keywords of RobotFramework at the A directory level and reference it directly in C and E robot files:</p>
  
  <pre><code>A/lib.robot:
  *** Keywords ***
  def hello(name):
      print "Hello, %s!" % name
  
  def do_nothing():
      pass
  
  C and E:
  *** Settings ***
  Resource    ../../A/lib.robot
  </code></pre>