@@ -12,34 +12,31 @@ def Addition(x,y,ResultDialog,save_cfg,file_name,save_err_msg):
1212 print ("{0} {1} + {2} = {3}" . format (ResultDialog ,x ,y ,x + y ))
1313
1414 if save_cfg == ON :
15- create_file = open (file_name , "a" )
16- create_file .write ("{0} {1} + {2} = {3}\n " . format (ResultDialog ,x ,y ,x + y ))
15+ file (file_name = file_name ,file_mode = "a" ,file_write = "{0} {1} + {2} = {3}\n " . format (ResultDialog ,x ,y ,x + y ))
1716 elif save_cfg == OFF :
1817 pass
1918 else :
20- error_msg (save_err_msg )
19+ error_msg (save_err_msg , "" , "" )
2120
2221def Extraction (x ,y ,ResultDialog ,save_cfg ,file_name ,save_err_msg ):
2322 print ("{0} {1} - {2} = {3}" . format (ResultDialog ,x ,y ,x - y ))
2423
2524 if save_cfg == ON :
26- create_file = open (file_name , "a" )
27- create_file .write ("{0} {1} - {2} = {3}\n " . format (ResultDialog ,x ,y ,x - y ))
25+ file (file_name = file_name ,file_mode = "a" ,file_write = "{0} {1} - {2} = {3}\n " . format (ResultDialog ,x ,y ,x - y ))
2826 elif save_cfg == OFF :
2927 pass
3028 else :
31- error_msg (save_err_msg )
29+ error_msg (save_err_msg , "" , "" )
3230
3331def Multiplication (x ,y ,ResultDialog ,save_cfg ,file_name ,save_err_msg ):
3432 print ("{0} {1} * {2} = {3}" . format (ResultDialog ,x ,y ,x * y ))
3533
3634 if save_cfg == ON :
37- create_file = open (file_name , "a" )
38- create_file .write ("{0} {1} * {2} = {3}\n " . format (ResultDialog ,x ,y ,x * y ))
35+ file (file_name = file_name ,file_mode = "a" ,file_write = "{0} {1} * {2} = {3}\n " . format (ResultDialog ,x ,y ,x * y ))
3936 elif save_cfg == OFF :
4037 pass
4138 else :
42- error_msg (save_err_msg )
39+ error_msg (save_err_msg , "" , "" )
4340
4441def Division (x ,y ,ResultDialog ,check_zero_msg ,save_cfg ,file_name ,save_err_msg ):
4542 if x == 0 or y == 0 :
@@ -48,78 +45,71 @@ def Division(x,y,ResultDialog,check_zero_msg,save_cfg,file_name,save_err_msg):
4845 print ("{0} {1} / {2} = {3}" . format (ResultDialog ,x ,y ,x / y ))
4946
5047 if save_cfg == ON :
51- create_file = open (file_name , "a" )
52- create_file .write ("{0} {1} / {2} = {3}\n " . format (ResultDialog ,x ,y ,x / y ))
48+ file (file_name = file_name ,file_mode = "a" ,file_write = "{0} {1} / {2} = {3}\n " . format (ResultDialog ,x ,y ,x / y ))
5349 elif save_cfg == OFF :
5450 pass
5551 else :
56- error_msg (save_err_msg )
52+ error_msg (save_err_msg , "" , "" )
5753
5854def Percentage (x ,y ,ResultDialog ,save_cfg ,file_name ,save_err_msg ):
5955 print ("{0} ({1} * {2})/100 = {3}" . format (ResultDialog ,x ,y ,(x * y )/ 100 ))
6056
6157 if save_cfg == ON :
62- create_file = open (file_name , "a" )
63- create_file .write ("{0} ({1} * {2})/100 = {3}\n " . format (ResultDialog ,x ,y ,(x * y )/ 100 ))
58+ file (file_name = file_name ,file_mode = "a" ,file_write = "{0} ({1} * {2})/100 = {3}\n " . format (ResultDialog ,x ,y ,(x * y )/ 100 ))
6459 elif save_cfg == OFF :
6560 pass
6661 else :
67- error_msg (save_err_msg )
62+ error_msg (save_err_msg , "" , "" )
6863
6964def Mod (x ,y ,ResultDialog ,save_cfg ,file_name ,save_err_msg ):
7065 print ("{0} {1} % {2} = {3}" . format (ResultDialog ,x ,y ,x % y ))
7166
7267 if save_cfg == ON :
73- create_file = open (file_name , "a" )
74- create_file .write ("{0} {1} % {2} = {3}\n " . format (ResultDialog ,x ,y ,x % y ))
68+ file (file_name = file_name ,file_mode = "a" ,file_write = "{0} {1} % {2} = {3}\n " . format (ResultDialog ,x ,y ,x % y ))
7569 elif save_cfg == OFF :
7670 pass
7771 else :
78- error_msg (save_err_msg )
72+ error_msg (save_err_msg , "" , "" )
7973
8074def FullDivision (x ,y ,ResultDialog ,save_cfg ,file_name ,save_err_msg ):
8175 print ("{0} {1} // {2} = {3}" . format (ResultDialog ,x ,y ,x // y ))
8276
8377 if save_cfg == ON :
84- create_file = open (file_name , "a" )
85- create_file .write ("{0} {1} // {2} = {3}\n " . format (ResultDialog ,x ,y ,x // y ))
78+ file (file_name = file_name ,file_mode = "a" ,file_write = "{0} {1} // {2} = {3}\n " . format (ResultDialog ,x ,y ,x // y ))
8679 elif save_cfg == OFF :
8780 pass
8881 else :
89- error_msg (save_err_msg )
82+ error_msg (save_err_msg , "" , "" )
9083
9184def TakingExponents (x ,y ,ResultDialog ,save_cfg ,file_name ,save_err_msg ):
9285 print ("{0} {1} ** {2} = {3}" . format (ResultDialog ,x ,y ,x ** y ))
9386
9487 if save_cfg == ON :
95- create_file = open (file_name , "a" )
96- create_file .write ("{0} {1} ** {2} = {3}\n " . format (ResultDialog ,x ,y ,x ** y ))
88+ file (file_name = file_name ,file_mode = "a" ,file_write = "{0} {1} ** {2} = {3}\n " . format (ResultDialog ,x ,y ,x ** y ))
9789 elif save_cfg == OFF :
9890 pass
9991 else :
100- error_msg (save_err_msg )
92+ error_msg (save_err_msg , "" , "" )
10193
10294def TakingRoots (x ,y ,ResultDialog ,save_cfg ,file_name ,save_err_msg ):
10395 print ("{0} {1} / (1/{2}) = {3}" . format (ResultDialog ,x ,y ,x ** (1 / y )))
10496
10597 if save_cfg == ON :
106- create_file = open (file_name , "a" )
107- create_file .write ("{0} {1} - {2} = {3}\n " . format (ResultDialog ,x ,y ,x ** (1 / y )))
98+ file (file_name = file_name ,file_mode = "a" ,file_write = "{0} {1} - {2} = {3}\n " . format (ResultDialog ,x ,y ,x ** (1 / y )))
10899 elif save_cfg == OFF :
109100 pass
110101 else :
111- error_msg (save_err_msg )
102+ error_msg (save_err_msg , "" , "" )
112103
113104def SqaureRoot (x ,ResultDialog ,save_cfg ,file_name ,save_err_msg ):
114105 print ("{0} {1} ** (1/2) = {2}" . format (ResultDialog ,x ,x ** (1 / 2 )))
115106
116107 if save_cfg == ON :
117- create_file = open (file_name , "a" )
118- create_file .write ("{0} {1} ** (1/2) {2} = {3}\n " . format (ResultDialog ,x ,x ** (1 / 2 )))
108+ file (file_name = file_name ,file_mode = "a" ,file_write = "{0} {1} ** (1/2) {2} = {3}\n " . format (ResultDialog ,x ,x ** (1 / 2 )))
119109 elif save_cfg == OFF :
120110 pass
121111 else :
122- error_msg (save_err_msg )
112+ error_msg (save_err_msg , "" , "" )
123113
124114""" TR (Turkish / Türkçe):
125115NOT: "Basic_Maths" kütüphanesini kullanan geliştiriciler programlarındaki ihtiyaçlara göre "Basic_Maths" fonksiyonlarını değiştirebilirler.
@@ -165,4 +155,4 @@ def all_math_operations(optDialog,first_opt_dialog,second_opt_dialog,third_opt_d
165155 elif select_func == mod_options_one or select_func == mod_options_two or select_func == mod_options_three or select_func == mod_options_four or select_func == mod_options_five :
166156 Mod (number_one ,number_two ,resdialog ,save_cfg = OFF ,file_name = "" ,save_err_msg = "" )
167157 else :
168- error_msg (errdg )
158+ error_msg (errdg , "" , "" )
0 commit comments