Beispiel #1
0
import pandas as pd
import pywhatkit as pw
import time

print("Kirim WA Lebaran")
time.sleep(1)

data = pd.read_csv('data_k.csv', delimiter=';', converters={'no_hp': str})

teks = "Assalamu'alaikum warahmatullahi wabarakatuh, mohon maaf lahir dan batin nggih {}."

for num, kontak in data.iterrows():
    print('Kirim pesan ke ', num + 1)
    time.sleep(2)
    pw.sendwhatmsg_instantly(kontak.no_hp, teks.format(kontak.nama))
    print(kontak.no_hp, 'sukses')
    time.sleep(20)

print("Terkirim semua")
def run():
    while True:
        output = Talk()
        print("dfaefhiuwheg  iuwaehfieghf", output)
        now = datetime.now()

        # time, date, day, month, year subjects
        if "time" in output:
            current_time = now.strftime("%I:%M %p")
            print("Current Time is ", current_time)
            Speak("Current time is " + current_time)

        elif "date" in output:
            todate = datetime.today()
            current_date = todate.strftime("%B %d, %Y")
            print("Today's date is ", current_date)
            Speak("Today's date is " + current_date)

        elif "day" in output:
            today = datetime.today()
            current_day = today.strftime("%A")
            print("Today is", current_day)
            Speak("Today is " + current_day)

        elif "month" in output:
            month = datetime.now()
            current_month = month.strftime("%B")
            print("This month is " + current_month)
            Speak("This month is " + current_month)

        elif "year" in output:
            year = datetime.now()
            current_year = year.strftime("%Y")
            print("This year is " + current_year)
            Speak("This year is " + current_year)

        elif "thank" in output:
            thanks = random.choice(thank)
            print(thanks)
            Speak(thanks)

        elif "made" in output:
            print("I was made by Divya dharshini")
            Speak("I was made by dheevya dharsheene")

        elif "calendar" in output:
            Speak("The calendar for this year is 2021")  ## CALENDAR
            print(calendar.calendar(2021, 2, 1, 6))

        elif output[0:9] == "translate":
            tamil = output[10:]
            try:
                translator = Translator(to_lang="ta-IN")  ## TAMIL TRANSLATION
                translation = translator.translate(tamil)
                print(translation)
                tamilTextToSpeech(translation)
            except Exception:
                print("Sorry unable to translate")

        elif "jokes" in output:  ## PY JOKES
            jokes = pyjokes.get_joke()
            print(jokes)
            Speak(jokes)

        elif "Google" in output:
            webbrowser.open('www.google.com')  ## OPENING GOOGLE
            Talk()

        elif 'video' in output:
            print("You Reached the END!!")
            Talk()
            # Speak('playing ' + output)  ## PLAYING YOUTUBE VIDEO
            # kit.playonyt(output)
            # Talk()

        elif "music" in output:
            Speak("If you want to listen music please type audio")
            song_type = input(
                'Do you like to listen music, then please type "audio"')
            Speak(" Enter song name")
            song = input('Enter Song Name : ')
            song_type = song_type.lower()
            if 'audio' in song_type:  ## FOR PLAYING SONGS
                try:
                    play_audio(song)
                except:
                    print("Sorry unable to search")
                    pass
            Talk()

        elif output in commonTalks.keys():  ## SOME COMMON TALKS
            print(commonTalks[output])
            Speak(commonTalks[output])

        elif output in Good.keys():  ## GOOD MORNING MESSAGES
            print(Good[output])
            Speak(Good[output])

        elif output[0:6] == "define":  ## WIKIPEDIA
            search_query = output[7:]
            try:
                data = wikipedia.summary(search_query, 1)
            except:
                data = "Too many word occurances. Try being more specific!!"
            print(data)
            Speak(data)
        elif "message now" in output:
            phone = input("Enter phone number: ")
            message = input("Enter message ")
            try:
                kit.sendwhatmsg_instantly(f'+91{phone}', message, 10)
            except Exception:
                print("Sorry, Message not sent")
                Speak("Sorry, Message not sent")
                Talk()

        elif "message later" in output:
            phone = input("Enter phone number: ")
            message = input("Enter message ")
            hour = int(input("Enter which hour do you want to send msg "))
            minute = int(input("Enter which min you want to send msg"))
            try:
                kit.sendwhatmsg(f'+91{phone}', message, hour, minute, 30)
            except Exception:
                print("Sorry, Message not sent")
                Speak("Sorry, Message not sent")
                Talk()

        elif "hello" in output:  ## GREETINGS LIKE HELLO
            helo = random.choice(greetings)
            print(helo)
            Speak(helo)

        else:
            if output != "":
                pass
                try:
                    print("Searching...", output)
                    Speak("Searching..")
                    kit.search(output)
                except Exception:
                    pass
            Talk()
Beispiel #3
0
                        "Sorry no Internet connection can I help you with something else"
                    )

            elif 'time' in actionToDo:
                strTime = datetime.datetime.now().strftime("%H:%M:%S")
                speak(f"Sir, the time is {strTime}")

            elif 'send' in actionToDo and ('message' in actionToDo or
                                           "whatsapp message" in actionToDo):
                if netstatus:
                    speak("Say the message to be sent")
                    msg = take_command()

                    speak("Say the Number to whom u want to sent")
                    number = take_command()
                    pywhatkit.sendwhatmsg_instantly("+91" + number, msg)
                else:
                    speak(
                        "Sorry no Internet connection can I help you with something else"
                    )

            elif "open notepad" in actionToDo:
                os.system("Notepad")

            elif "open map" in actionToDo or "open google map" in actionToDo:
                if netstatus:
                    speak("Where would you like to go")
                    place = take_command()
                    webbrowser.open('https://www.google.com/maps/place/' +
                                    place)
                else:
Beispiel #4
0
import pywhatkit as kit

kit.sendwhatmsg_instantly("+5511992397130", "tes2t")
def run():
    while True:
        output = Talk()
        now = datetime.now()

        if "time" in output:  ## TIME
            current_time = now.strftime("%I:%M %p")
            print("Current Time is ", current_time)
            Speak("Current time is " + current_time)

        elif "date" in output:  ## DATE
            todate = datetime.today()
            current_date = todate.strftime("%B %d, %Y")
            print("Today's date is ", current_date)
            Speak("Today's date is " + current_date)

        elif "day" in output:
            today = datetime.today()  ## DAY
            current_day = today.strftime("%A")
            print("Today is", current_day)
            Speak("Today is " + current_day)

        elif "month" in output:
            month = datetime.now()  ## MONTH
            current_month = month.strftime("%B")
            print("This month is " + current_month)
            Speak("This month is " + current_month)

        elif "year" in output:
            year = datetime.now()  ## YEAR
            current_year = year.strftime("%Y")
            print("This year is " + current_year)
            Speak("This year is " + current_year)

        elif "thank" in output:
            thanks = random.choice(thank)  ## THANKS
            print(thanks)
            Speak(thanks)

        elif "made" in output:
            print("I was made by Divya dharshini")  ## CREATOR
            Speak("I was made by dheevya dharsheene")

        elif "calendar" in output:
            Speak("The calendar for this year is 2021")  ## CALENDAR
            print(calendar.calendar(2021, 2, 1, 6))

        elif output[0:9] == "translate":
            tamil = output[10:]
            try:
                translator = Translator(to_lang="ta-IN")  ## TAMIL TRANSLATION
                translation = translator.translate(tamil)
                print(translation)
                tamilTextToSpeech(translation)
            except Exception:
                print("Sorry unable to translate")

        elif "Tamil" in output:
            try:
                tamilspeak()  ## TAMIL SPEAKING
            except Exception:
                print("Sorry, unable to speak Tamil")
                Speak("Sorry unable to speak Tamil")

        elif "jokes" in output:  ## PY JOKES
            jokes = pyjokes.get_joke()
            print(jokes)
            Speak(jokes)

        elif "Google" in output:  ## OPENING GOOGLE
            Speak("Opening google")
            webbrowser.open('www.google.com')

        elif "YouTube" in output:
            Speak("opening youtube")  ## OPENING YOUTUBE
            webbrowser.open('www.youtube.com')

        elif 'video' in output:
            Speak('playing ' + output)  ## PLAYING YOUTUBE VIDEO
            kit.playonyt(output)

        elif output in commonTalks.keys():  ## SOME COMMON TALKS
            print(commonTalks[output])
            Speak(commonTalks[output])

        elif output in Good.keys():  ## GOOD MORNING MESSAGES
            print(Good[output])
            Speak(Good[output])

        elif output[0:6] == "define":  ## WIKIPEDIA
            search_query = output[7:]
            try:
                data = wikipedia.summary(search_query, 1)
            except:
                data = "Too many word occurances. Try being more specific!!"
            print(data)
            Speak(data)

        elif "message now" in output:  ## INSTANT WHATSUP MSG
            phone = input("Enter phone number: ")
            message = input("Enter message ")
            try:
                kit.sendwhatmsg_instantly(f'+91{phone}', message, 10)
            except Exception:
                print("Sorry, Message not sent")
                Speak("Sorry, Message not sent")

        elif "message later" in output:  ## SENDING LATE MESSAGES
            phone = input("Enter phone number: ")
            message = input("Enter message ")
            hour = int(input("Enter which hour do you want to send msg "))
            minute = int(input("Enter which min you want to send msg"))
            try:
                kit.sendwhatmsg(f'+91{phone}', message, hour, minute, 30)
            except Exception:
                print("Sorry, Message not sent")
                Speak("Sorry, Message not sent")

        elif "hello" in output:  ## GREETINGS LIKE HELLO
            helo = random.choice(greetings)
            print(helo)
            Speak(helo)

        elif "music" in output:  ## PLAYING MUSIC
            try:
                Speak("Enter song name")
                audio()
                Speak("Playing")
            except Exception:
                print("Can't play music, try again")
                Speak("Can't play music, try again")

        else:
            if output != "":
                pass
                try:
                    print("Searching...", output)
                    Speak("Searching..")
                    kit.search(output)
                except Exception:
                    pass