shlex 是 CPython 內建的 module ,是一個簡單的 lexical analyzer ,可以用來分析類似 UNIX shell 的 token 。例如有一字串「 ab 'de fg' hi 」,要如何 split 成 ['ab', 'de fg', 'hi'] ,而非 ['ab', '\'de', 'fg\' ', 'hi'] ?
shlex 是 CPython 內建的 module ,是一個簡單的 lexical analyzer ,可以用來分析類似 UNIX shell 的 token 。例如有一字串「 ab 'de fg' hi 」,要如何 split 成 ['ab', 'de fg', 'hi'] ,而非 ['ab', '\'de', 'fg\' ', 'hi'] ?
shlex (上次是 localhost 在 2009-04-01 04:14:21 編輯的)