3D Layout錄製的腳本函數的參數中間有多個空白導致閱讀困難,先Ctrl+C選擇腳本所有程式碼,在AEDT底下執行下面腳本removeDummySpaces.py,在Ctrl+V貼回程式碼即可。
removeDummySpaces.py
import re
import clr
clr.AddReference('System.Windows.Forms')
from System.Windows.Forms import Clipboard
x = Clipboard.GetText()
result = ''
for i in x.splitlines():
i = i.replace('\t', ' ')
i = re.sub(',\s+', ', ', i)
i = re.sub('\s+,', ',', i)
i = re.sub('\[\s+', '[', i)
result += (i + '\n')
Clipboard.SetText(result)
(圖一) 參數之間多餘空白被移除 |
沒有留言:
張貼留言