サクラのライトプラン上でpythonのcgiファイルからレスポンスを返す

まずcgiファイルを作成 try.cgi

#!/usr/local/bin/python 
# -*- coding: utf-8 -*-

class Main(object):
    @staticmethod
    def response():
        print "Content-Type: text/html\n"
        print "<html><body>hello!</body></html>"        

Main.response()

ftpの手順をファイルへ deploy.ftpcmd

open ドメイン
user ユーザ名 パスワード
cd /home/ユーザ名/www
lcd /Users/ローカルのtry.cgiがあるディレクトリ/
put try.cgi
site chmod 755 try.cgi
bye

ftpに上記の手続きを食べさせてデプロイ

ftp -n < deploy.ftpcmd

ftpでアップしたときにtry.cgiパーミッションが変わってしまうので

site chmod 755 try.cgi

の一行を追加してパーミションを振りなおす。