Saturday, April 17, 2010

[Python]py2app:将python程序转换为Mac OS Application的工具

先安装py2app
安装完毕后会有一个叫py2applet的程序出现
接下来进入我们python程序的目录,比如我们的程序叫HelloWorld.py
第一步: 生成HelloWorld的setup.py
$ py2applet --make-setup HelloWorld.py
第二步: 生成HelloWorld.app的结构
$ python setup.py py2app -A

[Linux]cheeting sheet of sh, csh, bash

sh, csh, bash 比较

Statement sh tcsh bash
if-then-else
if [ expression ] 
then
    ...
else
    ...
fi
if (expression) then
    ...
else
    ...
endif
注:then必须和if同一行
if [ expression ]
then
    ...
else 
    ...
fi 
for-loop
for var in (list)
do
    ....
done
foreach var (list)
    ...
end
for var in [list]
do
    ...
done 
Loop in Bash: http://www.cyberciti.biz/faq/bash-for-loop/

Sh: http://www.freeos.com/guides/lsst/
Bash: http://tldp.org/LDP/abs/html/