Skip to content

Commit 27b35eb

Browse files
committed
Python Project
This project, we are going to type a code to generate random passwords (Password Generator)
1 parent c31d831 commit 27b35eb

5 files changed

Lines changed: 26 additions & 4 deletions

File tree

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.pythonPath": "/Users/jabarijones/opt/anaconda3/bin/python"
3+
}

3 calcGUI/calcGUI.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from tkinter import *
22
from math import sqrt as sqr
3-
3+
from math import sin as Sin
4+
from math import cos as Cos
5+
from math import tan as Tan
46

57
class Application(Frame):
68
"""
@@ -74,6 +76,9 @@ def calculate(self):
7476
e = e.replace("²", "**2")
7577
e = e.replace("^", "**")
7678
e = e.replace("÷", "/")
79+
e = e.replace("sin","Sin")
80+
e = e.replace("cos","Cos")
81+
e = e.replace("tan","Tan")
7782

7883
try:
7984
ans = eval(e)
@@ -126,7 +131,7 @@ def bind_buttons(self, master):
126131
master.bind("4", lambda event, char="4", btn=self.four_bttn: self.add_chr(char, btn))
127132
master.bind("3", lambda event, char="3", btn=self.three_bttn: self.add_chr(char, btn))
128133
master.bind("2", lambda event, char="2", btn=self.two_bttn: self.add_chr(char, btn))
129-
master.bind("1", lambda event, char="1", btn=self.one_bttn: self.add_chr(char, btn))
134+
master.bind("9", lambda event, char="1", btn=self.one_bttn: self.add_chr(char, btn))
130135
master.bind("0", lambda event, char="0", btn=self.zero_bttn: self.add_chr(char, btn))
131136
master.bind("*", lambda event, char="×", btn=self.mult_bttn: self.add_chr(char, btn))
132137
master.bind("/", lambda event, char="÷", btn=self.div_bttn: self.add_chr(char, btn))
@@ -144,6 +149,15 @@ def create_widgets(self):
144149
Creates the widgets to be used in the grid.
145150
:return: None
146151
"""
152+
self.sin_bttn = Button(self, text="sin", width=9, height=3, command=lambda: self.add_chr('sin'))
153+
self.sin_bttn.grid(row=1, column=6)
154+
155+
self.sin_bttn = Button(self, text="cos", width=9, height=3, command=lambda: self.add_chr('cos'))
156+
self.sin_bttn.grid(row=2, column=6)
157+
158+
self.sin_bttn = Button(self, text="tan", width=9, height=3, command=lambda: self.add_chr('tan'))
159+
self.sin_bttn.grid(row=3, column=6)
160+
147161
self.eq_bttn = Button(self, text="=", width=20, height=3, bg="lightgrey", command=lambda: self.calculate())
148162
self.eq_bttn.grid(row=4, column=4, columnspan=2)
149163

@@ -186,7 +200,7 @@ def create_widgets(self):
186200
self.six_bttn = Button(self, text="6", width=9, height=3, command=lambda: self.add_chr(6))
187201
self.six_bttn.grid(row=2, column=2)
188202

189-
self.one_bttn = Button(self, text="1", width=9, height=3, command=lambda: self.add_chr(1))
203+
self.one_bttn = Button(self, text="Jabari", width=9, height=3, command=lambda: self.add_chr("Jones"))
190204
self.one_bttn.grid(row=3, column=0)
191205

192206
self.two_bttn = Button(self, text="2", width=9, height=3, command=lambda: self.add_chr(2))
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.pythonPath": "/usr/local/bin/python3"
3+
}

6 Web Page with Flask/basic page/script1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def home():
1212

1313
return render_template("home.html",myName="")
1414

15-
@app.route('/about/')
15+
@app.route('/usr/bin/python/about/')
1616
def about():
1717
return render_template("about.html")
1818

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ The projects included here include working code and some experimental code. Some
1717
> This project requires some wiring as well as a RaspberryPi computer and associated peripherals.
1818
6. Web Page with Flask
1919
> This project requires that you install the flask module. After that, when you run it, it will create a web server on your machine and host your Python and HTML files in dynamic web pages.
20+
7. Project
21+
> This project, we are going to type a code to generate random passwords (Password Generator)

0 commit comments

Comments
 (0)