.py is the extension for a python script. (this is the UI script file, not a video)
Check your output settings.
When you click the ‘clapper button’ to render the viewport.
It will use the render settings.
You can see here that the ‘output’ will render a .mp4 file to the ‘//render/’ folder (which means it will create a folder in the current directory called ‘render’ and stick the output in there)

Those settings should work fine for you.