write window.py