使用charcoal edior编辑器
import pymel.core as pm
\\or from pymel.core import *
import pymel.tools.mel2py as mel2py
\\
a = 'polySphere -r 1 -sx 20 -ax 0 1 0 -cuv 2 -ch 1;'
pyCmd = mel2py.mel2pyStr(melCmd,pymelNamespace='pm')
print(pyCmd)
\\生成球
import pymel.all as pm
pm.polyShere(cuv=2,sy=20,ch=1,sx=