IBM Developer is your one-stop location for getting hands-on training and learning in-demand skills on relevant technologies such as generative AI, data science, AI, and open source.
rubyco(るびこ)の日記 - 呼び出し側のアスタリスクを読んで、「あ、そうか、それを使えば頭から二つずつ取ることができるか」とGame Scripting Memo - 続・パスカルの三角形のことを思い出しました。 >>> def get2(f, a, b, *rest): result = [f(a, b)] if rest: result += get2(f, *rest) return result >>> from operator import add >>> def dup(aList): return reduce(add, [[v, v] for v in aList]) >>> dup([1,2,3]) [1, 1, 2, 2, 3, 3] >>> def sandwich(bread, meat): return [bread] + meat + [bread] >
驚きました。 rubyco(るびこ)の日記 - デフォルト引数は明示的に評価されると同じことをPythonで書いた場合、関数定義の時点で評価されます。 >>> def default(n): print "default", n return n + 1 >>> def foo(x, y = default(5)): print x, y default 5 Rubyでは関数が呼ばれた時にデフォルト引数を評価するようです。しかも遅延評価とかではないようで、何度も関数を呼べば何度も実行されます。つまりPythonで書けば >>> def foo(x, y = None): if y == None: y = default(5) print x, y に相当する状態のようです。
Synopsis These Python modules provide simple yet powerful multi-threaded object-oriented CGI/FastCGI/mod_python/html-templating facilities for the Python programming language. The home page for this project is at http://jonpy.sourceforge.net/, and its SourceForge project page is at http://sourceforge.net/projects/jonpy. See the wt examples page for a quick look at how the templating system works.
企業には、汎用的なAIではなく「ビジネス向けに設計されたAI」が求められることを強調する、新たなキャンペーンを開始しました。これらのアニメーションに込めた「IBMよりお伝えしたい5つのこと」をご紹介します。 最新情報 ドイツと日本の宇宙機関、国際宇宙ステーションでロボット間連携の画期的成果を達成 ドイツテレコム社がIBM Concertを採用し、AIを活用した自動化でIT業務を加速 IBM、2025年度第2四半期の連結決算を発表 日本IBM、医療従事者の業務変革を促進する「病院業務支援AIソリューション」を提供開始 CEOスタディ2025「ビジネス成長を飛躍させるための5つの意識改革」日本語版を公開 IBM、エンタープライズITの水準を引き上げるIBM Power11を発表 ウィンブルドンを主催するオールイングランド・ローンテニス・クラブとIBM、リアルタイムでファン・エンゲージメントを高
Cipit88: Slot88 Situs Slot Gacor Online Gampang Menang Hari Ini Slot88 Terbaru Cipit88 menyediakan platform permainan slot online yang dimana tentunya disaat anda mencoba daftar dan bermain maka jackpot kemenangan malam ini bisa di dapatkan, Banyak orang Indonesia sudah mengenal slot gacor sebagai situs slot dengan deposit tercepat, karena tanpa menunggu lama kredit langsung masuk pada akun. Ini m
CodeSnippetsのPythonカテゴリをぼーっと眺めてたら面白い書き方を見つけました。 http://www.bigbold.com/snippets/tag/python/ あるリストの逆順を得たい時、ふつうこんな感じで >> a = [1, 2, 3, 4, 5, 6] >> a.reverse() >> print a [6, 5, 4, 3, 2, 1] 書きますが、reverseは破壊的メソッドなので場合によってはイヤンな感じ。ですが次のようにかけば大丈夫。 >> a = [1, 2, 3, 4, 5, 6] >> a[::-1] [6, 5, 4, 3, 2, 1] ちなみに、a[::2]だと[1, 3, 5]、a[::3]だと[1,4]が返ってきます。初めて知った。ちょっとおもしろい。 で、これを使ってちょっとコード書いてみたくなったので(手段のために目的がある。。)
みんなのIoT/みんなのPythonの著者。二子玉近く160平米の庭付き一戸建てに嫁/息子/娘/わんこと暮らしてます。月間1000万PV/150万UUのWebサービス運営中。 免責事項 プライバシーポリシー みんなのPython Webアプリ編という書籍に,より詳細な解説が書いてあります。 Pythonの標準モジュールには,ほぼそのままWeb Serverとして使えるモジュールが入っています。これを使うと,簡単にPythonのCGIを試すことができます。 Python 2.4以上の場合 $ python -m CGIHTTPServer とするだけ。 Python 2.4以前の場合 インタラクティブシェルで >>> import CGIHTTPServer >>> CGIHTTPServer.test() とするだけ。 どちらも,ローカルのポート8000番にCGI CapableなHTTP
Many people use Python because, like other scripting languages, it is a portable, platform-independent and general-purpose language that can perform the same tasks as the database-centric, proprietary 4GL tools supplied by database vendors. Like 4GL tools, Python lets you write programs that access, display and update the information in the database with minimal effort. Unlike many 4GLs, Python al
PEP 249 – Python Database API Specification v2.0 Author: Marc-André Lemburg <mal at lemburg.com> Discussions-To: Db-SIG list Status: Final Type: Informational Created: 12-Apr-1999 Post-History: Replaces: 248 Table of Contents Introduction Module Interface Constructors Globals Exceptions Connection Objects Connection methods Cursor Objects Cursor attributes Cursor methods Type Objects and Construct
はてなグループの終了日を2020年1月31日(金)に決定しました 以下のエントリの通り、今年末を目処にはてなグループを終了予定である旨をお知らせしておりました。 2019年末を目処に、はてなグループの提供を終了する予定です - はてなグループ日記 このたび、正式に終了日を決定いたしましたので、以下の通りご確認ください。 終了日: 2020年1月31日(金) エクスポート希望申請期限:2020年1月31日(金) 終了日以降は、はてなグループの閲覧および投稿は行えません。日記のエクスポートが必要な方は以下の記事にしたがって手続きをしてください。 はてなグループに投稿された日記データのエクスポートについて - はてなグループ日記 ご利用のみなさまにはご迷惑をおかけいたしますが、どうぞよろしくお願いいたします。 2020-06-25 追記 はてなグループ日記のエクスポートデータは2020年2月28
簡単な説明 もしすでにPythonがインストールされているならば、たった2ステップでTurboGearsをインストールすることができます: tgsetup.pyスクリプトをダウンロードする tgsetup.pyを実行する(*nixやMacならpython tgsetup.py)注意:TurboGearsの一部はPyrexに依存しており、これはまだPython 2.5に対応していません。ですのでPython 2.4を推奨します。 もう少し詳しく Python 2.4をインストールする Python を初めて手にするのであれば歓迎します。これはすばらしい言語です。 Python 2.4インストーラをダウンロードする(Python 2.5 はまだサポートされていません) インストーラを実行する Path環境変数にPythonを追加する 「マイコンピュータ」を右クリックしたメニュ
沖ソフトウェア株式会社は、沖通信システム株式会社および株式会社沖インフォテックと平成22年10月1日をもって合併いたしました。新会社名は、株式会社OKIソフトウェアとなります。3社が行っております事業は新会社にて従来通り継続いたします。
Closures in Python (part 1) Martin Fowler (obligitary Fowlbot namedrop) recently blogged about the power of closures in languages that support them. Here's a translation of Martin's Ruby code into Python. [Initial sentence and table structure copied from Joe Walnes] (not knowing how to get this to format correctly is my fault. I want to write a part 2, but that'll have to wait as I have other comm
HelloMost authors talk about Java/C++, and describe patterns used as a workaround to their static class model; the dynamic nature of Python allows for trivial implementations in some cases. I've seen some design patterns examples on the ActiveState site, and some discussions some time ago on this list. But does anyone know of a complete discussion/analysis of patterns in Python? Books, articles, w
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く