Skip to content

Commit 5ba8f89

Browse files
Update Basic_Maths.
1 parent fa45e37 commit 5ba8f89

File tree

1 file changed

+53
-33
lines changed

1 file changed

+53
-33
lines changed

Basic_Maths/Basic_maths.py

Lines changed: 53 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
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+
import time,os,platform
99

1010
PYTHON_LIB_NAME="Basic_Maths"
1111
PYTHON_LIB_LICENCE="GPL2"
12-
PYTHON_LIB_VER="3.7re-edit"
12+
PYTHON_LIB_VER="4.0"
1313
PYTHON_LIB_SUPPORT_PLATFORM="Windows/Linux/macOS/otherOS"
1414
PYTHON_LIB_RELEASE_DATE="9/30/2023, Time: XX:XX"
15-
PYTHON_LIB_LAST_UPDATE_DATE="6/2/2024, Time: 21:55"
15+
PYTHON_LIB_LAST_UPDATE_DATE="6/3/2024, Time: 12:50"
1616
PYTHON_LIB_AUTHOR="LinuxUsersLinuxMint"
1717
PYTHON_LIB_AUTHOR_WEB_SITE="https://linuxuserslinuxmint.github.io"
1818

@@ -32,24 +32,39 @@ def error_msg():
3232
print(error_dialog)
3333

3434
def exit_program_dialog_time(exit_dialog_msg,userTime):
35-
print(exit_dialog_msg)
36-
userTime = int(userTime)
37-
time.sleep(userTime)
38-
exit()
35+
if platform.system() == "Windows":
36+
print(exit_dialog_msg)
37+
userTime = int(userTime)
38+
time.sleep(userTime)
39+
os.system("exit")
40+
else:
41+
print(exit_dialog_msg)
42+
userTime = int(userTime)
43+
time.sleep(userTime)
44+
exit()
3945

4046
def exit_program_time(userTime):
41-
time.sleep(userTime)
42-
userTime = int(userTime)
43-
exit()
47+
if platform.system() == "Windows":
48+
time.sleep(userTime)
49+
userTime = int(userTime)
50+
os.system("exit")
51+
else:
52+
time.sleep(userTime)
53+
userTime = int(userTime)
54+
exit()
4455

4556
def exit_program_dialog(exit_dialog_msg):
46-
print(exit_dialog_msg)
47-
exit()
57+
if platform.system() == "Windows":
58+
print(exit_dialog_msg)
59+
os.system("exit")
60+
else:
61+
print(exit_dialog_msg)
62+
exit()
4863

4964
""" 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)): "
50-
# Example Dialog (userTimeDialog): "After how many seconds should the program be closed?: "
51-
# Example Dialog (exitDialog): "Exit program..."
52-
# Example Dialog (errormsgDialog): "Invalid Command!" """
65+
Example Dialog (userTimeDialog): "After how many seconds should the program be closed?: "
66+
Example Dialog (exitDialog): "Exit program..."
67+
Example Dialog (errormsgDialog): "Invalid Command!" """
5368

5469
def all_exit(ExitSelectDialog,userTimeDialog,exitDialog,errormsgDialog):
5570
exit_select = int(input(ExitSelectDialog))
@@ -67,8 +82,12 @@ def all_exit(ExitSelectDialog,userTimeDialog,exitDialog,errormsgDialog):
6782
else:
6883
print(errormsgDialog)
6984

70-
def program_welcome_msg(welcome_msg):
71-
print(welcome_msg)
85+
def program_welcome_msg(welcome_msg,cfg):
86+
if cfg == 1:
87+
print(welcome_msg)
88+
LibAbout()
89+
elif cfg == 0:
90+
print(welcome_msg)
7291

7392
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):
7493
print("{0} {1}". format(programnamedialog,program_name))
@@ -80,10 +99,11 @@ def program_info(programnamedialog,program_name,programversiondialog,program_ver
8099
print("{0} {1}". format(programreleasedatedialog,program_rs_date))
81100
print("{0} {1}". format(programlastupdatedatedialog,program_last_update_date))
82101

83-
# TR (Turkish / Türkçe):
84-
# NOT: InputN1N2() sadece 2 sayının istendiği durumlarda kullanılabilir.
85-
# EN (English / İngilizce):
86-
# NOTE: InputN1N2() can be used when only 2 numbers are required.
102+
""" TR (Turkish / Türkçe):
103+
NOT: InputN1N2() sadece 2 sayının istendiği durumlarda kullanılabilir.
104+
105+
EN (English / İngilizce):
106+
NOTE: InputN1N2() can be used when only 2 numbers are required. """
87107

88108
def InputN1N2(number_one_dialog,number_two_dialog):
89109
global number_one, number_two
@@ -136,23 +156,23 @@ def TakingExponents(x,y,ResultDialog):
136156

137157
def TakingRoots(x,y,ResultDialog):
138158
result=x ** (1/y)
139-
print("{0} {1} {2} / (1/y) = {3}". format(select_func,ResultDialog,x,result))
159+
print("{0} {1} {2} / (1/{3}) = {4}". format(select_func,ResultDialog,x,y,result))
140160

141161
def SqaureRoot(x,ResultDialog):
142162
result=x ** (1/2)
143163
print("{0} {1} {2} ** (1/2) = {3}". format(select_func,ResultDialog,x,result))
144164

145-
# TR (Turkish / Türkçe):
146-
# NOT: "Basic_Maths" kütüphanesini kullanan geliştiriciler programlarındaki ihtiyaçlara göre "Basic_Maths" fonksiyonlarını değiştirebilirler.
147-
# 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.
148-
# 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.
149-
# Ö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.
150-
151-
# EN (English / İngilizce):
152-
# NOTE: Developers using the "Basic_Maths" library can change the "Basic_Maths" functions according to the needs of their programs.
153-
# NOTE2: With the "select_process" variable, developers can optionally display the process selected by users in their programs.
154-
# 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.
155-
# 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.
165+
""" TR (Turkish / Türkçe):
166+
NOT: "Basic_Maths" kütüphanesini kullanan geliştiriciler programlarındaki ihtiyaçlara göre "Basic_Maths" fonksiyonlarını değiştirebilirler.
167+
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.
168+
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.
169+
Ö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.
170+
171+
EN (English / İngilizce):
172+
NOTE: Developers using the "Basic_Maths" library can change the "Basic_Maths" functions according to the needs of their programs.
173+
NOTE2: With the "select_process" variable, developers can optionally display the process selected by users in their programs.
174+
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.
175+
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. """
156176

157177
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):
158178
error_dialog = errdg

0 commit comments

Comments
 (0)