Skip to content

Commit 81491c9

Browse files
Important Update.
Signed-off-by: Umut <143949134+LinuxUsersLinuxMint@users.noreply.github.com>
1 parent 9821135 commit 81491c9

File tree

3 files changed

+220
-84
lines changed

3 files changed

+220
-84
lines changed

EN/calc.py

+60-42
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
#!/usr/bin/python3
22
import os
33
from colorama import Fore, init
4+
from Basic_Maths import *
45
init(autoreset=True)
56
process=int(0)
6-
""" Copyright© 2023-2024 LinuxUsersLinuxMint
7+
error_dialog = "Invalid Process/Command!"
8+
"""Copyright© 2023-2024 LinuxUsersLinuxMint
79
Python Calcutator Tüm Hakları GPL(Genel Kamu Lisansı) altında korunmaktadır.
810
Python Calcutator All Rights Reserved under the GPL(General Public License).
9-
Bu Yazılımın Bir Kopyası GİTHUB da yayınlanmaktadır Görüntülemek için: https://github.com/LinuxUsersLinuxMint/Python-Calcutator
10-
A Copy of This Software is published on GITHUB To view: https://github.com/LinuxUsersLinuxMint/Python-Calcutator """
11-
print("******************************************************")
12-
print("*** Welcome to Python-Calcutator 0.3 Program ***")
13-
print("""*** Options: ***
14-
*** ***
15-
*** Enter the Command you want to choose... ***
16-
*** ***
17-
*** 1. calc ***
18-
*** 2. about ***
19-
*** 3. exit ***
20-
*** 4. help ***
21-
*** 5. git-address ***
22-
*** 6. ver ***
23-
*** 7. licence ***
24-
*** 8. Thank ***
25-
******************************************************""")
11+
Bu Yazılımın Bir Kopyası GİTHUB da yayınlanmaktadır Görüntülemek için: https://github.com/LinuxUsersLinuxMint/LinuxUsersLinuxMint-Calcutator
12+
A Copy of This Software is published on GITHUB To view: https://github.com/LinuxUsersLinuxMint/LinuxUsersLinuxMint-Calcutator """
13+
print("*********************************************************************")
14+
print("*** Welcome to LinuxUsersLinuxMint-Calcutator 0.3.1 Program ***")
15+
print("""*** Options: ***
16+
*** ***
17+
*** Enter the Command you want to choose... ***
18+
*** ***
19+
*** 1. calc ***
20+
*** 2. about ***
21+
*** 3. exit ***
22+
*** 4. help ***
23+
*** 5. git-address ***
24+
*** 6. ver ***
25+
*** 7. licence ***
26+
*** 8. Thank ***
27+
*********************************************************************""")
2628
command=str(input(Fore.LIGHTBLUE_EX +'calc> '))
2729
os.system("clear")
2830
about="Python Calcutator CLI(Command Line Interface) LICENCE=GPL2"
@@ -32,7 +34,7 @@
3234
Selected Transaction={0}""". format(selected_transaction))
3335
print("""
3436
1. Addition
35-
2. Subraction
37+
2. Extraction
3638
3. Multiplication
3739
4. Division
3840
5. Percentage""")
@@ -45,33 +47,49 @@
4547
number2=float(input('calc> Enter The 2st Number: '))
4648
os.system("clear")
4749
if process=="1":
48-
print("{0} + {1} = {2}". format(number1,number2,number1+number2))
50+
addition(number1,number2,"Result: ")
4951
elif process=="2":
50-
print("{0} - {1} = {2}". format(number1,number2,number1-number2))
52+
Extraction(number1,number2,"Result: ")
5153
elif process=="3":
52-
print("{0} * {1} = {2}". format(number1,number2,number1*number2))
54+
Multiplication(number1,number2,"Result: ")
5355
elif process=="4":
54-
print("{0} / {1} = {2}". format(number1,number2,number1/number2))
56+
Division(number1,number2,"Result: ", "Number cannot be zero in division!")
5557
elif process=="5":
56-
print("{0} % {1} = {2}". format(number1,number2,number1%number2))
58+
Percentage(number1,number2,"Result: ")
5759
else:
58-
print("Invalid Process!")
59-
if command=="about":
60-
print(about)
61-
elif command=="exit":
60+
error_msg()
61+
62+
if command=="about":
63+
print(about)
64+
elif command=="exit":
65+
exit_select = input('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)): ')
66+
exit_select = int(exit_select)
67+
if exit_select == 0:
68+
userTime = input('After how many seconds should the program be closed?: ')
69+
userTime = int(userTime)
70+
exit_program_dialog_time("Exit program...", userTime)
71+
elif exit_select == 1:
72+
userTime = input('After how many seconds should the program be closed?: ')
73+
userTime = int(userTime)
74+
exit_program_time(userTime)
75+
elif exit_select == 2:
76+
exit_program_dialog("Exit program...")
77+
elif exit_select == 3:
6278
exit()
63-
elif command=="help":
64-
print("Python calc Help")
65-
print("\n Command: calc , about , help , exit , git-address , web-site , ver , licence , Thank")
66-
elif command=="git-address":
67-
print("Github Link: https://github.com/LinuxUsersLinuxMint")
68-
elif command=="web-site":
69-
print("linuxuserslinuxmint.github.io")
70-
elif command=="ver":
71-
print("Version: 0.3 (Last Updated on May 8, 2024, 21:54)")
72-
elif command=="licence":
73-
print("This Software is protected under the GPL2 license")
74-
elif command=="Thank":
75-
print("Thank You for Using Python-Calcutator.")
7679
else:
77-
print("Invalid Command!")
80+
error_msg()
81+
elif command=="help":
82+
print("LinuxUsersLinuxMint-Calcutator Help")
83+
print("\n Command: calc , about , help , exit , git-address , web-site , ver , licence , Thank")
84+
elif command=="git-address":
85+
print("Github Link: https://github.com/LinuxUsersLinuxMint/LinuxUsersLinuxMint-Calcutator")
86+
elif command=="web-site":
87+
print("https://linuxuserslinuxmint.github.io")
88+
elif command=="ver":
89+
print("Version: 0.3.1 (Last Updated on May 31, 2024, 23:30)")
90+
elif command=="licence":
91+
print("This Software is protected under the GPL2 license")
92+
elif command=="Thank":
93+
print("Thank You for Using Python-Calcutator.")
94+
else:
95+
error_msg()

TR/Basic_Maths.py

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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+
import time
9+
10+
global result,input_dialog,error_dialog
11+
12+
input_dialog = str()
13+
error_dialog = str()
14+
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():
47+
global number_one, number_two
48+
number_one = str(input("{0}". format(input_dialog)))
49+
number_two = str(input("{0}". format(input_dialog)))
50+
51+
select_func = str()
52+
"""
53+
Example:
54+
55+
input_select = str(input('Which process?'))
56+
select_func = input_select
57+
58+
def addition(x,y,ResultDialog):
59+
result=x+y
60+
print("{0} {1} {2} + {3} = {4}". format(select_func,ResultDialog,x,y,result))
61+
62+
"""
63+
64+
def addition(x,y,ResultDialog):
65+
result=x+y
66+
p("{0} {1} {2} + {3} = {4}". format(select_func,ResultDialog,x,y,result))
67+
68+
def Extraction(x,y,ResultDialog):
69+
result=x-y
70+
p("{0} {1} {2} - {3} = {4}". format(select_func,ResultDialog,x,y,result))
71+
72+
def Multiplication(x,y,ResultDialog):
73+
result=x*y
74+
p("{0} {1} {2} * {3} = {4}". format(select_func,ResultDialog,x,y,result))
75+
76+
def Division(x,y,ResultDialog,check_zero_control_msg):
77+
if x==0 or y==0:
78+
p(check_zero_control_msg)
79+
if y>0 and x>0:
80+
result=x/y
81+
p("{0} {1} {2} / {3} = {4}". format(select_func,ResultDialog,x,y,result))
82+
83+
def Percentage(x,y,ResultDialog):
84+
result=x%y
85+
p("{0} {1} {2} % {3} = {4}". format(select_func,ResultDialog,x,y,result))
86+
87+
def FullDivision(x,y,ResultDialog):
88+
result=x//y
89+
p("{0} {1} {2} // {3} = {4}". format(select_func,ResultDialog,x,y,result))
90+
91+
def TakingExponents(x,y,ResultDialog):
92+
result=x ** y
93+
p("{0} {1} {2} ** {3} = {4}". format(select_func,ResultDialog,x,y,result))
94+
95+
def TakingRoots(x,y,ResultDialog):
96+
result=x ** (1/y)
97+
p("{0} {1} {2} / (1/y) = {3}". format(select_func,ResultDialog,x,result))
98+
99+
def SqaureRoot(x,ResultDialog):
100+
result=x ** (1/2)
101+
p("{0} {1} {2} ** (1/2) = {3}". format(select_func,ResultDialog,x,result))

TR/calc.py

+59-42
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
#!/usr/bin/python3
22
import os
33
from colorama import Fore, init
4+
from Basic_Maths import *
45
init(autoreset=True)
56
islem=int(0)
7+
error_dialog = "Geçersiz İşlem/Komut!"
68
""" Copyright© 2023-2024 LinuxUsersLinuxMint
7-
Python Calcutator Tüm Hakları GPL(Genel Kamu Lisansı) altında korunmaktadır.
8-
Python Calcutator All Rights Reserved under the GPL(General Public License).
9-
Bu Yazılımın Bir Kopyası GİTHUB da yayınlanmaktadır Görüntülemek için: https://github.com/LinuxUsersLinuxMint/Python-Calcutator
10-
A Copy of This Software is published on GITHUB To view: https://github.com/LinuxUsersLinuxMint/Python-Calcutator """
11-
print("******************************************************")
12-
print("*** Python-Calcutator 0.3 Programına Hoşgeldiniz ***")
13-
print("""*** Seçenekler: ***
14-
*** ***
15-
*** Seçmek istediğiniz Komutu Giriniz... ***
16-
*** ***
17-
*** 1. calc ***
18-
*** 2. about ***
19-
*** 3. exit ***
20-
*** 4. help ***
21-
*** 5. git-address ***
22-
*** 6. ver ***
23-
*** 7. licence ***
24-
*** 8. Thank ***
25-
******************************************************""")
9+
LinuxUsersLinuxMint Calcutator Tüm Hakları GPL(Genel Kamu Lisansı) altında korunmaktadır.
10+
LinuxUsersLinuxMint Calcutator All Rights Reserved under the GPL(General Public License).
11+
Bu Yazılımın Bir Kopyası GİTHUB da yayınlanmaktadır Görüntülemek için: https://github.com/LinuxUsersLinuxMint/LinuxUsersLinuxMint-Calcutator
12+
A Copy of This Software is published on GITHUB To view: https://github.com/LinuxUsersLinuxMint/LinuxUsersLinuxMint-Calcutator """
13+
print("*********************************************************************")
14+
print("*** LinuxUsersLinuxMint-Calcutator 0.3.1 Programına Hoşgeldiniz ***")
15+
print("""*** Seçenekler: ***
16+
*** ***
17+
*** Seçmek istediğiniz Komutu Giriniz... ***
18+
*** ***
19+
*** 1. calc ***
20+
*** 2. about ***
21+
*** 3. exit ***
22+
*** 4. help ***
23+
*** 5. git-address ***
24+
*** 6. ver ***
25+
*** 7. licence ***
26+
*** 8. Thank ***
27+
*********************************************************************""")
2628
command=str(input(Fore.LIGHTBLUE_EX +'calc> '))
2729
os.system("clear")
2830
about="Python Hesap Makinesi CLI(Komut Satırı Arayüzü) LICENCE=GPL2"
@@ -45,33 +47,48 @@
4547
sayi2=float(input('calc> 2. sayiyi giriniz: '))
4648
os.system("clear")
4749
if islem=="1":
48-
print("{0} + {1} = {2}". format(sayi1,sayi2,sayi1+sayi2))
50+
addition(sayi1,sayi2,"Sonuç: ")
4951
elif islem=="2":
50-
print("{0} - {1} = {2}". format(sayi1,sayi2,sayi1-sayi2))
52+
Extraction(sayi1,sayi2,"Sonuç: ")
5153
elif islem=="3":
52-
print("{0} * {1} = {2}". format(sayi1,sayi2,sayi1*sayi2))
54+
Multiplication(sayi1,sayi2,"Sonuç: ")
5355
elif islem=="4":
54-
print("{0} / {1} = {2}". format(sayi1,sayi2,sayi1/sayi2))
56+
Division(sayi1,sayi2,"Sonuç: ","Bölme işleminde sayılar 0 olamaz!")
5557
elif islem=="5":
56-
print("{0} % {1} = {2}". format(sayi1,sayi2,sayi1%sayi2))
58+
Percentage(sayi1,sayi2,"Sonuç: ")
5759
else:
58-
print("Geçersiz İşlem!")
59-
if command=="about":
60-
print(about)
61-
elif command=="exit":
60+
error_msg()
61+
if command=="about":
62+
print(about)
63+
elif command=="exit":
64+
exit_select = int(input('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)): '))
65+
exit_select = int(exit_select)
66+
if exit_select == 0:
67+
userTime = input('After how many seconds should the program be closed?: ')
68+
userTime = int(userTime)
69+
exit_program_dialog_time("Exit program...", userTime)
70+
elif exit_select == 1:
71+
userTime = input('After how many seconds should the program be closed?: ')
72+
userTime = int(userTime)
73+
exit_program_time(userTime)
74+
elif exit_select == 2:
75+
exit_program_dialog("Exit program...")
76+
elif exit_select == 3:
6277
exit()
63-
elif command=="help":
64-
print("Python calc Help")
65-
print("\n Command: calc , about , help , exit , git-address , web-site , ver , licence , Thank")
66-
elif command=="git-address":
67-
print("Github Link: https://github.com/LinuxUsersLinuxMint")
68-
elif command=="web-site":
69-
print("linuxuserslinuxmint.github.io")
70-
elif command=="ver":
71-
print("Sürüm: 0.3 (Son Güncellenme Tarihi 8 Mayıs , 2024 , 21:54)")
72-
elif command=="licence":
73-
print("Bu Yazılım GPL2 lisansı kapsamında korunmaktadır.")
74-
elif command=="Thank":
75-
print("Python-Calcutator'u Kullandığınız için Teşekkür ederim. ")
7678
else:
77-
print("Geçersiz Komut!")
79+
error_msg()
80+
elif command=="help":
81+
print("Python calc Help")
82+
print("\n Command: calc , about , help , exit , git-address , web-site , ver , licence , Thank")
83+
elif command=="git-address":
84+
print("Github Link: https://github.com/LinuxUsersLinuxMint/LinuxUsersLinuxMint-Calcutator")
85+
elif command=="web-site":
86+
print("linuxuserslinuxmint.github.io")
87+
elif command=="ver":
88+
print("Sürüm: 0.3.1 (Son Güncellenme Tarihi 31 Mayıs , 2024 , 23:30)")
89+
elif command=="licence":
90+
print("Bu Yazılım GPL2 lisansı kapsamında korunmaktadır.")
91+
elif command=="Thank":
92+
print("Python-Calcutator'u Kullandığınız için Teşekkür ederim. ")
93+
else:
94+
error_msg()

0 commit comments

Comments
 (0)