Using the tempfile module to get temporary files

Courtesy of Planet Python , I stumbledover Peter Bengtsson's puzzlement with Python's tempfile module ,especially the mkstemp() function. It's an understandablepuzzlement, because what's going on is fairly tied to Unix semantics(although Python supports mkstemp() on all platforms).

The tempfile module's mkstemp() is a relatively thin shim over theUnix mkstemp(3) library routine, which exists to securely createtemporary files. This is more difficult than it looks; there are all


睏(擬周私鐘)

最近我們都知道是哭泣的時候了,最近我們常常哭泣了,星期日夜晚無端一急就在會上哭出來,開完會通了頂再打電話給英國朋友講廢話到中午黃昏醒來之後,在黑暗的房間裡,忍不住猛烈地哭如同沒頂,像在胃裡掏出來的眼淚

有心有力做好事


有心的朋友又傳來下面這個真人個案,也許亦有很多人看了,不過我想有意義的事還是要讓更多人知道。

我們身在澳門,面對的問題和煩惱都是微不足道的,有時間有心力有錢,多個善事就比多說是非好,多留意這個世界的貧苦

The id attribute considered dangerous

I've been doing various overhauls of DWiki recently (a faster andbetter DWikiText to HTML renderer written by Daniel Martin (and hackedby me, so blame me for any problems) went in tonight, for example).As part of this, I've been looking at the HTML DWiki generates,running it past HTML Tidy and the W3C validator and so on. It's been a learningexperience.

One of the things I've learned is that almost everywhere DWiki codeand templates were


20060208網摘 – Gmail Chat

Web Development

Google Chat

  • 你??的每一句? Quote: ??上,在流氓?件?行的今天,聊天??保存在Google服?器上,要比保存在网吧

五位最喜歡作者 Tag

Jansen 請我寫五位作最喜歡的作者,一時為之語塞,原因自己涉獵不多,學識不廣,一時想不起有哪些「心水」作者,所以遲遲未寫。容許我扭一扭題目,推薦一些我認為不錯的作者。喜歡說不上,但對他們我是相當佩服的:

  • 押井守

討厭石仔路


在“忠+寧”讀到下面的文章,感慨良多,作為雀仔園街坊,我竟然完全沒有考慮過各種設施為傷殘人士引起的不便,真是粗心大意。轉刊忠兄的文字,希望讓更多人看到相關部門的“德政”。

2006年02月3日
畀條生路來

健 身


我們已經決鬥過了
在健身房
鹹濕的汗水
如炸藥毀壞一切
重新拼湊堆疊
我的靈魂我的肉體
城市方圓百里的戰火裡
這是唯一的磐石和迫擊砲
在優雅的滑雪跑步機上踢正步
彷彿千萬里路
才起跑也就是終點了
彈性地板上的集體遊行
恰巧有

$PATH in Solaris

It's always the little things about new Unix systems that get to me.Take $PATH on Solaris.

On a modern Linux distribution with a stock install, a sysadmin's full$PATH needs only five directories:

/bin /usr/bin /sbin /usr/sbin /usr/X11R6/bin

(Sometimes /usr/bin/X11 is used instead of /usr/X11R6/bin .)

On Solaris 9, my $PATH is


coComment 的難度

在 Blogosphere 天南地北,留下不小腳毛 (即留言),但往往會忘記自己曾在哪裏留過,忘記回看,錯失之後可能出現更有價值的討論。 coComment 是一個用來追?你留言的地方,在概念上很好,可以好好追蹤管理,也可以分享,不用單靠 Search Engine 來找