title: get script directory name - Python
body: <p>I know I can use this to get the full file path</p>
  
  <pre><code>os.path.dirname(os.path.realpath(__file__))
  </code></pre>
  
  <p>But I want just the name of the folder, my scrip is in. SO if I have my_script.py and it is located at</p>
  
  <pre><code>/home/user/test/my_script.py
  </code></pre>
  
  <p>I want to return "test" How could I do this?</p>
  
  <p>Thanks</p>