title: iTerm2 3.3 Python API -- how to create a 2x2 grid of sessions?
body: <p>I am trying to write a Python script to create a new tab with a 2x2 grid of sessions but I am finding the docs to be lacking.</p>
  
  <p>The following is what I have so far (which doesn't work), can any one help?</p>
  
  <pre class="lang-py prettyprint-override"><code>#!/usr/bin/env python3.7
  
  import iterm2
  # This script was created with the "basic" environment which does not support adding dependencies
  # with pip.
  
  async def main(connection):
      # Your code goes here. Here's a bit of example code that adds a tab to the current window:
      app = await iterm2.async_get_app(connection)
      window = app.current_terminal_window
      if window is not None:
          await window.async_create_tab()
          session = tab.current_session
  
          await session.async_split_pane()
  
          await tab.async_select_pane_in_direction(iterm2.NavigationDirection.BELOW)
          await session.async_split_pane()
  
          # await tab.async_select_pane_in_direction(iterm2.NavigationDirection.ABOVE)
          # await session.async_split_pane()
      else:
          print("No current window")
  
  iterm2.run_until_complete(main)
  </code></pre>