Пример #1
0
def start1():
    os.system("cls")
    print("\n\n\n\t\t         @@@@@@@   @@@  @@@    @@@@@@    @@@@@@@             @@@  @@@   @@@@@@@")
    print("\t\t        @@@@@@@@   @@@  @@@   @@@@@@@@   @@@@@@@             @@@  @@@   @@@@@@@@")
    print("\t\t        !@@        @@!  @@@   @@!  @@@     @@!               @@!  @@@   @@!  @@@")
    print("\t\t        !@!        !@!  @!@   !@!  @!@     !@!               !@!  @!@   !@!  @!@")
    print("\t\t        !@!        @!@!@!@!   @!@!@!@!     @!!    @!@!@!@!@  @!@  !@!   @!@  !@!")
    print("\t\t        !!!        !!!@!!!!   !!!@!!!!     !!!    !!!@!@!!!  !@!  !!!   !@!  !!!")
    print("\t\t        :!!        !!:  !!!   !!:  !!!     !!:               :!:  !!:   !!:  !!!")
    print("\t\t        :!:        :!:  !:!   :!:  !:!     :!:                ::!!:!    :!:  !:!")
    print("\t\t         ::: :::   ::   :::   ::   :::      ::                 ::::      :::: ::")
    print("\t\t         :: :: :    :   : :    :   : :      :                   :       :: :  :\n\n\n")
    print("=="*60,end="")
    user = input('''\n
                     _   _ ___ ___ ___ _  _   _   __  __ ___ _
                    | | | / __| __| _ \ \| | /_\ |  \/  | __(_)
                    | |_| \__ \ _||   / .` |/ _ \| |\/| | _| _
                     \___/|___/___|_|_\_|\_/_/ \_\_|  |_|___(_)    ''')
    passwd = getpass.getpass('''
                     ___  _   ___ _____      _____  ___ ___ _
                    | _ \/_\ / __/ __\ \    / / _ \| _ \   (_)
                    |  _/ _ \\\__ \__ \\\ \/\/ / (_) |   / |) |
                    |_|/_/ \_\___/___/ \_/\_/ \___/|_|_\___(_)     ''')
    
    
    main.loading()
    if user == "milind" and passwd == "1234":
        main.happy()
        pyttsx3.speak("you are SUCCESSFULLY LOGIN")
        next1("color 17")
        pyttsx3.speak("hey harry , WELCOME TO THE menu section")
        command.commands()
    else:
        main.sad()
        pyttsx3.speak("incorrect details, please try again")
Пример #2
0
def games():
    os.system("color 30")
    print('''
                                              ___   _   __  __ ___ ___
                                            / __| /_\ |  \/  | __/ __|
                                           | (_ |/ _ \| |\/| | _|\__ \\\

                                            \___/_/ \_\_|  |_|___|___/''')
    print("==" * 60, end="")
    pyttsx3.speak("hey harry . WELCOME TO THE GAMES MENU")

    while True:
        os.system("color 30")
        os.system("cls")
        print('''
     ==============================================================================================================
    |    [1]    NFS RIVALS                                                                                         |
    |==============================================================================================================|
    |    [2]    NFS MOST WANTED 2                                                                                  |
    |==============================================================================================================|
    |    [3]    NFS THE RUN                                                                                        |
    |==============================================================================================================|
    |    [4]    BACK                                                                                               |
     ==============================================================================================================  
                   ''')

        print("==" * 60, end="")
        pyttsx3.speak("HERE ARE SOME OF THE games")
        time.sleep(1)
        pyttsx3.speak("harry , WHICH game you want to play")
        a = input("TELL ME SOMETHING: ")

        if (("open" in a) or ("start" in a) or ("play" in a)):
            pyttsx3.speak("WELCOME TO NFS RIVALS")
            os.chdir(
                "C:/Program Files (x86)/EA Games/Need for Speed(TM) Rivals/")
            os.system("NFS14.exe")

        elif (("open" in a) or ("start" in a) or ("play" in a)):
            pyttsx3.speak("WELCOME TO NFS MOST WANTED 2")
            os.chdir(
                "C:/Program Files (x86)/EA Games/Need for Speed(TM) Rivals/")
            os.system("NFS14.exe")

        elif (("open" in a) or ("start" in a) or ("play" in a)):
            pyttsx3.speak("WELCOME TO NFS THE RUN")
            os.chdir(
                "C:/Program Files (x86)/EA Games/Need for Speed(TM) Rivals/")
            os.system("NFS14.exe")

        elif (("previous" in a) or ("return" in a) or ("back" in a)):
            os.system("cls")
            command.commands()
        else:
            print('''
                               
                                    M""MMM""MMM""M
                                    M  MMM  MMM  M
                                    M  MMP  MMP  M 88d888b. .d8888b. 88d888b. .d8888b.
                                    M  MM'  MM' .M 88'  `88 88'  `88 88'  `88 88'  `88
                                    M  `' . '' .MM 88       88.  .88 88    88 88.  .88
                                    M    .d  .dMMM dP       `88888P' dP    dP `8888P88
                                    MMMMMMMMMMMMMM                                 .88
                                                                            d8888P
                                    MP""""""`MM                                     dP
                                    M  mmmmm..M                                     88
                                    M.      `YM .d8888b. .d8888b. 88d888b. .d8888b. 88d888b.
                                    MMMMMMM.  M 88ooood8 88'  `88 88'  `88 88'  `"" 88'  `88
                                    M. .MMM'  M 88.  ... 88.  .88 88       88.  ... 88    88
                                    Mb.     .dM `88888P' `88888P8 dP       `88888P' dP    dP
                                    MMMMMMMMMMM

                        ''')
            pyttsx3.speak("YOU HAVE SEARCHED SOMETHING IRRELEVANT")
Пример #3
0
			return "error" 
			
	try :
		print("You said\t  "+request)
	except sr.UnknownValueError:
		print("can u please repeat")
		request=None
	except sr.RequestError:
		print("Check Internet Connectivity, and Try Again...")
	
	return request.lower()
request=input()

#creating object of oopscommands class  and initalizing the command string to
#class commands
c=oo.commands(request)
response=c.command() #running the command for the void command by object calling to function



#for continous working of voice take input and working on commands untill user says quit
while response != "quit" :
        request=input()
        c=oo.commands(request)
        response=c.command()
        time.sleep(0.8)

print("exit")


Пример #4
0
def searching():
    os.system("color f5")
    print("==" * 60, end="")
    print(
        '''                                     ___                  _      __  __
                                    / __| ___ __ _ _ _ __| |_   |  \/  |___ _ _ _  _
                                    \__ \/ -_) _` | '_/ _| ' \  | |\/| / -_) ' \ || |
                                    |___/\___\__,_|_| \__|_||_| |_|  |_\___|_||_\_,_|
    ''')
    print("==" * 60, end="")
    pyttsx3.speak("hey harry . WELCOME TO THE search MENU")
    time.sleep(1)
    pyttsx3.speak(
        "i have some of the searching borwsers, so which one you want to use")
    while True:
        os.system("color f5")
        os.system("cls")
        print('''
     ==============================================================================================================
    |    [1]    SEARCH WITH GOOGLE                                                                                 |
    |==============================================================================================================|
    |    [2]    SEARCH WITH FIREFOX                                                                                |
    |==============================================================================================================|
    |    [3]    SEARCH WITH MICROSOFT EDGE                                                                         |
    |==============================================================================================================|
    |    [4]    BACK                                                                                               |
     ==============================================================================================================  
                   ''')
        print("==" * 60, end="")
        time.sleep(1)
        a = input("YOUR SEARCHING BROWSER: ")
        if ("chrome" in a):
            pyttsx3.speak("WHAT YOU WANT TO SEARCH")
            a = input("TELL SOMETHING: ")
            chrome_path = r'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe %s'
            for url in search(a, tld="com", num=1, stop=1, pause=2):
                webbrowser.open("https://google.com/search?q=%s" % a)

        elif (("previous" in a) or ("return" in a) or ("back" in a)):
            os.system("cls")
            command.commands()
        else:
            print('''
                                
                                M""MMM""MMM""M
                                M  MMM  MMM  M
                                M  MMP  MMP  M 88d888b. .d8888b. 88d888b. .d8888b.
                                M  MM'  MM' .M 88'  `88 88'  `88 88'  `88 88'  `88
                                M  `' . '' .MM 88       88.  .88 88    88 88.  .88
                                M    .d  .dMMM dP       `88888P' dP    dP `8888P88
                                MMMMMMMMMMMMMM                                 .88
                                                                        d8888P
                                MP""""""`MM                                     dP
                                M  mmmmm..M                                     88
                                M.      `YM .d8888b. .d8888b. 88d888b. .d8888b. 88d888b.
                                MMMMMMM.  M 88ooood8 88'  `88 88'  `88 88'  `"" 88'  `88
                                M. .MMM'  M 88.  ... 88.  .88 88       88.  ... 88    88
                                Mb.     .dM `88888P' `88888P8 dP       `88888P' dP    dP
                                MMMMMMMMMMM

                        ''')
            pyttsx3.speak("YOU HAVE SEARCHED SOMETHING IRRELEVANT")

        if (("firefox" in a) or ("mozilla" in a)):
            pyttsx3.speak("WHAT YOU WANT TO SEARCH")
            a = input("TELL SOMETHING: ")
            if ((("open" in a) or ("search" in a)) and ("redhat" in a)):
                os.system("firefox www.redhat.com")
            elif ((("open" in a) or ("search" in a)) and ("yahoo" in a)):
                os.system("firefox www.yahoo.com")
            elif ((("open" in a) or ("play" in a)) and ("song" in a)):
                os.system(
                    "firefox https://www.youtube.com/watch?v=uEJuoEs1UxY")
            elif (("previous" in a) or ("return" in a) or ("back" in a)):
                os.system("cls")
                command.commands()
            else:
                print('''
                            
                                M""MMM""MMM""M
                                M  MMM  MMM  M
                                M  MMP  MMP  M 88d888b. .d8888b. 88d888b. .d8888b.
                                M  MM'  MM' .M 88'  `88 88'  `88 88'  `88 88'  `88
                                M  `' . '' .MM 88       88.  .88 88    88 88.  .88
                                M    .d  .dMMM dP       `88888P' dP    dP `8888P88
                                MMMMMMMMMMMMMM                                 .88
                                                                        d8888P
                                MP""""""`MM                                     dP
                                M  mmmmm..M                                     88
                                M.      `YM .d8888b. .d8888b. 88d888b. .d8888b. 88d888b.
                                MMMMMMM.  M 88ooood8 88'  `88 88'  `88 88'  `"" 88'  `88
                                M. .MMM'  M 88.  ... 88.  .88 88       88.  ... 88    88
                                Mb.     .dM `88888P' `88888P8 dP       `88888P' dP    dP
                                MMMMMMMMMMM

                        ''')
                pyttsx3.speak("YOU HAVE SEARCHED SOMETHING IRRELEVANT")

        if (("edge" in a) or ("msedge" in a)):
            pyttsx3.speak("WHAT YOU WANT TO SEARCH")
            a = input("TELL SOMETHING: ")
            if ((("open" in a) or ("search" in a)) and ("redhat" in a)):
                os.system("msedge www.redhat.com")
            elif ((("open" in a) or ("search" in a)) and ("yahoo" in a)):
                os.system("msedge www.yahoo.com")
            elif ((("open" in a) or ("play" in a)) or ("song" in a)
                  or ("songs" in a)):
                os.system("msedge https://www.youtube.com/watch?v=uEJuoEs1UxY")
            elif (("previous" in a) or ("return" in a) or ("back" in a)):
                os.system("cls")
                command.commands()
            else:
                print('''
                              
                                M""MMM""MMM""M
                                M  MMM  MMM  M
                                M  MMP  MMP  M 88d888b. .d8888b. 88d888b. .d8888b.
                                M  MM'  MM' .M 88'  `88 88'  `88 88'  `88 88'  `88
                                M  `' . '' .MM 88       88.  .88 88    88 88.  .88
                                M    .d  .dMMM dP       `88888P' dP    dP `8888P88
                                MMMMMMMMMMMMMM                                 .88
                                                                        d8888P
                                MP""""""`MM                                     dP
                                M  mmmmm..M                                     88
                                M.      `YM .d8888b. .d8888b. 88d888b. .d8888b. 88d888b.
                                MMMMMMM.  M 88ooood8 88'  `88 88'  `88 88'  `"" 88'  `88
                                M. .MMM'  M 88.  ... 88.  .88 88       88.  ... 88    88
                                Mb.     .dM `88888P' `88888P8 dP       `88888P' dP    dP
                                MMMMMMMMMMM
                        ''')
                pyttsx3.speak("YOU HAVE SEARCHED SOMETHING IRRELEVANT")
Пример #5
0
from command import commands
############## finding path of csv #############
chpw_path = path("ch_pw")
createuser_path = path("create_user")
deleteuser_path = path("delete_user")
deletegroup_path = path("delete_group")
################## changing password of perticular users from csv ############
with open(chpw_path.getPath()) as csvfile:
    readCSV = csv.DictReader(
        csvfile)  ################## changing rows of csv in dictionary
    for row in readCSV:
        u_name = row["Username"]
        u_pw = row["Password"]
        n_pw = row["NewPassword"]
        fqdn = row["Hostname"] + "." + row["domain"] + ".com"
        obj1 = commands(fqdn, u_name,
                        u_pw)  ##### creating connection #########
        obj1.changePassword(n_pw,
                            u_pw)  ####### change password command execution
################## creating new users from csv ############
with open(createuser_path.getPath()) as csvfile:
    readCSV = csv.DictReader(csvfile)
    for row in readCSV:
        u_name = row["user_Username"]
        u_pw = row["user_Password"]
        administrator = row[
            "Admin_Username"]  #### require admin username and password
        administrator_pw = row["Admin_Password"]
        fqdn = row["Hostname"] + "." + row["domain"] + ".com"
        obj1 = commands(fqdn, administrator, administrator_pw)
        obj1.createUser(u_name, u_pw)
################## deleting users from csv ############
Пример #6
0
        return imp.load_module(name, file, path_name, description)
    finally:
        if file:
            file.close()


def main_loop(cmd):
    # connect to irc channel
    IRC = irc.connect(cmd)

    LOG = plugin(cmd.plugin, os.path.dirname(cmd.path))
    DB_path = os.path.join(os.path.dirname(cmd.path), "db." + cmd.plugin)

    LOG.connect_DB(DB_path)

    irc.loop(IRC, LOG, DB_path, cmd)


if __name__ == "__main__":
    cmd = command.commands()
    cmd.path = os.path.abspath(sys.argv[0])

    if not cmd.deactivateDeamon:
        # http://www.python.org/dev/peps/pep-3143/
        with daemon.DaemonContext():
            print "main as deamon"
            main_loop(cmd)
    else:
        print "main"
        main_loop(cmd)
Пример #7
0
def editors():
    os.system("color 95")    
    print('''                                     ___ ___ ___ _____ ___  ___  ___
                                    | __|   \_ _|_   _/ _ \| _ \/ __|
                                    | _|| |) | |  | || (_) |   /\__ \\\

                                    |___|___/___| |_| \___/|_|_\|___/
    ''')
    print("=="*60 , end="")
    pyttsx3.speak("hey harry . WELCOME TO THE EDITORS MENU")
    time.sleep(1)
    pyttsx3.speak("HERE ARE SOME OF THE editors")
    while True:
        os.system("color 95")
        os.system("cls")
        print('''
     ==============================================================================================================
    |    [1]    NOTEPAD                                                                                            |
    |==============================================================================================================|
    |    [2]    NOTEPAD++                                                                                          |
    |==============================================================================================================|
    |    [3]    WORDPAD                                                                                            |
    |==============================================================================================================|
    |    [4]    BACK                                                                                               |
     ==============================================================================================================  
                   ''')
    
        print("=="*60 , end="")   
        pyttsx3.speak("WHICH EDITOR SHOULD I OPEN")
        a = input("TELL ME SOMETHING: ")

        if ((("open" in a) or ("start" in a)) and (("notepad" in a) and ("++" not in a))):
            pyttsx3.speak("NOTEPAD SUCCESSFULLY OPENED")
            os.system("notepad")      
        elif ((("open" in a) or ("start" in a)) and (("notepad" in a) and ("++" in a))):
            pyttsx3.speak("NOTEPAD PLUS PLUS SUCCESSFULLY OPENED")
            os.system("notepad++")
        elif ((("open" in a) or ("start" in a)) and ("wordpad" in a)):
            pyttsx3.speak("WORDPRESS SUCCESSFULLY OPENED")
            os.system("wordpad")
            
        elif(("previous" in a) or ("return" in a) or ("back" in a)):
            os.system("cls")
            command.commands()
        else:
            print('''
                                   
                                M""MMM""MMM""M
                                M  MMM  MMM  M
                                M  MMP  MMP  M 88d888b. .d8888b. 88d888b. .d8888b.
                                M  MM'  MM' .M 88'  `88 88'  `88 88'  `88 88'  `88
                                M  `' . '' .MM 88       88.  .88 88    88 88.  .88
                                M    .d  .dMMM dP       `88888P' dP    dP `8888P88
                                MMMMMMMMMMMMMM                                 .88
                                                                        d8888P
                                MP""""""`MM                                     dP
                                M  mmmmm..M                                     88
                                M.      `YM .d8888b. .d8888b. 88d888b. .d8888b. 88d888b.
                                MMMMMMM.  M 88ooood8 88'  `88 88'  `88 88'  `"" 88'  `88
                                M. .MMM'  M 88.  ... 88.  .88 88       88.  ... 88    88
                                Mb.     .dM `88888P' `88888P8 dP       `88888P' dP    dP
                                MMMMMMMMMMM

                        ''')
            pyttsx3.speak("YOU HAVE SEARCHED SOMETHING IRRELEVANT")
            
Пример #8
0
def browsers():
    os.system("color cb")
    print(
        '''                                     ___ ___  _____      _____ ___ ___  ___
                                    | _ ) _ \/ _ \ \    / / __| __| _ \/ __|
                                    | _ \   / (_) \ \/\/ /\__ \ _||   /\__ \\\
                                    
                                    |___/_|_\\\___/ \_/\_/ |___/___|_|_\|___/
                                    ''')
    print("==" * 60, end="")
    pyttsx3.speak("hey harry . WELCOME TO THE BROWSERS MENU")
    time.sleep(1)
    pyttsx3.speak("HERE ARE SOME OF THE BROWSERS")
    while True:
        os.system("color cb")
        os.system("cls")
        print('''
     ==============================================================================================================
    |    [1]    GOOGLE CHROME                                                                                      |
    |==============================================================================================================|
    |    [2]    MOZILLA FIREFOX                                                                                    |
    |==============================================================================================================|
    |    [3]    MICROSOFT EDGE                                                                                     |
    |==============================================================================================================|
    |    [4]    BACK                                                                                               |
     ==============================================================================================================  
                   ''')

        print("==" * 60, end="")
        pyttsx3.speak("WHICH BROWSER SHOULD I OPEN")
        a = input("TELL ME SOMETHING: ")

        if ((("open" in a) or ("start" in a)) and ("chrome" in a)):
            pyttsx3.speak("CHROME SUCCESSFULLY OPENED")
            os.system("chrome")

        elif ((("open" in a) or ("start" in a)) and ("firefox" in a)):
            pyttsx3.speak("FIREFOX SUCCESSFULLY OPENED")
            os.system("firefox")
            time.sleep(1)

        elif ((("open" in a) or ("start" in a))
              and (("edge" in a) or ("msedge" in a))):
            pyttsx3.speak("MICROSOFT EDGE SUCCESSFULLY OPENED")
            os.system("msedge")
        elif (("previous" in a) or ("return" in a) or ("back" in a)):
            os.system("cls")
            command.commands()
        else:
            print('''
                                                                    
                                    M""MMM""MMM""M
                                    M  MMM  MMM  M
                                    M  MMP  MMP  M 88d888b. .d8888b. 88d888b. .d8888b.
                                    M  MM'  MM' .M 88'  `88 88'  `88 88'  `88 88'  `88
                                    M  `' . '' .MM 88       88.  .88 88    88 88.  .88
                                    M    .d  .dMMM dP       `88888P' dP    dP `8888P88
                                    MMMMMMMMMMMMMM                                 .88
                                                                            d8888P
                                    MP""""""`MM                                     dP
                                    M  mmmmm..M                                     88
                                    M.      `YM .d8888b. .d8888b. 88d888b. .d8888b. 88d888b.
                                    MMMMMMM.  M 88ooood8 88'  `88 88'  `88 88'  `"" 88'  `88
                                    M. .MMM'  M 88.  ... 88.  .88 88       88.  ... 88    88
                                    Mb.     .dM `88888P' `88888P8 dP       `88888P' dP    dP
                                    MMMMMMMMMMM

                        ''')
            pyttsx3.speak("YOU HAVE SEARCHED SOMETHING IRRELEVANT")
Пример #9
0
        increments = increments.split()
print "increment: ", increments
coordinate_display = inifile.find("DISPLAY", "POSITION_UNITS")
lu = units(inifile.find("TRAJ", "LINEAR_UNITS"))
print "lu: ", lu == 1/25.4
# update_ms 更新时间
update_ms = int(1000 * float(inifile.find("DISPLAY","CYCLE_TIME") or 0.020))
#建立根窗口
app = QApplication(sys.argv)
root_window = RootWindow()

#命令通道
c = linuxcnc.command()
s = linuxcnc.stat()
e = linuxcnc.error_channel()
cmds = command.commands(c, s, e)
#-------下列代码用于加载 Post HAL file  ,和post cmd .目前先不使用
#hp = os.path.expanduser("~/");
#postgui_halfile = inifile.find("HAL", "POSTGUI_HALFILE")
#post_cmd = "halcmd -f " + post_hal_file
#ret = os.system(post_cmd)
#if ret != 0:   #加载异常则打印异常信息并退出
#   print post_hal_file + " load error, exit ...!"
#   exit()
#s.poll()

#-------暂时不知用处。。。源自axis.py
s.poll()
print "s.axes: ",s.axes
statfail=0
statwait=.01