pySDL2 Display without End Loop
Question: In every pySLD2 example I've found, I've seen a loop at the end of the code to
keep the window open until closure. For example:

    
    
    #!/usr/bin/env python
    """
    The code is placed into public domain
    by anatoly techtonik <techtonik@gmail.com>
    """
    import sdl2
    import sdl2.ext as lib
    
    lib.init()
    
    window = lib.Window('', size=(300, 100))
    window.show()
    
    renderer = lib.Renderer(window)
    renderer.draw_point([10,10], lib.Color(255,255,255))
    renderer.present()
    
    ####Specifically this loop####
    running = True
    while running:
      for e in lib.get_events():
        if e.type == sdl2.SDL_QUIT:
          running = False
          break
        if e.type == sdl2.SDL_KEYDOWN:
          if e.key.keysym.sym == sdl2.SDLK_ESCAPE:
            running = False
            break
    

All event handlers I've seen have been blocking. Is there a way, like I have
seen done in standard SDL, to simply call **initialization and updating
functions on a window that stays open**. I am writing to write this as an
external library that I can call independently from any project.

Any ideas? Thanks!

EDIT: As per request for a way to do this in standard SDL,
[this](https://github.com/aacoppa/Graphics_Engine_America/blob/master/src/screen.c)
works. Just call the init function to set up the screen and it will stay until
you close it.


Answer: You are misinterpreting the example - this is an additional hook (screen.c) to
be set up in the main loop.

SDL uses the main loop approach to deal with events, update the window
display, etc. Yes, there is a way to work around that. Create your very own
window and use whatever approach to keep it open, get the window handle via
the SDL_SysWM* functions and update the window's display buffer.

This however involves some glue code and also requires you to do the window
handling on your own.

