# -*- coding: utf-8 -*-
import streamlit as st
st.header("License Increment輸出工具")
st.markdown("**從自己的license檔案取得與客戶license相同的Increments建立新的license。注意:數量無法改變!**")
large_license = st.file_uploader("上傳自己的ansyslmd.lic")
small_license = st.file_uploader("上傳客戶的ansyslmd.lic")
if large_license and small_license:
header = []
license_items = {}
text = large_license.getvalue().decode("utf-8").splitlines()
for line in text:
if line.startswith('INCREMENT'):
feature = line.split()[1]
license_items[feature] = [line]
else:
try:
license_items[feature].append(line)
except:
header.append(line)
text = small_license.getvalue().decode("utf-8").splitlines()
extracted_features = []
for line in text:
if line.startswith('INCREMENT'):
feature = line.split()[1]
extracted_features.append(feature)
text = '\n'.join(header) + '\n'
for feature in extracted_features:
text += '\n'.join(license_items[feature]) + '\n'
st.subheader('{} Increments 輸出:'.format(len(extracted_features)))
st.write(',\n'.join(extracted_features))
st.download_button('下載檔案', file_name='new_ansyslmd.lic', data=text)
AEDT(ANSYS Electronics DeskTop)包含了HFSS, Designer, Q3D, Maxwell, Icepak, Simplorer, Mechanical等模擬軟體。本網誌分享如何利用Python編程,配合AEDT API(Application Programming Interface, 應用程式介面)來開發AEDT外掛工具。並介紹各類自動化模擬設定及模擬資料分析技巧。 版主:林鳴志(Lin, Ming Chih)
2021年10月16日 星期六
License Increment簡化
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言