-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
email = "your fb ID" | ||
password = "Your fb ID password" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from fbchat import Client, log | ||
from fbchat.models import * | ||
|
||
|
||
import data | ||
|
||
class Jarvis(Client): | ||
|
||
def onMessage(self,author_id=None,message_object=None,thread_id=None,thread_type=ThreadType.USER, **kwargs): | ||
|
||
self.markAsRead(author_id) | ||
|
||
log.info("Message {} from {} in {}".format(message_object,thread_id,thread_id)) | ||
|
||
msgText = message_object.text | ||
|
||
reply = 'Thanks for the messege' | ||
|
||
if author_id != self.uid: | ||
self.send(Message(text=reply),thread_id=thread_id,thread_type=thread_type) | ||
|
||
self.markAsDelivered(author_id,thread_id) | ||
|
||
Client = Jarvis(data.email,data.password) | ||
Client.listen() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
from tkinter import* | ||
|
||
def bntClick(numbers): | ||
global operator | ||
operator = operator + str(numbers) | ||
text_Input.set(operator) | ||
def cleardisplay(): | ||
global operator | ||
operator = "" | ||
text_Input.set('') | ||
|
||
def Equal(): | ||
global operator | ||
sumup = str(eval(operator)) | ||
text_Input.set(sumup) | ||
operator = "" | ||
operator= operator + sumup | ||
|
||
cal = Tk() | ||
cal.title("Calculator") | ||
operator = "" | ||
text_Input = StringVar() | ||
|
||
textDisplay = Entry(cal,font=('arial',20,'bold'),textvariable = text_Input,bd=30, insertwidth=5,bg="powder blue",justify='left').grid(columnspan=5) | ||
|
||
############################################ | ||
btn7 = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="7",command=lambda:bntClick(7),bg="powder blue").grid(row=1,column=0) | ||
|
||
btn8 = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="8",command=lambda:bntClick(8),bg="powder blue").grid(row=1,column=1) | ||
|
||
btn9 = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="9",command=lambda:bntClick(9),bg="powder blue").grid(row=1,column=2) | ||
|
||
btnplus = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="+",command=lambda:bntClick('+'),bg="powder blue").grid(row=1,column=3) | ||
################################################ | ||
btn4 = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="4",command=lambda:bntClick(4),bg="powder blue").grid(row=2,column=0) | ||
|
||
btn5 = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="5",command=lambda:bntClick(5),bg="powder blue").grid(row=2,column=1) | ||
|
||
btn6 = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="6",command=lambda:bntClick(6),bg="powder blue").grid(row=2,column=2) | ||
|
||
btnsub = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="-",command=lambda:bntClick('-'),bg="powder blue").grid(row=2,column=3) | ||
############################################## | ||
btn1 = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="1",command=lambda:bntClick(1),bg="powder blue").grid(row=3,column=0) | ||
|
||
btn2 = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="2",command=lambda:bntClick(2),bg="powder blue").grid(row=3,column=1) | ||
|
||
btn3 = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="3",command=lambda:bntClick(3),bg="powder blue").grid(row=3,column=2) | ||
|
||
btnmul = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="*",command=lambda:bntClick('*'),bg="powder blue").grid(row=3,column=3) | ||
############################################## | ||
btn0 = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="0",command=lambda:bntClick(0),bg="powder blue").grid(row=4,column=0) | ||
|
||
btnC = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="C",command=cleardisplay,bg="powder blue").grid(row=4,column=1) | ||
|
||
btniq = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="=",command=Equal,bg="powder blue").grid(row=4,column=2) | ||
|
||
btndiv = Button(cal,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="/",command=lambda:bntClick('/'),bg="powder blue").grid(row=4,column=3) | ||
############################################## | ||
|
||
|
||
|
||
cal.mainloop() | ||
|