Python代码片段

get system platform  
[color="#800080"]>>> os.name
[color="#800080"]'posix'
[color="#800080"]>>> sys.platform
[color="#800080"]'linux2'
[color="#800080"]>>>   
get HOME path  
[color="#800080"]>>> os.environ['HOME']
[color="#800080"]'/home/rui'
[color="#800080"]>>> os.system('echo $HOME')
[color="#800080"]/home/rui
[color="#800080"]0
[color="#800080"]>>>   
get command line   
[color="#800080"]>>> sys.argv
[color="#800080"]['']
[color="#800080"]>>>   
--
海阔天空,做什么就记什么。主要是 Ubuntu Linux 和 Latex 及编程相关的东东:
http://hai-kuo.blogspot.com/