Just another pp4gae weblogpypress4gae is too long for a project name, and this app named pp4gae, so I renamed the project to pp4gae. Google Code SVN is very slow for me, wait for half a minute to get a compare result is unbareble. So I moved it to github, which is fast and powerful. http://github.com/zrenx/pp4gae Right now, there's just the app in github, you'll need to download the web2py_src.zip
How can I run an untrusted Python script safely (i.e. Sandbox) See also: Security, SandboxedPython. I've noticed that some people mention a Python style sandbox, but nothing concrete. Here's my problem: I would like to be able to distribue a Python script to be run on computers that may not trust me (I.E. for use as a Folding@Home kind of distributed application.) However, I would like my Python s
Geohash Geohash is a Python module that provides functions for decoding and encoding Geohashes to and from latitude and longitude coordinates. Example: >>> import Geohash >>> print 'Geohash for 42.6, -5.6:', Geohash.encode(42.6, -5.6) Geohash for 42.6, -5.6: ezs42e44yx96 You can specify an arbitrary precision when encoding. The precision determines the number of characters in the Geohash: >>> prin
Flaskですがあんまり書かれてなさそうなので書いておきます。 Flaskはmitsuhiko先生が作ったmicroframeworkです。 Flaskが指すmicroは単純に小さいというわけではなく、他のライブラリをつなぎ、シンプルなAPIを 提供する小さなフレームワークのようなイメージです。 Flaskは werkzeug jinja2 に依存し、単体の機能はそれらに任せています. Flaskそれらをうまくつなぎ合わせ、シンプルなAPIをユーザに提供しています。 そのため、Flaskは1ファイルで構成されています。 (つなぎの部分なので小さい。APIのドキュメント込みで900行を切っている) 一応Flaskはmicroframeworkとしていますが、コアはwerkzeugです。 werkzeugは大規模サイトなどの実績もあり、大変便利なライブラリです。 Flask自体で提供されていな
内容 python初学者向けの頻出アイテムチートシートを作成してみました。 A4用紙に印刷してちょうどいいように必要事項をみっしりと敷き詰めています。pythonプログラミングのお供にどうぞ。 目次 if文 while文 for文 continue/break文 論理演算 算術演算 関数 リスト ディクショナリ map タプル モジュール クラス 例外 の基本的なことをできるだけたくさん盛り込みたかったので記述順番はぐちゃぐちゃしてしまった感じです。 記述ミスあったらごめんなさい。指摘あれば直します 最新版のDLは こちらからどうぞ(v1.1)。 (zip/約50kb/中身はpdf) 古いバージョン v1.1 コメントのid:t-tanakaさん指摘を修正 b:id:cu39さんのコメント「M+2VM+IPAG circleですね。」を見てフォントを「M+2VM+IPAG circle」に
hochwertiges Bildmaterial für die Grüne Branche Finden Sie emotionale Bilder für Ihre Produkte Ganz egal, ob Sie Ihren Katalog neu gestalten möchten, hochwertige Fotos für Ihre Homepage brauchen oder Ihnen noch gutes Bildmaterial für Ihre Pressearbeit fehlt – in unserer Bilddatenbank finden Sie übersichtlich nach Kategorien gegliedert mehr als 50.000 Pflanzenfotos. Nutzen Sie die Vorteile einer pr
AndrewTrick, benjamin.peterson, cameron, chrisl, ckassab, cmcqueen1975, djc, doko, dpeterson, facundobatista, gregory.p.smith, hozn, jamesbroadhead, jarek.jpa, jcea, jjlee, kxroberto, l, martin.panter, matb, matejcik, mihalis68, mjpieters, mwilck, nfl, orsenthil, piranha, poeml, r.david.murray, statik, vila
リスト内包表記(LC)使った方が圧倒的にコードが読みやすく、短くなる。慣れてないという理由で使われてない気がするので今後の自分のためにも、メモを残す。 LCは基本的に、ListやHashを処理する際に使用される。例えば、規則性のある並びのListが欲しい時などに利用すると良い。 1, 基礎 リストの作成 forの前が処理、forからList名までがひとつのforの段落で前から評価される。 src_list = [1,2,3,4,5] print [x for x in src_list] # [1,2,3,4,5] リストの作成2 for部で取り出された要素が、その後ろif部で評価され真だったものだけが、初めのx*2に渡され処理される(この場合は、2.4だけ) src_list = [1,2,3,4,5] print [x*2 for x in src_list if x % 2 == 0
超簡単とか書いてあったけど、実装は数分だが問題理解するのがむづかった。 問題はココ http://ameblo.jp/programming/entry-10001721422.html 自分なりの回答 def deck(member, cards): """ >>> deck(3, "123123123") ['111', '222', '333'] >>> deck(4, "123123123") ['12', '23', '31', '12'] >>> deck(6, "012345012345012345") ['000', '111', '222', '333', '444', '555'] >>> deck(4, '111122223333') ['123', '123', '123', '123'] >>> deck(1, '012345012345012345') ['01
Yahoo!デベロッパーネットワークでアプリケーションIDを登録。 日本語係り受け解析については以下を参考に。 テキスト解析:日本語係り受け解析 - Yahoo!デベロッパーネットワーク http://python.blog-slime.com/2007/07/urllibpost.htmlを参考に書いてみた。 #!/usr/bin/env python # -*- coding: utf-8 -*- import urllib appid = '***************(登録したアプリケーションID)' sentence = u'全裸は良くない'.encode('utf-8') postdata = { 'appid' : appid, 'sentence' : sentence, } params = urllib.urlencode(postdata) url = 'http:
checked が配列なので pos in checked が遅い。 勝手に採点 (Re: 自分ならこう書く - pythonでA*) - methaneのブログ あー高速化のためにsetを使うってやったことなかったな。 計測 import timeit a = range(100000) b = set(a) def test(): return 100000 in a def test2(): return 100000 in b res = timeit.timeit("test()", "from __main__ import test", number=1000) print(res) res = timeit.timeit("test2()", "from __main__ import test2", number=1000) print(res) 結果 9.9578340
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く