0
考慮在IPython的筆記本下面幾行:寫作乳膠在IPython的輸出
B=1.0e5 # in Gauss
fce = 1.80e6 * B
print "Electron gyrofrequency $f_{ce}$= %0.5e " %(fce)
我不能得到$ {F_ CE} $在其乳膠的形式打印。我也試過:
from IPython.display import display, Math, Latex
display ("Electron gyrofrequency" + Math(r'f_{ce}') + "= %0.5e " %(fce))
我得到了一個錯誤:
TypeError: cannot concatenate 'str' and 'Math' objects
你試過'乳膠( 「Electron gyrofrequency $ f_ {ce} $ =%0.5e」%fce)' – cel
這很奏效。請讓它成爲答案,我可以接受它 – wander95