[Python, Snippets] 19/12/2008
Python basic snippets
Split, join etc

L=['a','b','c']
s=', '.join(L)
'a, b, c'


s='a, b, c'
s.split(',')
['a', 'b', 'c']

check memory:

os.system('ps -u username -o pid,rss,command | awk \'{print $0}{sum+=$2} END {print "Total", sum}\'')