Skip to content

Commit e909e6b

Browse files
Change app name and ideas
1 parent 17ba7b1 commit e909e6b

File tree

4 files changed

+89
-5
lines changed

4 files changed

+89
-5
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# Scientific_Calculator-Python
1+
# Second Hand-Python
22
Made in python tkinter module for learning purpose. will be updated often
33

44
## Features
55
This app features a
6-
url opener and place to have quick shortcuts to open URL's and also it's main thing is the calculator wih good features and less bugs. Our main motto is to bring in the most of productivity.
6+
--> url opener and place to have quick shortcuts to open URL's and
7+
--> also it's main thing is the calculator
8+
--> Features a stop watch
9+
--> wih good features and less bugs.
10+
--> Our main motto is to bring in the most of productivity.
711

812
## Windows :-
913
Go to https://github.com/Srikara-Python/Scientific_Calculator-Python/releases and download the binary file and execute it as other exe files.
Binary file not shown.

__pycache__/timer.cpython-38.pyc

1.74 KB
Binary file not shown.

calculator_scientific_.py renamed to second_hand.py

Lines changed: 83 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
""" Scientific Calculator made using tkinter module
22
Free to copy and open-source """
33

4+
from datetime import datetime
45
from curtsies import Input
56
import webbrowser
67
from tkinter import *
@@ -15,7 +16,7 @@ def main():
1516
print(repr(e))
1617

1718
root = Tk()
18-
root.title("Sceintific Calculator")
19+
root.title("Second Brain")
1920
root.resizable(False, False)
2021
root.eval('tk::PlaceWindow . center')
2122
orig_color = root.cget("background")
@@ -35,6 +36,7 @@ def event_handle(event):
3536
tab1 = ttk.Frame(tabControl, style='My.TFrame')
3637
tab2 = ttk.Frame(tabControl, style='My.TFrame')
3738
tab3 = ttk.Frame(tabControl, style='My.TFrame')
39+
tab4 = ttk.Frame(tabControl, style='My.TFrame')
3840

3941

4042
ttk.Style().configure("TNotebook", background='black');
@@ -43,6 +45,7 @@ def event_handle(event):
4345
tabControl.add(tab1, text ='Standard')
4446
tabControl.add(tab2, text ='Scientific')
4547
tabControl.add(tab3, text ='Web Browser')
48+
tabControl.add(tab4, text ='Timer')
4649

4750
tabControl.grid(row=0, column=0)
4851

@@ -57,6 +60,82 @@ def event_handle(event):
5760
tabControl2.grid(row=0, column=0)
5861

5962

63+
""""""""" TIMER """""""""
64+
counter = 66600
65+
running = False
66+
def counter_label(label):
67+
def count():
68+
if running:
69+
global counter
70+
71+
# To manage the initial delay.
72+
if counter==66600:
73+
display="Starting..."
74+
else:
75+
tt = datetime.fromtimestamp(counter)
76+
string = tt.strftime("%H:%M:%S")
77+
display=string
78+
79+
label['text']=display # Or label.config(text=display)
80+
81+
# label.after(arg1, arg2) delays by
82+
# first argument given in milliseconds
83+
# and then calls the function given as second argument.
84+
# Generally like here we need to call the
85+
# function in which it is present repeatedly.
86+
# Delays by 1000ms=1 seconds and call count again.
87+
label.after(1000, count)
88+
counter += 1
89+
90+
# Triggering the start of the counter.
91+
count()
92+
93+
# start function of the stopwatch
94+
def Start(label):
95+
global running
96+
running=True
97+
counter_label(label)
98+
start['state']='disabled'
99+
stop['state']='normal'
100+
reset['state']='normal'
101+
102+
# Stop function of the stopwatch
103+
def Stop():
104+
global running
105+
start['state']='normal'
106+
stop['state']='disabled'
107+
reset['state']='normal'
108+
running = False
109+
110+
# Reset function of the stopwatch
111+
def Reset(label):
112+
global counter
113+
counter=66600
114+
115+
# If rest is pressed after pressing stop.
116+
if running==False:
117+
reset['state']='disabled'
118+
label['text']='Welcome!'
119+
120+
# If reset is pressed while the stopwatch is running.
121+
else:
122+
label['text']='Starting...'
123+
124+
125+
label = Label(tab4, text="Welcome!", fg="black", font="Verdana 30 bold")
126+
label.pack()
127+
f = Frame(tab4)
128+
start = Button(f, text='Start', width=6, command=lambda:Start(label))
129+
stop = Button(f, text='Stop',width=6,state='disabled', command=Stop)
130+
reset = Button(f, text='Reset',width=6, state='disabled', command=lambda:Reset(label))
131+
f.pack(anchor = 'center',pady=5)
132+
start.pack(side="left")
133+
stop.pack(side ="left")
134+
reset.pack(side="left")
135+
136+
137+
138+
""""""""" WEB """""""""
60139
def open_page():
61140
webbrowser.open(entry.get())
62141

@@ -127,6 +206,9 @@ def linux_mint():
127206
link2.pack() #(row=4, column=1)
128207

129208

209+
210+
211+
""""""""" Calculator """""""""
130212
e = Entry(tab1, width=35, borderwidth=5)
131213
e.grid(row=1, column=0, columnspan=10, padx=5, pady=5)
132214
e_ = Entry(tab2, width=35, borderwidth=5)
@@ -135,8 +217,6 @@ def linux_mint():
135217
e.configure(bg="white", fg='black')
136218
e_.configure(bg="white", fg="black")
137219

138-
139-
140220
def dark_mode():
141221
ttk.Style().configure("TNotebook", background='black');
142222
s1.configure('My.TFrame', background='black')

0 commit comments

Comments
 (0)