原来你要找的符号是~。请看下面的例子:>>> from sympy import sympify >>> sympify('a&b') And(a, b) >>> sympify('a|b') Or(a, b) >>> sympify('~a') Not(a)