File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed
Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 1515import sys
1616if sys .version_info [0 ] < 3 :
1717 import Tkinter as Tk
18+ import tkFont as font
1819else :
1920 import tkinter as Tk
21+ from tkinter import font
2022
21- import tkFont
2223
2324def str_to_f (str ):
2425 a = parse_expr (str , evaluate = 0 )
@@ -31,7 +32,7 @@ def __init__(self, parent):
3132
3233 self .parent = parent
3334
34- myfont = tkFont .Font () #size=14)
35+ myfont = font .Font () #size=14)
3536
3637 # data file
3738
Original file line number Diff line number Diff line change 1515import sys
1616if sys .version_info [0 ] < 3 :
1717 import Tkinter as Tk
18+ import ttk
19+ import tkFont as font
1820else :
1921 import tkinter as Tk
22+ from tkinter import ttk
23+ from tkinter import font
2024
21- import ttk
22-
23- import tkFont
2425
2526def str_to_f (str ):
2627 a = parse_expr (str , evaluate = 0 )
@@ -36,7 +37,7 @@ def __init__(self, parent):
3637 self .style = ttk .Style ()
3738 self .style .theme_use ("default" )
3839
39- #myfont = tkFont .Font(size=14)
40+ #myfont = font .Font(size=14)
4041
4142 # data file
4243
Original file line number Diff line number Diff line change 33from sympy .abc import x
44from sympy .parsing .sympy_parser import parse_expr
55
6- str = raw_input ("f(x) = " )
6+ fstr = input ("f(x) = " )
77
8- a = parse_expr (str , evaluate = 0 )
8+ a = parse_expr (fstr , evaluate = 0 )
99
1010f = sympy .lambdify (x , a , "numpy" )
1111
1212x = np .linspace (0 ,1 ,100 )
1313
14- print f (x )
14+ print ( f (x ) )
You can’t perform that action at this time.
0 commit comments