saving .py file to linino filesystem

From the example below:

http://arduino.cc/en/Tutorial/FileWriteScript#.Uw-4b0JdXNU

Is there a way to create a .py file to the linino filesystem and run it from the shell?

Is it a matter of changing: File script = FileSystem.open("/tmp/wlan-stats.sh", FILE_WRITE);

To:

File script = FileSystem.open("/tmp/wlan-stats.py", FILE_WRITE); ???

doesn't matter.