Using pyboard.py you can use Python running on your PC to execute commands on the connected pyboard. See examples in that file.