Mac OS で IDLE for Python を使用しています。.py ファイルに次のように記述しました。
import math
def main():
print "This program finds the real solution to a quadratic"
print
a, b, c = input("Please enter the coefficients (a, b, c): ")
discRoot = math.sqrt(b * b-4 * a * c)
root1 = (-b + discRoot) / (2 * a)
root2 = (-b - discRoot) / (2 * a)
print
print "The solutions are: ", root1, root2
main()
IDLE が永続的に表示されるようになりました:
このプログラムは、二次方程式の真の解を見つけます。
係数 (a、b、c) を入力してください:
3 つの数字 (例: 1、2、3) を入力すると、IDLE は何もしません。Enter キーを押すと、IDLE がクラッシュします (クラッシュ レポートはありません)。
終了して再起動しましたが、IDLE は上記を永続的に表示し、他のファイルに応答しません。