Help us understand the problem. What are the problem?
import requests import json import sys BASE_URL = "https://api.ce-cotoha.com/api/dev/" CLIENT_ID = "オマエ アイディ イレル" CLIENT_SECRET = "オマエ シークレット イレル" def auth(client_id, client_secret): token_url = "https://api.ce-cotoha.com/v1/oauth/accesstokens" headers = { "Content-Type": "application/json", "charset": "UTF-8" } data = { "grantType": "client_credentials", "clientId": client_id, "clientSecret": cli
import tornado.wsgi import gevent.wsgi import pure_tornado application = tornado.wsgi.WSGIApplication([ (r"/", pure_tornado.MainHandler), ],**pure_tornado.settings) if __name__ == "__main__": server = gevent.wsgi.WSGIServer(('', 8888), application) server.serve_forever() 2) "Websocket ready"なhttpサーバとしては使い所あり。 しかし、tornadoに関する数年前のエントリを見るに、WSGIサーバとしてGunicornやgeventなどと比較した記事が多い。GunicornやgeventなどのWSGIサ
はじめに pythonにはcmdという非常に便利なクラスがある。これは簡単に言うと、オリジナルなコマンド待ち受けが作れてしまう。特に自分が気にっているのはアクションの補完機能が勝手に付加されるところ。 何かシンプルなツールを作る時、それは何かのファイルをパースしたり、簡単なデータを送ったり、もちろん普通にスクリプトで書いてもいいと思う。もし、シェルスクリプトなどで作るのが飽きたならば、気分転換でpythonのcmdクラスを使ってみてもいいかもしれない。 実装 ここではシンプルな実装にする。 from cmd import Cmd class testCmd(Cmd): prompt = "hoge) " def __init__(self): Cmd.__init__(self) def do_exe(self, arg): print "do anything" def help_exe
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く