Viewports

10.  Add a Python Controller
  •  Logic Editor >> Controllers >> Add Controller >> Python
Note:
  • Viewports.py is a python script
     
  • You need a Python Controller to run a python script
11.  Select Viewports.py 
  • Logic Editor >> Controllers >> Python Controller

  • Script >> Script List >> Viewports.py

Note:
  • Earlier, we opened Viewports.py in the Text Editor 
     
  • That added Viewports.py to the game engine's python script list
12.  Connect Logic Bricks
  • Always Sensor >> Python Controller
Note:
  • To connect logic bricks, pull 'wire' from one logic brick output to another logic brick input