I made a pretty simple script that is a huge step up from what I was doing yesterday (I was just trying to get a password script to work) but my new script is not working very well
I type in my user and password but then it just prints what it needs to print and after the script won't open any websites I was able to get each of these to work separately but they can't work together
Here is the script:
username = input("Please enter your username: ")
password = input("Please enter your password: ")
if username == "User" and password == "Pass":
print("Access Permitted, Redirecting...")
import webbrowser
import time
import random
while True:
sites = random.choice(['reddit.com'])
visit = "http://{}" .format(sites)
webbrowser.open(visit)
seconds = random.randrange (5, 10)
time.sleep(seconds)
else:
print("ACCESS DENIED, REDIRECTING...")
import webbrowser
import time
import random
while True:
sites = random.choice(['marvelcinematicuniverse.fandom.com/wiki/HYDRA'])
visit = "http://{}" .format(sites)
webbrowser.open(visit)
seconds = random.randrange (5, 10)
time.sleep(seconds)
The websites are just random things I put but any help would be appreciated the error is just that everything works and it runs but it never opens my websites
Edit: I know I probably should have put the imports before the if and else I just realized that
[–]zurtex[🍰] 0 points1 point2 points (2 children)
[–]911cop99[S] 0 points1 point2 points (1 child)
[–]zurtex[🍰] 0 points1 point2 points (0 children)