Skip to content

Commit 31eeaa4

Browse files
Important Update.
1 parent 7ba7d6c commit 31eeaa4

File tree

6 files changed

+286
-102
lines changed

6 files changed

+286
-102
lines changed

EN/Basic_Maths.py

+67-50
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,19 @@
55
Bu Yazılımın Bir Kopyası GİTHUB da yayınlanmaktadır Görüntülemek için: https://github.com/LinuxUsersLinuxMint/Basic_Maths
66
A Copy of This Software is published on GITHUB To view: https://github.com/LinuxUsersLinuxMint/Basic_Maths"""
77

8-
import time
8+
from math import *
9+
from pyappdevkit import *
910

10-
global result,input_dialog,error_dialog
11+
""" TR (Turkish / Türkçe):
12+
NOT: InputN1N2() sadece 2 sayının istendiği durumlarda kullanılabilir.
1113
12-
input_dialog = str()
13-
error_dialog = str()
14+
EN (English / İngilizce):
15+
NOTE: InputN1N2() can be used when only 2 numbers are required. """
1416

15-
def p(userString):
16-
print(userString)
17-
18-
def error_msg():
19-
p(error_dialog)
20-
21-
def exit_program_dialog_time(exit_dialog_msg,userTime):
22-
p(exit_dialog_msg)
23-
time.sleep(userTime)
24-
exit()
25-
26-
def exit_program_time(userTime):
27-
time.sleep(userTime)
28-
exit()
29-
30-
def exit_program_dialog(exit_dialog_msg):
31-
p(exit_dialog_msg)
32-
exit()
33-
34-
def program_welcome_msg(welcome_msg):
35-
p(welcome_msg)
36-
37-
def program_info(programnamedialog,program_name,programversiondialog,program_version,programsupportosdialog,program_support_os,programlicencedialog,program_licence,programauthordialog,program_author,programreleasedatedialog,program_rs_date):
38-
p("{0} {1}". format(programnamedialog,program_name))
39-
p("{0} {1}\n". format(programversiondialog,program_version))
40-
p("{0} {1}\n". format(programsupportosdialog,program_support_os))
41-
p("{0} {1}\n". format(programlicencedialog,program_licence))
42-
p("{0} {1}\n". format(programauthordialog,program_author))
43-
p("{0} {1}\n". format(programreleasedatedialog,program_rs_date))
44-
45-
46-
def InputN1N2():
17+
def InputN1N2(number_one_dialog,number_two_dialog):
4718
global number_one, number_two
48-
number_one = str(input("{0}". format(input_dialog)))
49-
number_two = str(input("{0}". format(input_dialog)))
19+
number_one = float(input("{0}". format(number_one_dialog)))
20+
number_two = float(input("{0}". format(number_two_dialog)))
5021

5122
select_func = str()
5223
"""
@@ -55,47 +26,93 @@ def InputN1N2():
5526
input_select = str(input('Which process?'))
5627
select_func = input_select
5728
58-
def addition(x,y,ResultDialog):
29+
def Addition(x,y,ResultDialog):
5930
result=x+y
6031
print("{0} {1} {2} + {3} = {4}". format(select_func,ResultDialog,x,y,result))
6132
6233
"""
6334

64-
def addition(x,y,ResultDialog):
35+
def Addition(x,y,ResultDialog):
6536
result=x+y
66-
p("{0} {1} {2} + {3} = {4}". format(select_func,ResultDialog,x,y,result))
37+
print("{0} {1} {2} + {3} = {4}". format(select_func,ResultDialog,x,y,result))
6738

6839
def Extraction(x,y,ResultDialog):
6940
result=x-y
70-
p("{0} {1} {2} - {3} = {4}". format(select_func,ResultDialog,x,y,result))
41+
print("{0} {1} {2} - {3} = {4}". format(select_func,ResultDialog,x,y,result))
7142

7243
def Multiplication(x,y,ResultDialog):
7344
result=x*y
74-
p("{0} {1} {2} * {3} = {4}". format(select_func,ResultDialog,x,y,result))
45+
print("{0} {1} {2} * {3} = {4}". format(select_func,ResultDialog,x,y,result))
7546

7647
def Division(x,y,ResultDialog,check_zero_control_msg):
7748
if x==0 or y==0:
78-
p(check_zero_control_msg)
49+
print(check_zero_control_msg)
7950
if y>0 and x>0:
8051
result=x/y
81-
p("{0} {1} {2} / {3} = {4}". format(select_func,ResultDialog,x,y,result))
52+
print("{0} {1} {2} / {3} = {4}". format(select_func,ResultDialog,x,y,result))
8253

8354
def Percentage(x,y,ResultDialog):
8455
result=x%y
85-
p("{0} {1} {2} % {3} = {4}". format(select_func,ResultDialog,x,y,result))
56+
print("{0} {1} {2} % {3} = {4}". format(select_func,ResultDialog,x,y,result))
8657

8758
def FullDivision(x,y,ResultDialog):
8859
result=x//y
89-
p("{0} {1} {2} // {3} = {4}". format(select_func,ResultDialog,x,y,result))
60+
print("{0} {1} {2} // {3} = {4}". format(select_func,ResultDialog,x,y,result))
9061

9162
def TakingExponents(x,y,ResultDialog):
9263
result=x ** y
93-
p("{0} {1} {2} ** {3} = {4}". format(select_func,ResultDialog,x,y,result))
64+
print("{0} {1} {2} ** {3} = {4}". format(select_func,ResultDialog,x,y,result))
9465

9566
def TakingRoots(x,y,ResultDialog):
9667
result=x ** (1/y)
97-
p("{0} {1} {2} / (1/y) = {3}". format(select_func,ResultDialog,x,result))
68+
print("{0} {1} {2} / (1/{3}) = {4}". format(select_func,ResultDialog,x,y,result))
9869

9970
def SqaureRoot(x,ResultDialog):
10071
result=x ** (1/2)
101-
p("{0} {1} {2} ** (1/2) = {3}". format(select_func,ResultDialog,x,result))
72+
print("{0} {1} {2} ** (1/2) = {3}". format(select_func,ResultDialog,x,result))
73+
74+
""" TR (Turkish / Türkçe):
75+
NOT: "Basic_Maths" kütüphanesini kullanan geliştiriciler programlarındaki ihtiyaçlara göre "Basic_Maths" fonksiyonlarını değiştirebilirler.
76+
NOT2: "select_process" değişkeni ile geliştiriciler isteğe bağlı olarak programlarında kullanıcılar tarafından seçilen işlemi gösterebilir.
77+
NOT3: "nod" ve "ntd" değişkenleri ile beraber geliştiriciler "all_math_operations()" fonksiyonunda "InputN1N2()" fonksiyonunu kullanabilir ve bu değişkenler aracılığıyla 1. sayı ve 2. sayı diyaloglarını ekleyebilirler.
78+
ÖNERİ: Eğer istekleriniz veya ihtiyaçlarınız farklıysa "all_math_operations()" fonksiyonunu kullanmadan önce ihtiyaçlarınız doğrultusunda değiştirmeniz önerilir.
79+
80+
EN (English / İngilizce):
81+
NOTE: Developers using the "Basic_Maths" library can change the "Basic_Maths" functions according to the needs of their programs.
82+
NOTE2: With the "select_process" variable, developers can optionally display the process selected by users in their programs.
83+
NOTE3: Along with the "nod" and "ntd" variables, developers can use the "InputN1N2()" function in the "all_math_operations()" function and add the 1st issue and 2nd issue dialogs through these variables.
84+
SUGGESTION: If your wishes or needs are different, it is recommended that you change it according to your needs before using the "all_math_operations()" function. """
85+
86+
def all_math_operations(optDialog,first_opt_dialog,second_opt_dialog,third_opt_dialog,fourth_opt_dialog,fifth_opt_dialog,sixth_opt_dialog,seventh_opt_dialog,eighth_opt_dialog,ninth_opt_dialog,SelectOptDialog,nod,ntd,resdialog,divisionzerocheckdialog,errdg,addition_options_one,addition_options_two,addition_options_three,addition_options_four,addition_options_five,extraction_options_one,extraction_options_two,extraction_options_three,extraction_options_four,extraction_options_five,multiplication_options_one,multiplication_options_two,multiplication_options_three,multiplication_options_four,multiplication_options_five,division_options_one,division_options_two,division_options_three,division_options_four,division_options_five,percentage_options_one,percentage_options_two,percentage_options_three,percentage_options_four,percentage_options_five,fulldivision_options_one,fulldivision_options_two,fulldivision_options_three,fulldivision_options_four,fulldivision_options_five,takingexponents_options_one,takingexponents_options_two,takingexponents_options_three,takingexponents_options_four,takingexponents_options_five,takingroots_options_one,takingroots_options_two,takingroots_options_three,takingroots_options_four,takingroots_options_five,squareroot_options_one,squareroot_options_two,squareroot_options_three,squareroot_options_four,squareroot_options_five):
87+
print(optDialog)
88+
print(first_opt_dialog)
89+
print(second_opt_dialog)
90+
print(third_opt_dialog)
91+
print(fourth_opt_dialog)
92+
print(fifth_opt_dialog)
93+
print(sixth_opt_dialog)
94+
print(seventh_opt_dialog)
95+
print(eighth_opt_dialog)
96+
print(ninth_opt_dialog)
97+
select_func = str(input(SelectOptDialog))
98+
InputN1N2(nod,ntd)
99+
if select_func == addition_options_one or select_func == addition_options_two or select_func == addition_options_three or select_func == addition_options_four or select_func == addition_options_five:
100+
Addition(number_one,number_two,resdialog)
101+
elif select_func == extraction_options_one or select_func == extraction_options_two or select_func == extraction_options_three or select_func == extraction_options_four or select_func == extraction_options_five:
102+
Extraction(number_one,number_two,resdialog)
103+
elif select_func == multiplication_options_one or select_func == multiplication_options_two or select_func == multiplication_options_three or select_func == multiplication_options_four or select_func == multiplication_options_five:
104+
Multiplication(number_one,number_two,resdialog)
105+
elif select_func == division_options_one or select_func == division_options_two or select_func == division_options_three or select_func == division_options_four or select_func == division_options_five:
106+
Division(number_one,number_two,resdialog,divisionzerocheckdialog)
107+
elif select_func == percentage_options_one or select_func == percentage_options_two or select_func == percentage_options_three or select_func == percentage_options_four or select_func == percentage_options_five:
108+
Percentage(number_one,number_two,resdialog)
109+
elif select_func == fulldivision_options_one or select_func == fulldivision_options_two or select_func == fulldivision_options_three or select_func == fulldivision_options_four or select_func == fulldivision_options_five:
110+
FullDivision(number_one,number_two,resdialog)
111+
elif select_func == takingexponents_options_one or select_func == takingexponents_options_two or select_func == takingexponents_options_three or select_func == takingexponents_options_four or select_func == takingexponents_options_five:
112+
TakingExponents(number_one,number_two,resdialog)
113+
elif select_func == takingroots_options_one or select_func == takingroots_options_two or select_func == takingroots_options_three or select_func == takingroots_options_four or select_func == takingroots_options_five:
114+
TakingRoots(number_one,number_two,resdialog)
115+
elif select_func == squareroot_options_one or select_func == squareroot_options_two or select_func == squareroot_options_three or select_func == squareroot_options_four or select_func == squareroot_options_five:
116+
SqaureRoot(number_one,resdialog)
117+
else:
118+
error_msg(errdg)

EN/calc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
elif command=="web-site":
8787
print("https://linuxuserslinuxmint.github.io")
8888
elif command=="ver":
89-
print("Version: 0.3.1 (Last Updated on May 31, 2024, 23:30)")
89+
print("Version: 0.3.3 (Last Updated on Oct 25, 2024, 23:39)")
9090
elif command=="licence":
9191
print("This Software is protected under the GPL2 license")
9292
elif command=="Thank":

EN/pyappdevkit.py

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/usr/bin/python3
2+
""" Copyright© 2023-2024 LinuxUsersLinuxMint
3+
PyAppDevKit Tüm Hakları GPL(Genel Kamu Lisansı) altında korunmaktadır.
4+
PyAppDevKit All Rights Reserved under the GPL(General Public License).
5+
Bu Yazılımın Bir Kopyası GİTHUB da yayınlanmaktadır Görüntülemek için: https://github.com/LinuxUsersLinuxMint/PyAppDevKit
6+
A Copy of This Software is published on GITHUB To view: https://github.com/LinuxUsersLinuxMint/PyAppDevKit"""
7+
8+
import os, time, platform
9+
10+
def error_msg(error_dialog):
11+
print(error_dialog)
12+
13+
def exit_program_dialog_time(exit_dialog_msg,userTime):
14+
print(exit_dialog_msg)
15+
userTime = int(userTime)
16+
time.sleep(userTime)
17+
if platform.system() == "Windows":
18+
os.system("exit")
19+
else:
20+
exit()
21+
22+
def exit_program_time(userTime):
23+
userTime = int(userTime)
24+
time.sleep(userTime)
25+
if platform.system() == "Windows":
26+
os.system("exit")
27+
else:
28+
exit()
29+
30+
def exit_program_dialog(exit_dialog_msg):
31+
print(exit_dialog_msg)
32+
if platform.system() == "Windows":
33+
os.system("exit")
34+
else:
35+
exit()
36+
37+
""" Example Dialog (ExitSelectDialog): "Select the method to exit the program (0: Dialogue and Time entry, 1: Time entry only, 2: Dialogue entry only, 3: Normal exit (old style)): "
38+
Example Dialog (userTimeDialog): "After how many seconds should the program be closed?: "
39+
Example Dialog (exitDialog): "Exit program..."
40+
Example Dialog (errormsgDialog): "Invalid Command!" """
41+
42+
def all_exit(ExitSelectDialog,userTimeDialog,exitDialog,errormsgDialog):
43+
exit_select = int(input(ExitSelectDialog))
44+
exit_select = int(exit_select)
45+
if exit_select == 0:
46+
userTime = input(userTimeDialog)
47+
exit_program_dialog_time(exitDialog, userTime)
48+
elif exit_select == 1:
49+
userTime = input(userTimeDialog)
50+
exit_program_time(userTime)
51+
elif exit_select == 2:
52+
exit_program_dialog(exitDialog)
53+
elif exit_select == 3:
54+
exit()
55+
else:
56+
print(errormsgDialog)
57+
58+
def program_welcome_msg(welcome_msg,cfg):
59+
print(welcome_msg)
60+
if cfg == 1:
61+
LibAbout()
62+
elif cfg == 0:
63+
pass
64+
65+
def program_info(programnamedialog,program_name,programversiondialog,program_version,programsupportosdialog,program_support_os,programlicencedialog,program_licence,programimplementedcontractsdialog,program_imp_contracts,programimplementedcontractswebsitedialog,program_imp_contracts_web_site,programauthordialog,program_author,programauthorwebsitedialog,program_author_web_site,programreleasedatedialog,program_rs_date,programlastupdatedatedialog,program_last_update_date):
66+
print("{0} {1}". format(programnamedialog,program_name))
67+
print("{0} {1}". format(programversiondialog,program_version))
68+
print("{0} {1}". format(programsupportosdialog,program_support_os))
69+
print("{0} {1}". format(programlicencedialog,program_licence))
70+
print("{0} {1}". format(programimplementedcontractsdialog,program_imp_contracts))
71+
print("{0} {1}". format(programimplementedcontractswebsitedialog,program_imp_contracts_web_site))
72+
print("{0} {1}". format(programauthordialog,program_author))
73+
print("{0} {1}". format(programauthorwebsitedialog,program_author_web_site))
74+
print("{0} {1}". format(programreleasedatedialog,program_rs_date))
75+
print("{0} {1}". format(programlastupdatedatedialog,program_last_update_date))

0 commit comments

Comments
 (0)