以前、site-packagesディレクトリの位置がわからなくて放置していたデフォルトエンコーディングが、久しぶりにやったらわかったのでメモ。 以下の内容を、「sitecustomize.py」という名前で保存。 import sys sys.setdefaultencoding("utf-8") このファイルを、 /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages へ保存。 ターミナルを再起動し、 >>> import sys >>> sys.getdefaultencoding() 'utf-8' このように表示されればオッケー!
Get Ready for macOS Mojave macOS Mojave was designed with advanced technologies to provide cutting-edge performance and robust security. Core ML 2 and the new Create ML framework let your apps deliver intelligent functionality faster and more easily than ever. Maximize the graphics and compute potential of your apps using advancements in Metal 2. Build richer web experiences in Safari. And with up
Python's Super is nifty, but you can't use it (Previously: Python's Super Considered Harmful) When I first heard about 'super' in python, I thought it sounded like a great idea, and should be adopted by everyone immediately! After all, it fixes inheritance diamonds, makes you not have to encode the superclass name into every call, and lets you use the same structure to call superclass methods as m
There are quite a number of tutorials looking at using Ajax with Django. Despite that, it is still a topic that leaves many confused. I think the fundamental issue is that there are three very different groups looking for tutorials on using Ajax with Django: Experienced web developers who have used a multitude of other frameworks (and used to administer networks composed of passenger pigeons in th
Get full visibility and control over your tasks and projects with Wrike. A cloud-based collaboration, work management, and project management software Wrike offers world-class features that empower cross-functional, distributed, or growing teams take their projects from the initial request stage all the way to tracking work progress and reporting results.
Easy Install Easy Install is a python module (easy_install) bundled with setuptools that lets you automatically download, build, install, and manage Python packages. Please share your experiences with us! If you encounter difficulty installing a package, please contact us via the distutils mailing list. (Note: please DO NOT send private email directly to the author of setuptools; it will be discar
Stateful programmatic web browsing in Python, after Andy Lester’s Perl module WWW::Mechanize. mechanize.Browser and mechanize.UserAgentBase implement the interface of urllib2.OpenerDirector, so: any URL can be opened, not just http: mechanize.UserAgentBase offers easy dynamic configuration of user-agent features like protocol, cookie, redirection and robots.txt handling, without having to make a n
今回は概要を掴む為、極めてシンプルな処理を例にします。 次のようなXML形式の設定ファイルを仮定します。 <?xml version="1.0" encoding="UTF-8"?> <root> <startup>http://www.wxpython.org/</startup> <frame-width>500</frame-width> <frame-height>400</frame-height> </root> これをsetup.xmlとします。 これを次のような辞書に変換することを考えます。 { u'startup': u'http://www.wxpython.org/', u'frame-width': u'500', u'frame-height': u'400' } Foot note この記事のURI参照 http://member
CIPIT88 SLOT If something goes wrong with your order, you'll get a full refund. Here's what's eligible: Your order doesn't match the item description or photos Your item arrived damaged Your item arrived after the estimated arrival window Your item didn't arrive or was lost in the mail View programme terms
Below is a collection of 10 great Python programming books that are available online in full, completely free of charge: Dive into Python This is a fantastic book that is also available in print. It covers everything, from installing Python and the language's syntax, right up to web services and unit testing. This is a good book to learn from, but it's also excellent to use a reference. I frequent
0. Introduction This Usage Guide is not a tutorial on Python, SQL, or SQLite; rather, it is a topical presentation of pysqlite's feature set, with example code to demonstrate basic usage patterns. This guide is meant to be consumed in conjunction with the Python Database API Specification and the SQLite documentation. It was originally written by David Rushby for kinterbasdb. He kindly gave the pe
前回のエントリで、カーオーディオに正しく認識されるMP3-CD作成のために EasyTAGでタグ変換 シェルスクリプトでリネーム を行いました。 タグ変換もスクリプトで一括して行いたいと思い、eyeD3というプログラムを見つけたものの、コマンドラインからだと使いづらい。Pythonから利用するのが良さそうだと思い、やってみることにしました。 Pythonは使ったことがないので、Python入門から始まります。 Python初体験 Hello World #!/usr/bin/python print "Hello World!!" $ ./a.py Hello World!! 標準入力から読んで標準出力に出す 参考:Python でファイルを読む print文の最後にカンマがついてるけど、こうすると改行しなくなるらしい。 #!/usr/bin/python import sys for l
1. 初めに (書きかけ) SQLite は RDMS (関係データベース管理システム) の一種です。 通常の RDMS と異なり面倒なセットアップが不要で、簡単に利用することができます。 通常のファイル並に簡単に扱えるので、 今まではテキストファイルなどに保存していたデータは sqlite に保存するようにすると便利です。 2. Python から SQLite を使う もちろん、Python からも SQLite を利用できます。 Python 2.5 から sqlite3 が build-in package として配布されているので、 すぐに使うことができます。 次の例のように、データファイルに connect するだけで、使うことができます。 データファイルは、 存在しなければ自動的に作成され、 存在すれば、それが開かれます。 また、データの保存はデータベースオブジェクトの co
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く