Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Blockzillahead

Pages: 1 ... 604 605 606 607 608 [609] 610 611 612 613 614 ... 794
9121
I thought these forums were lurking with Pythoneers. I guess not.

9122
Drama / Re: [insert name here]:richard.
« on: May 24, 2013, 10:20:53 PM »
Actually, IIRC, one-minute bans don't expire correctly but get removed from the banlist - meaning that you're effectively permabanned through a glitch but it's impossible to unban you.

sarcasm?

9123
Off Topic / Re: 3447 When did i join BL in what year?
« on: May 24, 2013, 09:50:13 PM »
14749/Jan 01, 2009

9124
Off Topic / Any Python pros out there willing to clean my code?
« on: May 24, 2013, 09:38:24 PM »
I don't know how to make it more neater than this. Can anyone give me advice without changing the way the whole script works?
Also what it does is it has a database of users. You are supposed to login with the correct info, you can exit the program, logout, or register. It's my first real code that I spent some effort on.

Edit: Updated the script.

Code: [Select]
from tkinter import *
import time, sys, getpass


database = {}
database["admin"] = "123"
database["user"] = "000"

logged = 'false'
listcommands = (
    "Logout, Quit, Removal(Admins Only)"
    )

def main():
    while True:
        print("Say 'help' for a list of commands.")
        command = input(">>").lower()
        if command == 'help':
            print(listcommands)
        elif command == 'quit':
            quitter()
        elif command == 'logout':
            logout()
        else:
            print("Command not valid")

def main2():
    print("Welcome! Login, register or quit.")
    while True:
        command2 = input(">>").lower()
        if command2 == "login":
            login()
        elif command2 == "register":
            register()
        elif command2 == "quit":
            quitter()
        else:
            print("Command not valid")

def login():
    print("Please login.")
    while True:
        username = input("Username: ").lower()
        password = getpass.getpass("Password: ")
        if username in database.keys():
            expected_password = database[username]
            if expected_password == password:
                print("Welcome " + username)
                global logged
                logged = 'true'
                main()
            else:
                print("Login is incorrect. Try again.")
        else:
            print("User does not exit. Try again.")

def register():
    print("Register your information")
    time.sleep(1)
    newuser = input("Username: ").lower()
    newpass = getpass.getpass("Password: ")
    database[newuser] = newpass
    print("Successful!")
    main2()

def quitter():
    print("Are you sure you want to quit? Y/N?")
    while True:
        commandquit = input(">>").lower()
        if commandquit == "y":
            print("Quitting...")
            time.sleep(2)
            sys.exit(0)
        elif commandquit == "n":
            print("Returning to main board...")
            global logged
            if logged == "true":
                time.sleep(1)
                main()
            else:
                time.sleep(1)
                main2()
        else:
            print("Command not valid.")


def removal():
    print("Work in progress...")
    time.sleep(1)
    main()

def logout():
    print("Are you sure you want to log out? Y/N")
    while True:
        commandlogout = input(">>").lower()
        if commandlogout == "y":
            print("Logging out...")
            time.sleep(1)
            main2()
        elif commandlogout == "n":
            print("Returning to main board...")
            time.sleep(2)
            main()
        else:
            print("Command not valid.")


app = Tk() # Trying to put it into a GUI here. Too tired to do it at this moment
app.title("Python Test")
label = Label(app, text="Python Test Label").pack()
button = Button(app, text="Login",command=lambda: main2()).pack()
app.geometry("500x300")
app.mainloop()
       


9125
Off Topic / Re: Carpe Diem
« on: May 24, 2013, 09:23:05 PM »
63 years left. Yeah bullstuff. I am immortal.

9126
Off Topic / Re: I'm pissed off at my friend, help me get revenge.
« on: May 24, 2013, 09:08:34 PM »
all of this for a picture of you fall---
I don't care about the photo, I'm just trying to forget with him. Because I'm a richard.

well in that case... pull his pants down if he sags and take a picture and do the same thing.

9127
Off Topic / Re: YouTube keeps downloading empty 'frame' files.
« on: May 24, 2013, 07:20:57 PM »
It seems that you have been framed.

oh u

9128
Off Topic / Re: How old are you, forums?
« on: May 24, 2013, 03:25:06 PM »
12
ill be 12 in 4 years though

wow you liar no wonder goats hate you

9129
Off Topic / Re: yoooo whats up forums, whats goinh down tonight?
« on: May 24, 2013, 03:23:37 PM »
There's 2 lanes of life. I drive down the middle and swerve.
50 /50 chance ima make it in this world.

im on my tricycle in the bike lane beside the road

9130
I watched a few of his videos to see what the hype was all about and I didn't enjoy it that much.

But what makes me sad is that I watch a lot of people on YouTube who are really great but don't even have 1/10 the subscribers or views PewDiePie does.

9131
Off Topic / Re: Looking for good gaming laptop under $1,000
« on: May 23, 2013, 08:09:44 PM »
I've got an i5 and a gtx 780. I 100% stand by what I said. You are not going to get a good gaming laptop for under 1k. You can have a mediocre one, sure, but he specifically asks for a GOOD gaming laptop. Anything that is note-worthy is over 1k.

but im sure by good he means an average laptop with a decent capability of gaming. specifically for blockland, which sli gt 650m can handle very well. he didn't mean a super ultra gaming laptop

9132
Off Topic / Re: Looking for good gaming laptop under $1,000
« on: May 23, 2013, 08:04:33 PM »
was that supposed to be a comeback

dont worry if it's not i9 and gtx 990 it's not good enough for .atlas.

9133
Off Topic / Re: Looking for good gaming laptop under $1,000
« on: May 23, 2013, 06:38:41 PM »

9134
Off Topic / Re: Level 27 acquired!
« on: May 23, 2013, 03:17:13 PM »
man this makes it really hard for me to believe you are 27 because im always suspicious

but happy birthday

9135
Drama / Re: Pie Dude randomly unfriended me on Rtb
« on: May 22, 2013, 09:43:55 PM »
You're absolutely loving handicapped.

"If something bad happens to you on your computer or in real life that is off-topic, not drama. "
This is on a computer, he was saying that things that happen in real life are not to be posted here

You are reading that wrong. It says not to post off-topic things whether or not it's on a computer or in real life.

So I am wrong but this still shouldn't be a drama because the guy who unfriended him did nothing wrong. Maybe OP should stop crying whenever one of his internet friends leaves him.

Pages: 1 ... 604 605 606 607 608 [609] 610 611 612 613 614 ... 794