GithubHelp home page GithubHelp logo

My exciting python adventrure ig 🐍


Password checker code I guess:


Difficulty: ☆☆☆★★ Usefullness: ☆★★★★

What's required?

to make this simple program you will need python, a code editor like Spyder or VSCODE and the time and webbrowser modules. I am pretty sure both of these modules are included with your python install but if the code isn't working open you terminal (mac) or command prompt on windows and write 'pip install webbrowser' and/or 'pip install time'. once you've done this you can change things like where the correct password and username will take you and stuff like that. (the time and webbrowser modules aren't required you just won't be able to have the code wait or open tabs)

The code
from webbrowser import open_new_tab 
import time 

print ('If you ever have any questions or need assistance type "help" in the console')

Userstatus = input('Are you a new user? ')
if Userstatus == 'yes':
    while True:
            Username = input('Create username: ') 
            Password = input ('Create password: ')
            yes = input ('Is this correct? ')
            if yes == 'yes':
                break
    lenofuser = len(Username)
    lenofpass = len(Password)
    Userstatus = 'no'
    print('Username: ', '*' * lenofuser)
    print('password: ','*' * lenofpass)
    time.sleep(1)
    print()
    print('Username and password sucsessfully created! ')
    print ()
    time.sleep(0.8)
elif Userstatus == 'no':
    Username = ''
    Password = ''
    print ("Now let's get you logged in!")
while True: 
        Username2 = input('Enter username: ')
        if Username2 == Username: 
            break 
        elif Username2 == 'help':
            print (), print('Keep Coping bozo')
        elif Username2 != Username: 
            print ('Wrong username. Please try again')
while True: 
        Password2 = input('Enter password: ')
        if Password2 == Password:
            break 
        elif Password2 == 'help':
             print(), print('Keep Coping bozo')
        elif Password2 != Password: 
            print('Wrong password. Please try again')
time.sleep (0.8)
print ()
print ('Checking Username and Password one last time. Please wait')  
time.sleep(0.8)
print()     
print('Permission Granted!')
print ()
open_new_tab('https://github.com/Liamsimp69420/liamsimp69420/blob/main/README.md')

Why did I make this?:


The simple answer is. I was bored. That also happens to be the complicated reason. idk why i'm writing this.


A program that checks how many subscribers I have on youtube.


Difficulty: ☆☆★★★ Usefullness: ☆☆☆★★

What's required?

For this project you're going to need the requests module. You can install this by opening your terminal if you are on mac or command prompt if you are on windows, and typing "pip install requests" you might need to install different modules for different projects. But since I wanted to make a robot yell at me I decided it was easiest to use the "open_new_tab('')" module and just have it open a youtube video. You can get this by writing "pip install webbrowser" in your terminal/command prompt. To get these in you program you can write "from webbrowser import open_new_tab" and "import requests" in your python program. (the time module should be built into python and it isn't required for this program to work)


The code
import requests 
import time  
from webbrowser import open_new_tab 
Subscribers=0

while True: 
#the while loop makes the program run automatically 
    r = requests.get('https://www.youtube.com/channel/UCsgji3te_hJpwZXy_cbO0Bg') 
#requests.get pulls the html code from my youtube channel
    s = ((r.text).split('subscriberCountText')[1])
#Here I am splitting the html just before it shows my subscriber count. 
    t = (s.split('subscribers"}},"simpleText"')[0])
#and here I am splitting right after the subscriber count in the html. 
    Subcheck = Subscribers
    Subscribers = (t.split('":{"accessibility":{"accessibilityData":{"label":"')[1])
    s1 =int(Subscribers)
    s2 =int(Subcheck)
    print('Sub Count: ', Subscribers) 
    if (s2 < s1): 
        open_new_tab('https://docs.google.com/document/d/1XEuEUQB682Uo3aC2_Gx2Qs2Z0dCl_PuP8AygG6Z4I-w/edit') 
    time.sleep(60) 
#the code automatically repeats every 60 seconds. 
    

Why did I make this?:

I made this code/guide because when I wanted to do this there were no guides that didn't require an api/100's of python modules and lines of code. I making this so that hopefully someone who needs this can use it.

Why not an api?

The reason I decided to use the 'split' tool in python for this project is becuase API's can be complicated and expensive. Since I want my computer to yell at me as much as possible I don't want my computer to have to process a few hundred lines of code when just a few will work. Since having more code would take more time and processing power from my life and put stress on my computer I decided to skip the API route and go for 'requests' instead. And while API's have their uses I just didn't need one for this project so didn't use one.

William Quick 's Projects

wsw icon wsw

William Severin Watches

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.