Skip to content

Commit aaa3e09

Browse files
Update Basic_Maths.
1 parent daccb13 commit aaa3e09

File tree

7 files changed

+169
-103
lines changed

7 files changed

+169
-103
lines changed
Lines changed: 15 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -5,93 +5,10 @@
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,os,platform
9-
10-
PYTHON_LIB_NAME="Basic_Maths"
11-
PYTHON_LIB_LICENCE="GPL2"
12-
PYTHON_LIB_VER="4.1"
13-
PYTHON_LIB_SUPPORT_PLATFORM="Windows/Linux/macOS/otherOS"
14-
PYTHON_LIB_RELEASE_DATE="9/30/2023, Time: XX:XX"
15-
PYTHON_LIB_LAST_UPDATE_DATE="6/4/2024, Time: 23:42 / 11:42 PM"
16-
PYTHON_LIB_AUTHOR="LinuxUsersLinuxMint"
17-
PYTHON_LIB_AUTHOR_WEB_SITE="https://linuxuserslinuxmint.github.io"
18-
19-
def LibAbout():
20-
print("Python Library Name:", format(PYTHON_LIB_NAME))
21-
print("Python Library Version:", format(PYTHON_LIB_VER))
22-
print("Python Library Support OS:", format(PYTHON_LIB_SUPPORT_PLATFORM))
23-
print("Python Library Licence Name:", format(PYTHON_LIB_LICENCE))
24-
print("Python Library Author Name:", format(PYTHON_LIB_AUTHOR))
25-
print("Python Library Author Web Site:", format(PYTHON_LIB_AUTHOR_WEB_SITE))
26-
print("Python Library Release Date:", format(PYTHON_LIB_RELEASE_DATE))
27-
print("Python Library Last Update Date:", format(PYTHON_LIB_LAST_UPDATE_DATE))
28-
29-
error_dialog = str()
30-
31-
def error_msg():
32-
print(error_dialog)
33-
34-
def exit_program_dialog_time(exit_dialog_msg,userTime):
35-
print(exit_dialog_msg)
36-
userTime = int(userTime)
37-
time.sleep(userTime)
38-
if platform.system() == "Windows":
39-
os.system("exit")
40-
else:
41-
exit()
42-
43-
def exit_program_time(userTime):
44-
time.sleep(userTime)
45-
userTime = int(userTime)
46-
if platform.system() == "Windows":
47-
os.system("exit")
48-
else:
49-
exit()
50-
51-
def exit_program_dialog(exit_dialog_msg):
52-
print(exit_dialog_msg)
53-
if platform.system() == "Windows":
54-
os.system("exit")
55-
else:
56-
exit()
57-
58-
""" 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)): "
59-
Example Dialog (userTimeDialog): "After how many seconds should the program be closed?: "
60-
Example Dialog (exitDialog): "Exit program..."
61-
Example Dialog (errormsgDialog): "Invalid Command!" """
62-
63-
def all_exit(ExitSelectDialog,userTimeDialog,exitDialog,errormsgDialog):
64-
exit_select = int(input(ExitSelectDialog))
65-
exit_select = int(exit_select)
66-
if exit_select == 0:
67-
userTime = input(userTimeDialog)
68-
exit_program_dialog_time(exitDialog, userTime)
69-
elif exit_select == 1:
70-
userTime = input(userTimeDialog)
71-
exit_program_time(userTime)
72-
elif exit_select == 2:
73-
exit_program_dialog(exitDialog)
74-
elif exit_select == 3:
75-
exit()
76-
else:
77-
print(errormsgDialog)
78-
79-
def program_welcome_msg(welcome_msg,cfg):
80-
print(welcome_msg)
81-
if cfg == 1:
82-
LibAbout()
83-
elif cfg == 0:
84-
pass
85-
86-
def program_info(programnamedialog,program_name,programversiondialog,program_version,programsupportosdialog,program_support_os,programlicencedialog,program_licence,programauthordialog,program_author,programauthorwebsitedialog,program_author_web_site,programreleasedatedialog,program_rs_date,programlastupdatedatedialog,program_last_update_date):
87-
print("{0} {1}". format(programnamedialog,program_name))
88-
print("{0} {1}". format(programversiondialog,program_version))
89-
print("{0} {1}". format(programsupportosdialog,program_support_os))
90-
print("{0} {1}". format(programlicencedialog,program_licence))
91-
print("{0} {1}". format(programauthordialog,program_author))
92-
print("{0} {1}". format(programauthorwebsitedialog,program_author_web_site))
93-
print("{0} {1}". format(programreleasedatedialog,program_rs_date))
94-
print("{0} {1}". format(programlastupdatedatedialog,program_last_update_date))
8+
from math import *
9+
from PyAppDevKit.LibFunc.pyappdevkit import *
10+
from Basic_Maths.lib_ver_info import *
11+
from Basic_Maths.library_func import *
9512

9613
""" TR (Turkish / Türkçe):
9714
NOT: InputN1N2() sadece 2 sayının istendiği durumlarda kullanılabilir.
@@ -169,7 +86,6 @@ def SqaureRoot(x,ResultDialog):
16986
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. """
17087

17188
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):
172-
error_dialog = errdg
17389
print(optDialog)
17490
print(first_opt_dialog)
17591
print(second_opt_dialog)
@@ -180,26 +96,25 @@ def all_math_operations(optDialog,first_opt_dialog,second_opt_dialog,third_opt_d
18096
print(seventh_opt_dialog)
18197
print(eighth_opt_dialog)
18298
print(ninth_opt_dialog)
183-
select_opt = str(input(SelectOptDialog))
184-
select_process=select_opt
99+
select_func = str(input(SelectOptDialog))
185100
InputN1N2(nod,ntd)
186-
if select_opt == "1":
101+
if select_func == "1" or select_func == "Addition" or select_func == "Toplama":
187102
Addition(number_one,number_two,resdialog)
188-
elif select_opt == "2":
103+
elif select_func == "2" or select_func == "Extraction" or select_func == "Çıkarma":
189104
Extraction(number_one,number_two,resdialog)
190-
elif select_opt == "3":
105+
elif select_func == "3" or select_func == "Multiplication" or select_func == "Çarpma":
191106
Multiplication(number_one,number_two,resdialog)
192-
elif select_opt == "4":
107+
elif select_func == "4" or select_func == "Division" or select_func == "Bölme":
193108
Division(number_one,number_two,resdialog,divisionzerocheckdialog)
194-
elif select_opt == "5":
109+
elif select_func == "5" or select_func == "Percentage" or select_func == "Yüzdelik":
195110
Percentage(number_one,number_two,resdialog)
196-
elif select_opt == "6":
111+
elif select_func == "6" or select_func == "FullDivision" or select_func == "Tam bölüm":
197112
FullDivision(number_one,number_two,resdialog)
198-
elif select_opt == "7":
113+
elif select_func == "7" or select_func == "TakingExponents" or select_func == "Üslü sayı alma":
199114
TakingExponents(number_one,number_two,resdialog)
200-
elif select_opt == "8":
115+
elif select_func == "8" or select_func == "TakingRoots" or select_func == "Kök Alma":
201116
TakingRoots(number_one,number_two,resdialog)
202-
elif select_opt == "9":
117+
elif select_func == "9" or select_func == "SquareRoot" or select_func == "Kare kök":
203118
SqaureRoot(number_one,resdialog)
204119
else:
205-
error_msg()
120+
error_msg(errdg)

Basic_Maths/lib_ver_info.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/python3
2+
""" Copyright© 2023-2024 LinuxUsersLinuxMint
3+
Basic_Maths Tüm Hakları GPL(Genel Kamu Lisansı) altında korunmaktadır.
4+
Basic_Maths 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/Basic_Maths
6+
A Copy of This Software is published on GITHUB To view: https://github.com/LinuxUsersLinuxMint/Basic_Maths"""
7+
8+
PYTHON_LIB_NAME="Basic_Maths"
9+
PYTHON_LIB_LICENCE="GPL2"
10+
PYTHON_LIB_IMPLEMENTED_CONTRACTS="LinuxUsersLinuxMint Privacy and Security Agreement , LinuxUsersLinuxMint Web (Site) Agreement"
11+
PYTHON_LIB_IMPLEMENTED_CONTRACTS_WEB_SITE="https://linuxuserslinuxmint.github.io/Contracts/privacyandsecutryagreement/en/privacyandsecutryagreement.html , https://linuxuserslinuxmint.github.io/Contracts/linuxuserslinuxmintwebsiteagreement/en/linuxuserslinuxmintwebsiteagreement.html"
12+
PYTHON_LIB_VER="4.2"
13+
PYTHON_LIB_SUPPORT_PLATFORM="Windows/Linux/macOS/otherOS"
14+
PYTHON_LIB_RELEASE_DATE="9/30/2023, Time: XX:XX"
15+
PYTHON_LIB_LAST_UPDATE_DATE="6/9/2024, Time: 18:21 / 6:21 PM"
16+
PYTHON_LIB_AUTHOR="LinuxUsersLinuxMint"
17+
PYTHON_LIB_AUTHOR_WEB_SITE="https://linuxuserslinuxmint.github.io"

Basic_Maths/library_func.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/python3
2+
""" Copyright© 2023-2024 LinuxUsersLinuxMint
3+
Basic_Maths Tüm Hakları GPL(Genel Kamu Lisansı) altında korunmaktadır.
4+
Basic_Maths 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/Basic_Maths
6+
A Copy of This Software is published on GITHUB To view: https://github.com/LinuxUsersLinuxMint/Basic_Maths"""
7+
8+
from Basic_Maths.lib_ver_info import *
9+
10+
def LibAbout():
11+
print("Python Library Name:", format(PYTHON_LIB_NAME))
12+
print("Python Library Version:", format(PYTHON_LIB_VER))
13+
print("Python Library Support OS:", format(PYTHON_LIB_SUPPORT_PLATFORM))
14+
print("Python Library Licence Name:", format(PYTHON_LIB_LICENCE))
15+
print("Python Library Implemented Contracts:", format(PYTHON_LIB_IMPLEMENTED_CONTRACTS))
16+
print("Python Library Implemented Contracts Web Site:", format(PYTHON_LIB_IMPLEMENTED_CONTRACTS_WEB_SITE))
17+
print("Python Library Author Name:", format(PYTHON_LIB_AUTHOR))
18+
print("Python Library Author Web Site:", format(PYTHON_LIB_AUTHOR_WEB_SITE))
19+
print("Python Library Release Date:", format(PYTHON_LIB_RELEASE_DATE))
20+
print("Python Library Last Update Date:", format(PYTHON_LIB_LAST_UPDATE_DATE))
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
PYTHON_LIB_NAME="PyAppDevKit"
9+
PYTHON_LIB_LICENCE="GPL2"
10+
PYTHON_LIB_IMPLEMENTED_CONTRACTS="LinuxUsersLinuxMint Privacy and Security Agreement , LinuxUsersLinuxMint Web (Site) Agreement"
11+
PYTHON_LIB_IMPLEMENTED_CONTRACTS_WEB_SITE="https://linuxuserslinuxmint.github.io/Contracts/privacyandsecutryagreement/en/privacyandsecutryagreement.html , https://linuxuserslinuxmint.github.io/Contracts/linuxuserslinuxmintwebsiteagreement/en/linuxuserslinuxmintwebsiteagreement.html"
12+
PYTHON_LIB_VER="1.0"
13+
PYTHON_LIB_SUPPORT_PLATFORM="Windows/Linux/macOS/otherOS"
14+
PYTHON_LIB_RELEASE_DATE="6/9/2024, Time: 17:54"
15+
PYTHON_LIB_LAST_UPDATE_DATE="XX/XX/XXXX, Time: XX:XX / XX:XX XX"
16+
PYTHON_LIB_AUTHOR="LinuxUsersLinuxMint"
17+
PYTHON_LIB_AUTHOR_WEB_SITE="https://linuxuserslinuxmint.github.io"
18+
19+
def LibAbout():
20+
print("Python Library Name:", format(PYTHON_LIB_NAME))
21+
print("Python Library Version:", format(PYTHON_LIB_VER))
22+
print("Python Library Support OS:", format(PYTHON_LIB_SUPPORT_PLATFORM))
23+
print("Python Library Licence Name:", format(PYTHON_LIB_LICENCE))
24+
print("Python Library Implemented Contracts:", format(PYTHON_LIB_IMPLEMENTED_CONTRACTS))
25+
print("Python Library Implemented Contracts Web Site:", format(PYTHON_LIB_IMPLEMENTED_CONTRACTS_WEB_SITE))
26+
print("Python Library Author Name:", format(PYTHON_LIB_AUTHOR))
27+
print("Python Library Author Web Site:", format(PYTHON_LIB_AUTHOR_WEB_SITE))
28+
print("Python Library Release Date:", format(PYTHON_LIB_RELEASE_DATE))
29+
print("Python Library Last Update Date:", format(PYTHON_LIB_LAST_UPDATE_DATE))

PyAppDevKit/LibFunc/pyappdevkit.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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+
from PyAppDevKit.InfoLib.pyappdevkit_info import *
10+
11+
def error_msg(error_dialog):
12+
print(error_dialog)
13+
14+
def exit_program_dialog_time(exit_dialog_msg,userTime):
15+
print(exit_dialog_msg)
16+
userTime = int(userTime)
17+
time.sleep(userTime)
18+
if platform.system() == "Windows":
19+
os.system("exit")
20+
else:
21+
exit()
22+
23+
def exit_program_time(userTime):
24+
time.sleep(userTime)
25+
userTime = int(userTime)
26+
if platform.system() == "Windows":
27+
os.system("exit")
28+
else:
29+
exit()
30+
31+
def exit_program_dialog(exit_dialog_msg):
32+
print(exit_dialog_msg)
33+
if platform.system() == "Windows":
34+
os.system("exit")
35+
else:
36+
exit()
37+
38+
""" 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)): "
39+
Example Dialog (userTimeDialog): "After how many seconds should the program be closed?: "
40+
Example Dialog (exitDialog): "Exit program..."
41+
Example Dialog (errormsgDialog): "Invalid Command!" """
42+
43+
def all_exit(ExitSelectDialog,userTimeDialog,exitDialog,errormsgDialog):
44+
exit_select = int(input(ExitSelectDialog))
45+
exit_select = int(exit_select)
46+
if exit_select == 0:
47+
userTime = input(userTimeDialog)
48+
exit_program_dialog_time(exitDialog, userTime)
49+
elif exit_select == 1:
50+
userTime = input(userTimeDialog)
51+
exit_program_time(userTime)
52+
elif exit_select == 2:
53+
exit_program_dialog(exitDialog)
54+
elif exit_select == 3:
55+
exit()
56+
else:
57+
print(errormsgDialog)
58+
59+
def program_welcome_msg(welcome_msg,cfg):
60+
print(welcome_msg)
61+
if cfg == 1:
62+
LibAbout()
63+
elif cfg == 0:
64+
pass
65+
66+
def program_info(programnamedialog,program_name,programversiondialog,program_version,programsupportosdialog,program_support_os,programlicencedialog,program_licence,programauthordialog,program_author,programauthorwebsitedialog,program_author_web_site,programreleasedatedialog,program_rs_date,programlastupdatedatedialog,program_last_update_date):
67+
print("{0} {1}". format(programnamedialog,program_name))
68+
print("{0} {1}". format(programversiondialog,program_version))
69+
print("{0} {1}". format(programsupportosdialog,program_support_os))
70+
print("{0} {1}". format(programlicencedialog,program_licence))
71+
print("{0} {1}". format(programauthordialog,program_author))
72+
print("{0} {1}". format(programauthorwebsitedialog,program_author_web_site))
73+
print("{0} {1}". format(programreleasedatedialog,program_rs_date))
74+
print("{0} {1}". format(programlastupdatedatedialog,program_last_update_date))

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,22 @@ TR (Turkish / Türkçe):
66
* Kodlama/geliştirme süresini kısaltır işlerinizi daha hızlı halledebilirsiniz.
77
* Kodun daha rahat anlaşılmasını sağlar ve daha az satır kod yazmış olursunuz.
88
* Sürekli güncel kalır bu sayede sürekli yeni özellikler eklenir ve hata varsa bunlar çözülür.
9+
* En iyi kullanıcı deneyiminiz için "Basic_Maths" kütüphanesinin her zaman en son sürümünü kullanınız.
910
* Geliştiriciler için kolaylık sağlar "Python" ile yazılmış olan programlarda kendi programınız hakkında bilgi verebilmeniz için "program_info()" fonksiyonu bulunur ayrıca "LibAbout()" fonksiyonu ile de "Basic_Maths" kütüphanesi hakkında da bilgi verebilirsiniz.
1011

12+
NOT: "Basic_Maths" kütüphanesinin artık geliştirilmesi durdurulmuştur. "Basic_Maths 4.2" sürümü "Basic_Maths" kütüphanesinin son sürümüdür ancak yine de "PyAppDevKit" kütüphanesi güncellendikçe "Basic_Maths" kütüphaneside güncellenecek ve "Basic_Maths" kütüphanesi için küçük değişiklikler gelicektir.
13+
14+
NOT2: "Basic_Maths" kütüphanesinin "4.2" sürümüyle "Basic_Maths" kütüphanesindeki tüm sorunlar en iyi kullanıcı deneyimi için çözülmüştür.
15+
1116
EN (English / İngilizce):
1217

1318
* It simplifies math operations for Python and makes it easy to use.
1419
* It shortens the coding/development time and you can get your work done faster.
1520
* It makes the code easier to understand and you write fewer lines of code.
1621
* It remains constantly updated, so new features are constantly added and if there are errors, they are resolved.
17-
* Provides convenience for developers. Programs written in "Python" have the "program_info()" function so that you can provide information about your own program, and you can also provide information about the "Basic_Maths" library with the "LibAbout()" function.
22+
* For your best user experience, always use the latest version of the "Basic_Maths" library.
23+
* Provides convenience for developers. Programs written in "Python" have the "program_info()" function so that you can provide information about your own program, and you can also provide information about the "Basic_Maths" library with the "LibAbout()" function.
24+
25+
NOTE: Development of the "Basic_Maths" library has now been discontinued. "Basic_Maths 4.2" version is the latest version of the "Basic_Maths" library, but as the "PyAppDevKit" library is updated, the "Basic_Maths" library will also be updated and minor changes will come for the "Basic_Maths" library.
26+
27+
NOTE2: With the "4.2" version of the "Basic_Maths" library, all problems in the "Basic_Maths" library have been resolved for the best user experience.

basic_maths_calc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
It is a example program made with Basic_Maths. It was written to serve as an example of (Basic_Maths) usage.
55
Sharing of the file named "basic_maths_calc.py" in posts (blog/post etc. on the internet) has been given permission by @LinuxUsersLinuxMint. """
66

7-
from Basic_Maths.Basic_maths import *
7+
from Basic_Maths.Basic_Maths import *
88

99
LibAbout()
10-
all_math_operations("Select Operations: ","1. Addition","2. Extraction","3. Multiplication","4. Division","5. Percentage","6. FullDivision","7. TakingExponents","8. TakingRoots","9. SquareRoot","Select a transaction?: ","Enter the 1st number: ","Enter the 2nd number: ","Result:","Numbers cannot be zero in division!","Invalid Process!")
10+
all_math_operations("Select Operations: ","1. Addition","2. Extraction","3. Multiplication","4. Division","5. Percentage","6. FullDivision","7. TakingExponents","8. TakingRoots","9. SquareRoot","Select a transaction?: ","Enter the 1st number: ","Enter the 2nd number: ","Result:","Numbers cannot be zero in division!","Invalid Process!")
11+
error_msg("error msg")

0 commit comments

Comments
 (0)