- #/usr/bin/env python3
- #coding: utf-8
- import os
- def get_tools():
- apppath="/Applications"
- tools = ['termal']
- for i in os.listdir(apppath):
- if i.startswith("iTerm.app"):
- tools.append("iterm2")
- break
- return tools
- print(get_tools())
- #该片段来自于http://www.codesnippet.cn/detail/0809201513640.html
来源: http://www.codesnippet.cn/detail/0809201513640.html