Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork worker model. The Gunicorn server is broadly compatible with various web frameworks, simply implemented, light on server resources, and fairly speedy. Installation Here's a quick rundown on how to get started with Gunicorn. For more details read the documentation. $ pip install gunicorn $ cat myapp.py def app(environ,
Windows上でOpenRTM-aist-0.4.2のRTCをつくろうとしてRTCTemplateかRTCBuilderからソリューションを生成してもIDLコンパイルができないとコンパイルが通りません。 先日同僚がでくわしたのは、xxxSkel.cc/hhやxxxStub.cc/hhは生成されるのにxxx.hhが生成されず、コンパイルが通らないという現象です。 xxxSkel.cc/hhやxxxStub.cc/hhが生成されるということはIDLコンパイルが通っているのかと思いきやそうでもないようです。 生成されたvcprojファイルのビルド前イベントには下記のようなコマンドが書かれています。 set PATH=$(rtm_path);%PYTHON_ROOT%\\;%PATH% for %%x in (*.idl) do rtm-skelwrapper.py --include-dir=
NOTE: This guide was written for Lion 10.7 and has since been superceded by these new guides: Configuring macOS Python Development Environment on Mac OS X First steps Lion has done away with the “Sites” folder by default, but it’s easy to add it back — the custom icon will even show up automatically. Use the Finder, or enter the following in a Terminal session: mkdir ~/Sites Another change is the
Photo by Fort Photo, "Fountains of Light" 自分のためにメモ。pythonでソートを行おうとする場合、リストに組み込まれている関数list.sort()と、単独で使える関数sorted()の2つがある。基本的に取る引数は同じなので機能自体はあまり変わりないのだが、以下の2点が異なる。 sort()関数は返り値を出さずに、リストの本体自体を変更してしまう。これはreverse()関数と同じ。 sort()関数はソートの対象がリストであるのに対し、sorted()関数は対象がイテレータとなる。 試しにpython上で確認してみる。 >>> x = [1,6,3,8,4] >>> y = [1,6,3,8,4] >>> y.sort() >>> y [1, 3, 4, 6, 8] >>> sorted(x) [1, 3, 4, 6, 8] きちんと両方とも
MS Office 2007以降のファイル(.docx, .xlsx, .pptx)はZip圧縮されたXMLファイルなので、ファイルからのテキスト抽出などが簡単にできます。 .pptxファイルをZipファイルとして展開すると上記のようになります。 各スライドがXMLファイルとして保存されています。 .docx, .xlsx, .pptxはそれぞれディレクトリ構造が若干違います。 読み取り、もしくは書き込みパスワードが設定されている場合はZipファイルとして解凍はできないようです。 import os.path import zipfile def _extract_xmls_from_msxml_base(filepath, prefix): xmls = [] zf = None try: zf = zipfile.ZipFile(filepath, 'r') for name in z
since 2022-12-24 ruby 3.1.2 irb(main):016:1* def add(a, b) irb(main):017:1* a + b irb(main):018:0> end => :add irb(main):019:0> add 1, 3 => 4 irb(main):020:1* def add_new a, b irb(main):021:1* a + b * 2 irb(main):022:0> end => :add_new irb(main):023:0> add_new 1, 3 => 7 irb(main):024:1* def fizzbuzz(num) irb(main):025:1* num irb(main):026:0> end => :fizzbuzz irb(main):027:0> 1.upto(10) { puts fizz
socketモジュールを使う # -*- coding: utf-8 -*- import socket def server(host, port): s = socket.socket() s.bind((host, port)) s.listen(1) conn, addr = s.accept() # クライアントの接続を待つ data = conn.recv(1024) # クライアントからのデータを受信する print "server: receive '%s'" % data conn.send(data.upper()) # クライアントにデータを送信する conn.close() s.close() def client(host, port): s = socket.socket() s.connect((host, port)) s.send("hello") # サ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く