1. Connect to your Raspberry Pi with SSH:
$ ssh root@192.168.1.1xx(IP)
password: openelec
2. Check
# python
Python 2.7.3 (default, Mar 31 2015, 22:10:50)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
3. Write
# nano myScript.py
Or edit your script with your beloved IDE on your PC directly via net protocole (ftp, samba,..) like I'm doing with my Banana Pi.
Bear in mind for some external python modules you should include them before compiling OpenElec from source, or crosscompile if they're binaries, see.