示例#1
0
def timer(message, minutes):
    notificator = ToastNotifier()
    notificator.show_toast("Alarm",
                           f"Alarm will go off in {minutes} minutes..",
                           duration=50)
    time.sleep(minutes * 60)
    winsound.beep(frequency=2500, duration=1000)
    notificator.show_toast(f"alarm", message, duration=50)
def main():
    wt,e=ActualCall()
    print('\n\n')
    print('The best fitted function coefficients are: ',end='')
    print(*wt)
    print('With error :',e)
    beep(freq,dur)
    engine.say('Run was successful Error is'+str(e))
    engine.runAndWait()
    input()
示例#3
0
def process_beep(pm25, pm10):
    if args.quiet:
        return pm25, pm10
    if pm25 * 10 >= 30 or pm10 * 10 >= 60:
        for _ in range(3):
            beep(2500, 500)
    elif pm25 * 10 >= 20 or pm10 * 10 >= 50:
        for _ in range(3):
            beep(2500, 100)
    return pm25, pm10
示例#4
0
def main():
    wt, e = ActualCall()
    print('\n\n')
    print('The best fitted function coefficients are: ')
    for i in range(len(wt)):
        print('w[', i, '] : ', wt[i])
    print('With error :', e)
    beep(freq, dur)
    engine.say('Run was successful Error is' + str(e))
    engine.runAndWait()
    input()
示例#5
0
def sound(pitch, length):
    letter = pitch[0]
    height = int(pitch[1])
    note=(height-4)*12 + {'c':0,\
                          'd':2,\
                          'e':4,\
                          'f':5,\
                          'g':7,\
                          'a':9,\
                          'b':11}[letter]
    frequency = int(2**(note / 12) * 261.6255653005986)
    beep(frequency, length)
示例#6
0
def countdown(minutes, seconds, soundtoggle):
    m = minutes * 60
    s = seconds + m
    print("countdown set for {} minutes and {} seconds".format(
        minutes, seconds))
    while s != 0:
        time.sleep(1)
        s -= 1
    if soundtoggle == True:
        winsound.beep(1, 1000)
        print("COUNTDOWN COMPLETED")
    else:
        print("COUNTDOWN COMPLETED")
def init_test_section():
    beep(TEST_LOW_F, TEST_T)
    sleep(SHORT_T_SLEEP)
    beep(TEST_LOW_F, TEST_T)
    sleep(SHORT_T_SLEEP)
    beep(TEST_LOW_F, TEST_T)
    sleep(SHORT_T_SLEEP)
    beep(TEST_HIG_F, TEST_T)
def init_experiment_sound():
    beep(LOW_SOUND, STANDART_TIME)
    sleep(STANDART_SLEEP)
    beep(LOW_SOUND, STANDART_TIME)
    sleep(STANDART_SLEEP)
    beep(LOW_SOUND, STANDART_TIME)
    sleep(STANDART_SLEEP)
    beep(HIGH_SOUND, STANDART_TIME)
    sleep(STANDART_SLEEP)
示例#9
0
def init_experiment_sound():
    beep(LOW_SOUND, STANDART_TIME)
    sleep(STANDART_SLEEP)
    beep(LOW_SOUND, STANDART_TIME)
    sleep(STANDART_SLEEP)
    beep(LOW_SOUND, STANDART_TIME)
    sleep(STANDART_SLEEP)
    beep(HIGH_SOUND, STANDART_TIME)
    sleep(STANDART_SLEEP)
示例#10
0
def sounds(sndgrp):
    try:
    #Defines the soundset for the OS. Sound group 2 does not work under linux but instead silently passes through.
        workdir()
        if sndgrp == 0:
            playsound('Sounds/start.wav')
        elif sndgrp == 1:
            playsound('Sounds/shut.wav')
        elif sndgrp == 2:
            beep(800, 500), beep(1200, 500)
        elif sndgrp == 3:
            playsound('Sounds/logoff.wav')
        elif sndgrp == 4:
            playsound('Sounds/logon.wav')
        elif sndgrp == 5:
            playsound('Sounds/uac.wav')
        chdir(owd1)
    except KeyboardInterrupt:
        exit()
def end_test_section():
    beep(TEST_LOW_F, TEST_T)
    sleep(SHORT_T_SLEEP)
    beep(TEST_LOW_F, TEST_T)
    sleep(SHORT_T_SLEEP)
def play_sequence(ins):
    for element in ins:
        #Down Arrow
        winsound.beep(sounds[element],Dur)
示例#13
0
def end_experiment_section():
    beep(LOW_SOUND, STANDART_TIME)
示例#14
0
def init_experiment_section():
    beep(HIGH_SOUND, STANDART_TIME)
示例#15
0
import winsound
frequency = 2500
duration = 2000
winsound.beep(frequency, duration)
示例#16
0
                                    scr.refresh()
                                    scr.addstr(init_lin + lin, col, nw,
                                               curses.color_pair(4))
                                    scr.refresh()
                                    break

                            else:
                                mistake += 1
                                scr.addstr(
                                    init_lin + lin, col, nw,
                                    curses.color_pair(1) | curses.A_BOLD)
                                scr.addstr(
                                    4 + tot_lin, 0, user1,
                                    curses.color_pair(10) | curses.A_BOLD)
                                scr.refresh()
                                beep(5000, 1000)

                            sp = lu  #Storing the index of the character after the last space
                            #(starting index of next word in 'user')
                        scr.addstr(tot_lin + init_lin + 1, 0, user)
                else:
                    Quit = True
                    point = 1
                curses.curs_set(0)
                if not Quit:
                    t = time() - t1
                    no_word = 1
                    i = 0
                    while i < lp1:
                        if para[i] == ' ':
                            no_word += 1
示例#17
0
            if mm == 'pm':  # to convert pm to military time
                hrs += 12

            elif hrs == 12 and mm == 'am':  # to convert 12am to military time
                hrs -= 12

            else:
                pass

            while True:  # infinite loop starts to make the program running until time matches alarm time

                # ringing alarm + execution condition for alarm
                if hrs == datetime.datetime.now().hour and mint == datetime.datetime.now().minute:
                    print("\nIt's the time!")
                    winsound.beep(1000, 1000)
                    break

        elif "login to my instagram" in query:
            fhand = open('passwd.txt')  # store your password in txt file
            p = fhand.readlines()

            driver = webdriver.Chrome()
            driver.get('https://instagram.com')

            idbox = driver.find_element_by_xpath('//*[@id="loginForm"]/div/div[1]/div/label/input')
            idbox.send_keys('username')  # add your username here

            passbox = driver.find_element_by_xpath('//*[@id="loginForm"]/div/div[2]/div/label/input')
            idbox.send_keys(p[0])
def init_experiment_section():
    beep(HIGH_SOUND, STANDART_TIME)
示例#19
0
        print(str(a + a + a + a) + "M Extended RAM Passed",
              end='\r'), sleep(0.001)
else:
    for a in range(0, 257):
        print(str(a + a) + "M Extended RAM Passed", end='\r'), sleep(0.001)
    sleep(2)
    for a in range(0, 513):
        print(str(a) + "M Extended RAM Passed", end='\r'), sleep(0.001)
print(""), sleep(1)
print("Scanning IDE/SATA channels for devices...", end='\r'), sleep(2)
print("Fixed Disk 0: RotoWare SATA Virtual Hard Drive"), sleep(0.1)
print("ATAPI CD-ROM: RotoWare SATA Virtual DVD-RW Drive"), sleep(0.1)
print("Keyboard initialized")
print("Mouse initialized")
if not rd == 57:
    print("\nLoading modules...", end='\r'), sleep(1)
    print("Loading modules completed successfully.")
    print("\n\n\n\n\n\n\n")
else:
    print("\nLoading modules...", end='\r'), sleep(1)
    print("Loading modules completed successfully.")
    sleep(1)
    beep(800, 500)
    beep(800, 500)
    print("\nCMOS checksum error. Defaults loaded.")
    sleep(2)
    print("\n\n\n\n\n")
print("Press F2 to enter SETUP, F12 for Network Boot, ESC for Boot menu"
      ), sleep(1.5)
beep(800, 500)
示例#20
0
            stat = os.stat(source_folder)
        except OSError as e:
            print "Encountered a OSError, skipping file:"
            print e
            continue
        max_file = max(sorted(os.listdir(source_folder)))
        pdb.set_trace()
        if os.stat(os.path.normpath(source_folder + "/" +
                                    max_file)).st_mtime > last_time:
            ind = sorted_keyframes.index(max_file.split(".")[0][:-2] + ".jpg")
            if ind == len(sorted_keyframes):
                print "Yay, all done!"
            else:
                for i in range(1, 11):
                    new_f_name = sorted_keyframes[ind + i]
                    new_xml_f = os.path.normpath(source_folder + "/" +
                                                 new_f_name.split(".")[0] +
                                                 "_1.xml")
                    shutil.copyfile(
                        os.path.normpath(source_folder + "/" + max_file),
                        new_xml_f)
                    tree = ET.parse(new_xml_f)
                    root = tree.getroot()
                    for image in root.iter("image"):
                        image.text = new_f_name.split(".")[0]
                        image.set("updated", "yes")
                    tree.write(new_xml_f)
                    last_time = os.stat(new_xml_f).st_mtime
                    print "Frame %i pose copied" % (int + i)
                winsound.beep(300, 500)
示例#21
0
        break  #This will terminate the programe on user input
    else:
        punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
        for i in user_input:
            if i in punctuation:
                modified_user_input = modified_user_input.replace(
                    i, ''
                )  #removing punctuation from user_input and storing it in modified_user_input
        a = modified_user_input.replace(' ',
                                        '')  #modified_user_input with no space
        if a.isalpha():  #checking for alphabet only
            b = a.lower()  #lowering the case to match
            if b == b[::-1]:
                print('\t\033[32m"' + user_input + '"',
                      'is Pallindrome.\033[1;37;40m')
                beep(4000, 300)
                lop.append(user_input)
            else:
                print('\t\033[31m"' + user_input + '"',
                      'is not Pallindrome.\033[1;37;40m')
                beep(1000, 500)
        elif user_input == '':  #code for no input and pressed enter key
            print(
                '\n\t\033[33m"Kuch nahi ko kisi bhi tarah\n\t kuch nahi padha jaa sakta hai"\n \033[36m',
                ' \t-Ajay Kisku\033[1;37;40m'.rjust(46))

        elif a == a[::-1]:  #This will check digits and Hindi letters
            print('\t\033[32m"' + user_input + '"',
                  'is Pallindrome.\033[1;37;40m')
            beep(4000, 300)
            lop.append(user_input)
示例#22
0
            for i, data in enumerate(data):
                writer.writerow(data)

# public companies from VCs I respect (Sutter Hill, Accel, Sequoia, A16Z, etc.)
tickerList = ['pstg', 'infn', 'pacb-2', 'vbay', 'xlrn-2', 'ptla-2', 'rkus',
              'hznp', 'yoku', 'sq', 'run', 'pypl', 'hubs','jmei', 'nmbl',
              'cuda', 'rng', 'feye-2', 'trla', 'twtr', 'baba-4', 'hdp',
              'newr', 'zen', 'grub', 'wix', 'fnjn', 'mrin', 'amba-2',
              'pfpt', 'yelp', 'amzn', 'z', 'zip', 'ondk', 'bv', 'ntra', 'fb',
              'team', 'etsy', 'opwr', 'vrns-2', 'yume', 'rvbd', 'tsla',
              'modn', 'nflx', 'goog', 'msft', 'nvda', 'gddy', 'adbe', 'crm',
              'gimo', 'elnk', 'gib', 'dox', 'infy', 'acn', 'hckt',
              'caci', 'ctsh', 'mant', 'wit', 'tsri', 'elli', 'akam', 'vrnt',
              'ftnt', 'opwv', 'sncr', 'panw', 'vdsi', 'avgo', 'cvg', 'gpn',
              'gsb', 'jcom', 'jkhy', 'lrcx', 'ma', 'ntes', 'payx', 'tss',
              'txn', 'v', 'googl', 'anet', 'aten', 'fuel-3', 'ubnt', 'frf',
              'flt-2', 'bsft', 'lnkd', 'aapl', 'eqix', 'ebix', 'qlik',
              'athn', 'ebay', 'adbe', 'wday', 'hpq', 'n', 'orcl', 'ilmn']

# places wife and I are okay with living
statesList = ['CA', 'MA', 'CT', 'NY', 'IL', 'TX']

# % holding collar (min, max)
holdingPercentages = (1.5, 70)
minAUM = 400

x = FundHunt(tickerList)
y = x.getInfo(holdingPercentages, statesList, minAUM)
x.exportToCSV(y)
winsound.beep(500, 2)
示例#23
0
def LinearRegressor(data,
                    target,
                    wtlen,
                    d,
                    maxe,
                    it=1e7,
                    lookup=1,
                    interval=1000,
                    load=0,
                    speed=0,
                    signChangeStop=1,
                    writeToAnyFile=1,
                    acc=1.01,
                    slowIndicator=0.99):
    w = [0] * wtlen
    flag = 0
    e = 1e+100
    first = 0
    second = 0
    backup = 1e+101
    if load:
        f = open('parameters.txt', 'r')
        w = f.readline().split()
        w = [float(n) for n in w]
        f.close()

    i = 0
    i = int(i)
    while i < it and abs(e) > maxe:
        if int(i) % interval == 0 and int(i) != 0 and writeToAnyFile:
            f = open('parameters.txt', 'w')
            for j in w:
                f.write(str(j) + ' ')
            f.write('\n' + 'Error=' + str(e) + ' and ' +
                    'Damping Coefficient=' + str(d) + ' at iteration=' +
                    str(i) + '\n')
            f.close()
            if abs(e) < abs(backup):
                g = open('backup.txt', 'w')
                for j in w:
                    g.write(str(j) + ' ')
                g.write('\n' + 'Error=' + str(e) + ' and ' +
                        'Damping Coefficient=' + str(d) + ' at iteration=' +
                        str(i) + '\n')
                backup = float(abs(e))
                g.close()
            if signChangeStop:
                if second and signCheck(prevE, e) == 0:
                    g = open('parameters.txt', 'w')
                    for j in prevW:
                        g.write(str(j) + ' ')
                    g.write('\n' + 'Error=' + str(prevE) + ' and ' +
                            'Damping Coefficient=' + str(prevD) +
                            ' at iteration=' + str(i) + '\n')
                    g.close()
                    g = open('signChangeSnapshot.txt', 'w')
                    for j in prevW:
                        g.write(str(j) + ' ')
                    g.write('\n' + 'Error=' + str(prevE) + ' and ' +
                            'Damping Coefficient=' + str(prevD) +
                            ' at iteration=' + str(i) + '\n')
                    g.close()
                    d = prevD
                    w = [i for i in prevW]
                    acc = int(acc) + (acc - int(acc)) / 10
                    beep(freq, dur)
                    print(
                        'Error sign changed! Snapshot saved to snapshot file.Go check it out!'
                    )

                second = 1
                prevE = float(e)
                prevD = float(d)
                prevW = [i for i in w]

        if int(i) % interval == 0 and int(i) != 0:
            print('Error=', e, ' and d=', d)
            if speed:
                if first:
                    d = speedify(d, e, pe, acc, slowIndicator)
                first = 1
                pe = float(e)

        e = 0
        j = 0
        while j < len(data):
            x = []
            for xv in range(wtlen):
                if xv != target and target >= 0:
                    x.append(data[j][xv])
                elif target < 0 and xv != wtlen + target:
                    x.append(data[j][xv])

            y = data[j][target]
            pred = custom(x, w)
            e = e + (y - pred)
            k = 0
            while k < len(w):
                w[k] = w[k] + direction(y, x, lookup, d, w, k) * d * (
                    y - pred) * par_deriv(y, x, w, k, lookup, d)
                k = k + 1

            j = j + 1

        i = i + 1

    g = open('backup.txt', 'w')
    for j in w:
        g.write(str(j) + ' ')
    g.write('\n' + 'Error=' + str(e) + ' and ' + 'Damping Coefficient=' +
            str(d) + ' at iteration=' + str(i) + '\n')
    g.close()
    data = 0
    d = 0
    return w, e
def LinearRegressor(data,d,maxe,it=1e7,lookup=1,interval=1000,load=0,speed=0,signChangeStop=1,writeToAnyFile=1,acc=1.01,slowIndicator=0.99):
    w=[0.01]*weights
    mvp=0
    flag=0
    e=1e+100
    first=0
    second=0
    backup=1e+101
    if load:
        f=open('parameters.txt','r')
        w=f.readline().split()
        w=[float(n) for n in w]
        f.close()
    
    i=0
    i=int(i)
    while i<it and abs(e)>maxe:
                
        if int(i)%interval==0 and int(i)!=0 and writeToAnyFile:
            f=open('parameters.txt','w')
            for j in w:
                f.write(str(j)+' ')
            f.write('\n'+'Error='+str(e)+' and '+'Damping Coefficient='+str(d)+' at iteration='+str(i)+'\n')
            f.close()
            if abs(e)<abs(backup):
                g=open('backup.txt','w')
                for j in w:
                    g.write(str(j)+' ')
                g.write('\n'+'Error='+str(e)+' and '+'Damping Coefficient='+str(d)+' at iteration='+str(i)+'\n')
                backup=float(abs(e))
                g.close()
            if signChangeStop:
                if second and signCheck(prevE,e)==0:
                    g=open('parameters.txt','w')
                    for j in prevW:
                        g.write(str(j)+' ')
                    g.write('\n'+'Error='+str(prevE)+' and '+'Damping Coefficient='+str(d)+' at iteration='+str(i)+'\n')
                    g.close()
                    g=open('signChangeSnapshot.txt','w')
                    for j in prevW:
                        g.write(str(j)+' ')
                    g.write('\n'+'Error='+str(prevE)+' and '+'Damping Coefficient='+str(d)+' at iteration='+str(i)+'\n')
                    g.close()
                    print('Error sign changed! Snapshot saved to file.Go check it out!')
                    beep(freq,dur)
                    engine.say('Error sign changed Snapshot saved to file.')
                    engine.runAndWait()
                    input()
                    exit()
                second=1
                prevE=float(e)
                prevW=[i for i in w]
                
        if int(i)%interval==0 and int(i)!=0:
            print('Error=',e,' and d=',d)
            if speed:
                if first:
                    d=speedify(d,e,pe,acc,slowIndicator)
                first=1
                pe=float(e)
            
            
            
        
            
            
            
            
        
        e=0
        j=0
        while j<len(data):
            x=data[j][mvp]
            y=data[j][-1]
            pred=custom(x,w)
            e=e+(y-pred)
            k=0
            while k<len(w):
                w[k]=w[k]+direction(y,x,lookup,d,w,k)*d*(y-pred)*par_deriv(y,x,w,k,lookup,d)
                k=k+1
                
            j=j+1
            
        i=i+1
        
    g=open('backup.txt','w')
    for j in w:
        g.write(str(j)+' ')
    g.write('\n'+'Error='+str(e)+' and '+'Damping Coefficient='+str(d)+' at iteration='+str(i)+'\n')
    g.close()
    return w,e
def end_generate_intention():
    beep(CAPTURE_F_END, CAPTURE_T_SOUND)
def end_experiment_section():
    beep(LOW_SOUND, STANDART_TIME)
def init_generate_intention():
    beep(CAPTURE_F_INI, CAPTURE_T_SOUND)
示例#28
0
文件: tuner.py 项目: hp685/GTuner
def playsound(frequency, duration=10000):
    if(sys.platform.startswith('win')):
        winsound.beep(frequency, duration)
    elif(os.name == "posix"):
        os.system('beep -f %s -l %s' % (frequency, duration))
def play_sequence(ins):
    for element in ins:
        #Down Arrow
        winsound.beep(sounds[element], Dur)
示例#30
0
def inBeep():
    winsound.beep(400, 100)
def init_end_experiment_sound():
    beep(EXPERIMENT_F_INIT_END, EXPERIMENT_T_INIT_END)
    sleep(MEDIUM_T_SLEEP)