擅长:python、mysql、java
<p>一句话:</p>
<pre><code>>>> [s.rsplit("|", i)[0] for i in range(s.count("|"), -1, -1)]
['MayaWindow',
'MayaWindow|toolBar2',
'MayaWindow|toolBar2|MainShelfLayout',
'MayaWindow|toolBar2|MainShelfLayout|formLayout14',
'MayaWindow|toolBar2|MainShelfLayout|formLayout14|ShelfLayout',
'MayaWindow|toolBar2|MainShelfLayout|formLayout14|ShelfLayout|Custom']
</code></pre>