Showcase your coding talent
Join the most intelligent community of young coders. Browse, save & play with codes to understand how they work, and code your own ideas to earn badges & scholarships.

Tekie.in

Web helper

posted 22 days ago

webbrowser
if-else

This code will help you search in YouTube or google faster and easier. NOTE: THIS CODE ONLY WORKS ON PYTHON OR PYTHON IDE LIKE PYCHARM AND VISUAL STUDIO. YOU NEED TO ALSO INSTALL THE NEEDED PIP PACKAGES TO RUN THIS CODE. THE NEEDED COMMAND IS GIVEN ON THE CODE. please like my code toooo......

from googlesearch import * #pip install googlesearch

import pywhatkit #pip install pywhatkit

import webbrowser #pip install webbrowser







print("Hi I am Chithranjan in this code you can search in youtube or google faster and easier")

print("So what would you like to open google or youtube type in small letters")

choice = input("Youtube or google")

if choice == 'google':

        print("What would you like to search in google")

        query = input("WHat do you want me to search:")

        chrome_path = r'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe %s'

        for url in search(query, tld="co.in", num=1, stop = 1, pause = 2):

                webbrowser.open("https://google.com/search?q=%s" % query)

        print("opening google")





if choice == 'youtube':

        song=input("What do you want to play in youtube")

        print("Playing" +song)

        pywhatkit.playonyt(song)





print("Thank you for using this code")

print('I would really appreciate if you like this code')