Skip to content

Commit b90ebc5

Browse files
Update Basic_Maths.
1 parent f119e6c commit b90ebc5

File tree

5 files changed

+54
-32
lines changed

5 files changed

+54
-32
lines changed

Basic_Maths/Basic_Maths.py

+33-10
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@
88
from Basic_Maths.library_func import *
99
import time
1010

11-
global result,input_dialog,error_dialog
11+
global result,error_dialog
1212

13-
input_dialog = str()
1413
error_dialog = str()
1514

16-
def p(userString):
17-
print(userString)
18-
1915
def error_msg():
2016
p(error_dialog)
2117

@@ -34,22 +30,49 @@ def exit_program_dialog(exit_dialog_msg):
3430
p(exit_dialog_msg)
3531
exit()
3632

33+
""" 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)): "
34+
# Example Dialog (userTimeDialog): "After how many seconds should the program be closed?: "
35+
# Example Dialog (exitDialog): "Exit program..."
36+
# Example Dialog (errormsgDialog): "Invalid Command!" """
37+
38+
def all_exit(ExitSelectDialog,userTimeDialog,exitDialog,errormsgDialog):
39+
exit_select = int(input(ExitSelectDialog))
40+
exit_select = int(exit_select)
41+
if exit_select == 0:
42+
userTime = input(userTimeDialog)
43+
exit_program_dialog_time(exitDialog, userTime)
44+
elif exit_select == 1:
45+
userTime = input(userTime)
46+
exit_program_time(userTime)
47+
elif exit_select == 2:
48+
exit_program_dialog(exitDialog)
49+
elif exit_select == 3:
50+
exit()
51+
else:
52+
p(errormsgDialog)
53+
3754
def program_welcome_msg(welcome_msg):
3855
p(welcome_msg)
3956

40-
def program_info(programnamedialog,program_name,programversiondialog,program_version,programsupportosdialog,program_support_os,programlicencedialog,program_licence,programauthordialog,program_author,programreleasedatedialog,program_rs_date):
57+
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):
4158
p("{0} {1}". format(programnamedialog,program_name))
4259
p("{0} {1}". format(programversiondialog,program_version))
4360
p("{0} {1}". format(programsupportosdialog,program_support_os))
4461
p("{0} {1}". format(programlicencedialog,program_licence))
4562
p("{0} {1}". format(programauthordialog,program_author))
63+
p("{0} {1}". format(programauthorwebsitedialog,program_author_web_site))
4664
p("{0} {1}". format(programreleasedatedialog,program_rs_date))
47-
65+
p("{0} {1}". format(programlastupdatedatedialog,program_last_update_date))
66+
67+
# TR (Turkish / Türkçe):
68+
# NOT: InputN1N2() sadece 2 sayının istendiği durumlarda kullanılabilir.
69+
# EN (English / İngilizce):
70+
# NOTE: InputN1N2() can be used when only 2 numbers are required.
4871

49-
def InputN1N2():
72+
def InputN1N2(number_one_dialog,number_two_dialog):
5073
global number_one, number_two
51-
number_one = str(input("{0}". format(input_dialog)))
52-
number_two = str(input("{0}". format(input_dialog)))
74+
number_one = str(input("{0}". format(number_one_dialog)))
75+
number_two = str(input("{0}". format(number_two_dialog)))
5376

5477
select_func = str()
5578
"""

Basic_Maths/lib_ver_info.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
PYTHON_LIB_NAME="Basic_Maths"
99
PYTHON_LIB_LICENCE="GPL2"
10-
PYTHON_LIB_VER="3.3"
10+
PYTHON_LIB_VER="3.5"
1111
PYTHON_LIB_SUPPORT_PLATFORM="Windows/Linux/macOS/otherOS"
12-
PYTHON_LIB_RELEASE_DATE="6/1/2024, Time: 16:46"
13-
PYTHON_LIB_AUTHOR="LinuxUsersLinuxMint"
12+
PYTHON_LIB_RELEASE_DATE="9/30/2023, Time: XX:XX"
13+
PYTHON_LIB_LAST_UPDATE_DATE="6/2/2024, Time: 16:46"
14+
PYTHON_LIB_AUTHOR="LinuxUsersLinuxMint"
15+
PYTHON_LIB_AUTHOR_WEB_SITE="https://linuxuserslinuxmint.github.io"

Basic_Maths/library_func.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ def LibAbout():
1616
p("Python Library Support OS: {0}", format(PYTHON_LIB_SUPPORT_PLATFORM))
1717
p("Python Library Licence Name: {0}", format(PYTHON_LIB_LICENCE))
1818
p("Python Library Author Name: {0}", format(PYTHON_LIB_AUTHOR))
19-
p("Python Library Release Date: {0}", format(PYTHON_LIB_RELEASE_DATE))
19+
p("Python Library Author Web Site: {0}", format(PYTHON_LIB_AUTHOR_WEB_SITE))
20+
p("Python Library Release Date: {0}", format(PYTHON_LIB_RELEASE_DATE))
21+
p("Python Library Last Update Date: {0}", format(PYTHON_LIB_LAST_UPDATE_DATE))

Example/basic_maths_calc.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66

77
from ..Basic_Maths.Basic_Maths import *
88

9-
input_dialog = str("Enter the number: ")
109
error_dialog = str("Invalid process...")
1110
resultdialog = str("Result:")
1211

13-
InputN1N2()
12+
InputN1N2("Enter the 1st number: ", "Enter the 2nd number: ")
1413

1514
select=print('Select (Add, Ext, Mul, Div, Per, FullDiv, TakeEx): ')
1615

README.md

+12-16
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
# Basic_Maths
22

3+
TR (Turkish / Türkçe):
34

4-
* Oldukça Basit Python için bir Matematik Kütüphanesi
5-
* Python da Matematik Temel 4 işlemi herhangi bir ek değişken gerektirmeden kullanabilmemizi sağlar
6-
Örnek:
7-
#!/usr/bin/python3
8-
from Basic_Maths import *
9-
addition(5,5)
10-
Çıktı: result: 5 + 5 = 10
5+
* Python için matematik işlemlerini basitleştirir ve kullanımı kolay bir hale getirir.
6+
* Kodlama/geliştirme süresini kısaltır işlerinizi daha hızlı halledebilirsiniz.
7+
* Kodun daha rahat anlaşılmasını sağlar ve daha az satır kod yazmış olursunuz.
8+
* Sürekli güncel kalır bu sayede sürekli yeni özellikler eklenir ve hata varsa bunlar çözülür.
9+
* 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.
1110

12-
* A very simple math library for Python
13-
* Math Basic 4 in Python allows us to use operations without requiring any additional variables.
14-
Example:
15-
#!/usr/bin/python3
16-
from Basic_Maths import *
17-
addition(5,5)
18-
Output: result: 5 + 5 = 10
11+
EN (English / İngilizce):
1912

20-
* By: LinuxUsersLinuxMint
21-
* Credits: gaurovgiri @gaurovgiri
13+
* It simplifies math operations for Python and makes it easy to use.
14+
* It shortens the coding/development time and you can get your work done faster.
15+
* It makes the code easier to understand and you write fewer lines of code.
16+
* 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.

0 commit comments

Comments
 (0)