Just use the "save as" icon:
I write a script (img 1)
Then save as and the name is script.py (img 2)
You can see the file (img 3)
I open the file created but it's empty (img 4)