def buscar_campo_id():
    msg = ''
    pyautogui.PAUSE = 0.5
    pyautogui.FAILSAFE = False
    pyperclip.copy('')
    
    dondeEstaElCampoID = pyautogui.locateOnScreen('operator-id-field.png')
    if dondeEstaElCampoID is None:
        msg = 'El campo de OPERATOR-ID no fue encontrado'
        return (False, msg)
        
    else:
        campoIDPos = list(dondeEstaElCampoID)
        #print campoIDPos
         
    centrocampoID = pyautogui.center(campoIDPos)     
    #print centrocampoID
    pyautogui.moveTo(centrocampoID)
    pyautogui.click(None,None,2)
    pyautogui.typewrite('operador1')
    pyautogui.press('enter')
    pyautogui.press('enter')
    pyautogui.press('enter')
    
    
    
    return (True, msg)
Example #2
0
def main():
    """Main program."""
    answer = 0

    # The last number in the sequence of numbers that
    # aren't the sum of two abundant numbers is 20161
    # See A048242 at oeis.org
    limit = 20162
    # get necessary abundant numbers ... up to 20161
    abundant_numbers = get_abundant_numbers(limit)

    # start = time.time()
    # answer = check_all_combinations(abundant_numbers, limit)
    # end = time.time()
    # print("The sum of the numbers that aren't the " \
          # + "sum of two abundant numbers is %d" % answer)
    # elapsed = end - start
    # print("Combinatorics: %d seconds elapsed." % elapsed)

    start = time.time()
    answer = short_circuited_iteration(abundant_numbers, limit)
    end = time.time()
    print("The sum of the numbers that aren't the " \
          + "sum of two abundant numbers is %d" % answer)
    elapsed = end - start
    print("Short-circuit iteration: %d seconds elapsed." % elapsed)

    import pyperclip
    pyperclip.copy(str(answer))
    print("The answer has been placed in the clipboard.")
def passwordLookup(pw_file, acct):
  if acct in pw_file.keys():
    pyperclip.copy(pw_file[acct])
    print('Successful copy of ' + acct + ' password to clipboard.')
  else:
    print('Sorry, but there is no account called \"' + acct + '\".  Please run the program again with an account that I have a password for.')
    sys.exit()
Example #4
0
File: Cli.py Project: pfaivre/mdp
    def get_password(self, pattern=None):
        """ Helps the user to get a password
        :param pattern: Filter
        """
        passwords = self._load_pass_file()

        if pattern is None:
            pattern = input(_("Any specific domain or login?"
                              "(leave blank if not) > "))

        match_passwords = passwords.filter(pattern)

        if len(match_passwords) <= 0:
            print(_("No account for theses filters."))
            return

        # Printing matching accounts
        for i, p in enumerate(match_passwords):
            print("    {yellow}{num}. {normal}{password}"
                  .format(yellow=Fore.YELLOW, num=i+1,
                          normal=Fore.RESET, password=p))

        # Selecting which one to get
        number = -1 if len(match_passwords) > 1 else 1
        while number < 1 or number > len(match_passwords):
            try:
                number = int(input(_("Which one? > ")))
            except ValueError:
                number = -1

        # Put the password into the clipboard
        pwd = match_passwords[number-1].password
        pyperclip.copy(pwd)
        print(_("The password have been copied in the clipboard."))
Example #5
0
def main():
    parser = argparse.ArgumentParser(description='Generate secure, unique passwords based on a master password.')

    parser.add_argument('-c', '--confirm', dest='confirm', default=False, action='store_true',
        help='Require a confirmation of the master password.')

    parser.add_argument('-n', '--len', dest='n', default=24, type=int,
        help='The length of the password to generate. Defaults to 24, maximum 44')

    args = parser.parse_args()

    if args.n > 44:
        print 'Sorry, passwords with a length greater than 32 are not currently supported.'
        sys.exit(1)

    user_id = raw_input('account id: ')
    master_pw = getpass.getpass('password: '******'confirm: ')
        if confirm_pw != master_pw:
            print 'Confirm failed.'
            sys.exit(1)

    pw = gen_password(master_pw, user_id, args.n)

    pyperclip.copy(pw)
    print 'Password copied to clipboard'

    time.sleep(10)

    pyperclip.copy('[cleared]')
    print 'Clipboard cleared'
Example #6
0
def run_VQUEST(fasta_file, organism):
    g = open(fasta_file, "r")
    pyperclip.copy(g.read())
    g.close()

    fp = webdriver.FirefoxProfile()
    fp.set_preference("dom.max_chrome_script_run_time", 0)
    fp.set_preference("dom.max_script_run_time", 0)
    driver = webdriver.Firefox(firefox_profile=fp)
    driver.get("http://www.imgt.org/IMGT_vquest/vquest?livret=0&Option=" + organism + "Ig")
    driver.find_element_by_xpath("//input[@name='l01p01c05'][2]").click()
    driver.find_element_by_name("l01p01c10").clear()
    driver.find_element_by_name("l01p01c10").send_keys(Keys.COMMAND, 'v')
    driver.find_element_by_name("l01p01c12").click()
    driver.find_element_by_name("l01p01c13").click()
    driver.find_element_by_name("l01p01c06").click()
    driver.find_element_by_name("l01p01c14").click()
    driver.find_element_by_name("l01p01c15").click()
    driver.find_element_by_name("l01p01c16").click()
    driver.find_element_by_name("l01p01c41").click()
    driver.find_element_by_name("l01p01c22").click()
    driver.find_element_by_name("l01p01c23").click()
    driver.find_element_by_name("l01p01c19").click()
    driver.find_element_by_name("l01p01c18").click()
    driver.find_element_by_css_selector("input[type=\"SUBMIT\"]").click()

    output_file = fasta_file[:-4] + "_vquest.txt"
    print "Storing VQuest data to " + output_file + "\n"
    #make an output file and write the html output to that txt file                                     
    a= open(output_file, "w")
    a.write(driver.page_source)
    a.close()
    driver.quit()
Example #7
0
def copy_flow(part, scope, flow, master, state):
    """
    part: _c_ontent, _a_ll, _u_rl
    scope: _a_ll, re_q_uest, re_s_ponse
    """
    data = copy_flow_format_data(part, scope, flow)

    if not data:
        if scope == "q":
            signals.status_message.send(message="No request content to copy.")
        elif scope == "s":
            signals.status_message.send(message="No response content to copy.")
        else:
            signals.status_message.send(message="No contents to copy.")
        return

    try:
        master.add_event(str(len(data)))
        pyperclip.copy(data)
    except (RuntimeError, UnicodeDecodeError):
        def save(k):
            if k == "y":
                ask_save_path("Save data", data, master, state)
        signals.status_prompt_onekey.send(
            prompt = "Cannot copy binary data to clipboard. Save as file?",
            keys = (
                ("yes", "y"),
                ("no", "n"),
            ),
            callback = save
        )
Example #8
0
 def clip(
     self,
     flows: typing.Sequence[flow.Flow],
     cuts: mitmproxy.types.CutSpec,
 ) -> None:
     """
         Send cuts to the clipboard. If there are multiple flows or cuts, the
         format is UTF-8 encoded CSV. If there is exactly one row and one
         column, the data is written to file as-is, with raw bytes preserved.
     """
     fp = io.StringIO(newline="")
     if len(cuts) == 1 and len(flows) == 1:
         v = extract(cuts[0], flows[0])
         if isinstance(v, bytes):
             fp.write(strutils.always_str(v))
         else:
             fp.write(v)
         ctx.log.alert("Clipped single cut.")
     else:
         writer = csv.writer(fp)
         for f in flows:
             vals = [extract(c, f) for c in cuts]
             writer.writerow(
                 [strutils.always_str(v) or "" for v in vals]  # type: ignore
             )
         ctx.log.alert("Clipped %s cuts as CSV." % len(cuts))
     try:
         pyperclip.copy(fp.getvalue())
     except pyperclip.PyperclipException as e:
         ctx.log.error(str(e))
Example #9
0
def main():
    """Main program."""
    answer = 0

    triplets = {}
    start_time = time.time()
    limit = 1500000
    for t in generate_pythagorean_triples(limit):
        s = sum(t)
        # Eliminate length L if a non-duplicate triplet
        # of the same length is found.
        if s in triplets:
            if triplets[s] != t:
                triplets[s] = ()
        else:
            triplets[s] = t

    # Sorted for printing if need be
    for s in sorted(triplets.keys()):
        t = triplets[s]
        if t != ():
            answer += 1

    end_time = time.time()
    print("The answer is %d" % answer)
    print("%f seconds elapsed." % (end_time - start_time))

    import pyperclip
    pyperclip.copy(str(answer))
    print("The answer has been placed in the clipboard.")
Example #10
0
def main():
    """Main program."""
    answer = 0

    start = time.time()
    max_period = 0
    for index in tqdm.trange(1, 1000):
        period = calculate_period_length(index)
        if period > max_period:
            max_period = period
            answer = index
    end = time.time()
    print("The answer is %d" % answer)
    print("%f seconds elapsed" % (end - start))

    start = time.time()
    max_period = 0
    for index in tqdm.trange(1, 1000):
        period = lambda_decimal_period(index)
        if period > max_period:
            max_period = period
            answer = index
    end = time.time()
    print("The answer is %d" % answer)
    print("%f seconds elapsed" % (end - start))

    import pyperclip
    pyperclip.copy(str(answer))
    print("The answer has been placed in the clipboard.")
Example #11
0
File: cli.py Project: nocivus/1pass
 def get_item(self, item):
     item = self.keychain.item(
         item,
         fuzzy_threshold=self._fuzzy_threshold(),
     )
     pyperclip.copy(item.password)
     self.stdout.write("Copied to clipboard!")
Example #12
0
def main():
    ''' call all subfunctions to generate content '''

    stop_date = getStopDate()
#    stop_date = TZ.localize(datetime.strptime("01.06.2016", '%d.%m.%Y'))    
    print('Last Notizen: ' + stop_date.strftime('%d %b, %H:%M'))    
    
    output = ''
    output += '## [BLOG]\n'
    output += blog()
    output += '\n\n'

    output += '## [WIKI]\n'
    output += wiki(stop_date)
    output += '\n\n'

    output += '## [REDMINE]\n'
    output += redmine(stop_date)
    output += '\n\n'

    output += '## [MAILINGLISTE]\n'
    output += mail(stop_date)
    output += '\n\n'

    output += '## [GITHUB]\n'
    output += github(stop_date)
    output += '\n\n'


    print(output)

    pyperclip.copy(output)
def address_scrape():
    dob = pyperclip.copy('na')
    pya.moveTo(600, 175, duration=0.1)
    pya.click(button='right')
    pya.moveRel(55, 65)
    pya.click()
    dob = pyperclip.paste()
    
    street = pyperclip.copy('na')
    pya.moveTo(500, 240, duration=0.1)
    pya.click(button='right')
    pya.moveRel(55, 65)
    pya.click()
    street = pyperclip.paste()
    
    suburb = pyperclip.copy('na')
    pya.moveTo(330, 285, duration=0.1)
    pya.click(button='right')
    pya.moveRel(55, 65)
    pya.click()
    suburb = pyperclip.paste()
    
    postcode = pyperclip.copy('na')
    pya.moveTo(474, 285, duration=0.1)
    pya.dragTo(450, 285, duration=0.1)
    pya.moveTo(474, 285, duration=0.1)
    pya.click(button='right')
    pya.moveRel(55, 65)
    pya.click()
    postcode = pyperclip.paste()

    address = street + ' ' + suburb + ' ' + postcode

    return (address, dob)
def episode_get_mcn_and_ref():
    # get mcn
    mcn = pyperclip.copy('na')
    pya.moveTo(424, 474, duration=0.1)
    pya.dragTo(346, 474, duration=0.1)
    pya.hotkey('ctrl', 'c')
    mcn = pyperclip.paste()
    pya.moveTo(424, 474, duration=0.1)
    pya.click(button='right')
    pya.moveTo(481, 268, duration=0.1)
    pya.click()
    
    mcn = pyperclip.paste()
    mcn = mcn.replace(' ', '')
    # get ref
    ref = pyperclip.copy('na')
    pya.moveTo(500, 475, duration=0.1)
    pya.dragRel(-8, 0, duration=0.1)
    pya.hotkey('ctrl', 'c')
    ref = pyperclip.paste()
    pya.moveRel(8, 0, duration=0.1)
    pya.click(button='right')
    pya.moveTo(577, 274, duration=0.1)
    pya.click()
    
    ref = pyperclip.paste()
    return mcn, ref
Example #15
0
    def _connect(self, kwargs):
        # Get your app key and secret from the Dropbox developer website
        app_key = "lf7drg20ucmhiga"
        app_secret = "1uf7e8o5eu2pqe9"

        flow = dropbox.client.DropboxOAuth2FlowNoRedirect(app_key, app_secret)
        authorize_url = flow.start()

        # Have the user sign in and authorize this token
        authorize_url = flow.start()
        print("1. Go to: \n%s" % authorize_url)
        print('2. Click "Allow" (you might have to log in first)')
        print("3. Copy the authorization code.")
        if kwargs["copy2clipboard"]:
            import pyperclip

            pyperclip.copy(authorize_url)
            # spam = pyperclip.paste()

        try:
            if kwargs["copy2clipboard"]:
                print("Authorization url is copied to clipboard")
            code = raw_input("Enter the authorization code here: ").strip()
        except Exception as e:
            print("Error using raw_input() - trying input()")
            code = input("Enter the authorization code here: ").strip()
        # This will fail if the user enters an invalid authorization code
        access_token, user_id = flow.finish(code)

        client = dropbox.client.DropboxClient(access_token)
        print("linked account user: %s" % client.account_info()["display_name"])
        # print 'linked account: ', client.account_info()
        return client
Example #16
0
def main():
    """Main program."""
    answer = 0

    start_time = time.time()

    index = 1
    while True:
        index += 2
        if sympy.ntheory.primetest.isprime(index):
            continue
        conjecture = False
        prev_prime = sympy.ntheory.generate.prevprime(index)
        while prev_prime > 2:
            if math.sqrt((index - prev_prime) / 2).is_integer():
                conjecture = True
                break
            prev_prime = sympy.ntheory.generate.prevprime(prev_prime)

        if not conjecture:
            answer = index
            break

    end_time = time.time()
    print("The answer is %d" % answer)
    print("%f seconds elapsed." % (end_time - start_time))

    import pyperclip
    pyperclip.copy(str(answer))
    print("The answer has been placed in the clipboard.")
 def right_click(self, event):
     iid = self.treeview_proxies.identify_row(event.y)
     if iid:
         pyperclip.copy(self.treeview_proxies.item(iid)["values"][0])
         pass
     else:
         pass
Example #18
0
def main():
    # Calculate the number of keys that the current MAX_KEY_DIGITS and
    # MAX_KEY_NUMBER values will cause the hacker program to go through.
    possibleKeys = 0 # start the number of keys at 0.
    for i in range(1, MAX_KEY_DIGITS + 1):
        # To find the total number of possible keys, add the total number
        # of keys for 1-digit keys, 2-digit keys, and so on up to
        # MAX_KEY_DIGITS-digit keys.
        # To find the number of keys with i digits in them, multiply the
        # range of numbers (that is, MAX_KEY_NUMBER) by itself i times.
        # That is, we find MAX_KEY_NUMBER to the ith power.
        possibleKeys += MAX_KEY_NUMBER ** i

    # After exiting the loop, the value in possibleKeys is the total number
    # of keys for MAX_KEY_NUMBER and MAX_KEY_RANGE.
    print('Max key number: %s' % MAX_KEY_NUMBER)
    print('Max key length: %s' % MAX_KEY_DIGITS)
    print('Possible keys to try: %s' % (possibleKeys))
    print()

    # Python programs can be stopped at any time by pressing Ctrl-C (on
    # Windows) or Ctrl-D (on Mac and Linux)
    print('(Press Ctrl-C or Ctrl-D to quit at any time.)')
    print('Hacking...')

    brokenMessage = hackNull(myMessage)

    if brokenMessage != None:
        print('Copying broken message to clipboard:')
        print(brokenMessage)
        pyperclip.copy(brokenMessage)
    else:
        print('Failed to hack encryption.')
Example #19
0
def clip_copy(num):
    """ Copy item to clipboard. """
    if g.browse_mode == "ytpl":

        p = g.ytpls[int(num) - 1]
        link = "https://youtube.com/playlist?list=%s" % p['link']

    elif g.browse_mode == "normal":
        item = (g.model[int(num) - 1])
        link = "https://youtube.com/watch?v=%s" % item.ytid

    else:
        g.message = "clipboard copy not valid in this mode"
        g.content = generate_songlist_display()
        return

    if has_pyperclip:

        try:
            pyperclip.copy(link)
            g.message = c.y + link + c.w + " copied"
            g.content = generate_songlist_display()

        except Exception as e:
            g.content = generate_songlist_display()
            g.message = link + "\nError - couldn't copy to clipboard.\n" + \
                    ''.join(traceback.format_exception_only(type(e), e))

    else:
        g.message = "pyperclip module must be installed for clipboard support\n"
        g.message += "see https://pypi.python.org/pypi/pyperclip/"
        g.content = generate_songlist_display()
Example #20
0
def main():
    """Main program."""
    answer = 0
    start_time = time.time()
    denominator = Fraction(1, 1)
    for index in tqdm.trange(1000):
        if index == 0:
            denominator = Fraction(2, 1)
        elif index == 1:
            denominator = 2 + Fraction(1, 2)
        else:
            denominator = 2 + Fraction(1, denominator)

        continual_fraction = 1 + Fraction(1, denominator)
        numerator_digits = len(str(continual_fraction.numerator))
        denominator_digits = len(str(continual_fraction.denominator))
        if numerator_digits > denominator_digits:
            answer += 1
    end_time = time.time()
    print("The answer is %d" % answer)
    print("%f seconds elapsed." % (end_time - start_time))

    import pyperclip
    pyperclip.copy(str(answer))
    print("The answer has been placed in the clipboard.")
Example #21
0
def copy_to_clipboard(text):
    """
    Copy text to the X clipboard.

    text ::: string to copy to the X keyboard.
    """
    pyperclip.copy(text)
Example #22
0
def breakVigenere(ciphertext):
    # First, we need to do Kasiski Examination to figure out what the length of the ciphertext's encryption key is.
    print('Determining most likely key lengths with Kasiski Examination...')
    allLikelyKeyLengths = kasiskiExamination(ciphertext)
    print('Kasiski Examination results say the most likely key lengths are: ', end='')
    for keyLength in allLikelyKeyLengths:
        print('%s ' % (keyLength), end='')
    print()
    print()

    for keyLength in allLikelyKeyLengths:
        print('Attempting break with key length %s (%s possible keys)...' % (keyLength, NUM_MOST_FREQ_LETTERS ** keyLength))
        brokenCiphertext = attemptBreakWithKeyLength(ciphertext, keyLength)
        if brokenCiphertext != None:
            break

    # If none of the key lengths we found using Kasiski Examination worked, start brute forcing through key lengths.
    if brokenCiphertext == None:
        print('Unable to break message with likely key length(s). Brute forcing key length...')
        for keyLength in range(1, MAX_KEY_LENGTH + 1):
            if keyLength not in allLikelyKeyLengths: # don't re-check key lengths we've already tried from Kasiski Examination
                print('Attempting break with key length %s (%s possible keys)...' % (keyLength, NUM_MOST_FREQ_LETTERS ** keyLength))
                brokenCiphertext = attemptBreakWithKeyLength(ciphertext, keyLength)
                if brokenCiphertext != None:
                    break

    if brokenCiphertext == None:
        print('Unable to break this ciphertext.')
    else:
        print('Copying broken ciphertext to clipboard:')
        print(brokenCiphertext) # only print the first 1000 characters
        pyperclip.copy(brokenCiphertext)
Example #23
0
def add(fullname, password, comment, force, copy):
    db = Database(config.path)
    try:
        login, name = split_fullname(fullname)
    except ValueError:
        message = 'invalid fullname syntax'
        raise click.ClickException(click.style(message, fg='yellow'))

    found = db.get((where("login") == login) & (where("name") == name))
    if force or not found:
        with Cryptor(config.path) as cryptor:
            encrypted = cryptor.encrypt(password)

        credential = dict(fullname=fullname,
                          name=name,
                          login=login,
                          password=encrypted,
                          comment=comment,
                          modified=datetime.now())
        db.insert(credential)
        if copy:
            pyperclip.copy(password)
    else:
        message = "Credential {} already exists. --force to overwrite".format(
            fullname)
        raise click.ClickException(click.style(message, fg='yellow'))
Example #24
0
def exit(msg=''):
    if copied:
        pyperclip.copy('')
    if msg:
        print(color('\n%s' % msg, Fore.RED))
    print(color('\nExiting securely... You are advised to close this terminal.', Fore.RED))
    raise SystemExit
def main(message=None, key=None, mode=None):
    if message == None:
        message = input("Enter a message: ")

    if key == None:
        key = int(input("Enter a key: "))

    if mode == None:
        mode = int(input("Encrypt (1) or Decrypt (0)? : "))

    LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-=_+<>[]{},./?;:"\'\\|`~'

    translated = ''

    for symbol in message:
        if symbol in LETTERS:
            num = LETTERS.find(symbol)
            if mode:
                num = (num + key) % len(LETTERS)
            else:
                num = (num - key) % len(LETTERS)

            translated += LETTERS[num]
        else:
            translated += symbol

    print(translated)
    pyperclip.copy(translated)
Example #26
0
def copy():
    try:
        if isLoggedIn() == False:
                return "User Not Logged In.",200
        out = ""
        uuid = request.form['uuid']
        attribute = request.form['attribute']
        account = None

        for record in sessionVault.getVault().records:
                if str(record._get_uuid()) == str(uuid):
                    account = record
                    break
        
        if account is None:
            return "No Account Found With That UUID.", 200

        if attribute == "username":
            out = str(account._get_user())
        elif attribute == "password":
            out = str(account._get_passwd())
        elif attribute == "url":
            out = str(account._get_url())
        else:
            return "Invalid attribute.", 200
        
        pyperclip.copy(out)
        return str(out)
    except Exception,e:
        return str(e),500
Example #27
0
def search(): # search database
    db = authentication()
    label = raw_input("Enter the label for your password (ex. \"gmail\"): ")
    query = "select password from sites where label=?"
    found_pass = db.execute(query, (label,)) # searching records
    print "Password copied to your clipboard!"
    pyperclip.copy(found_pass.fetchone()[0])
Example #28
0
    def _connect(self,kwargs,get_access_token=False):        
        # Get your app key and secret from the Dropbox developer website
        app_key = '150v6du4vixr2xn'
        app_secret = 'yrtlnqjflfvslor'

        if get_access_token:
            flow = dropbox.client.DropboxOAuth2FlowNoRedirect(app_key, app_secret)
            authorize_url = flow.start()

            # Have the user sign in and authorize this token
            authorize_url = flow.start()
            print ('1. Go to: \n%s' % authorize_url)
            print ('2. Click "Allow" (you might have to log in first)')
            print ('3. Copy the authorization code.')
            if kwargs['copy2clipboard']:
                import pyperclip
                pyperclip.copy(authorize_url)
                # spam = pyperclip.paste()

            try: 
                if kwargs['copy2clipboard']:
                    print("Authorization url is copied to clipboard")
                code = raw_input("Enter the authorization code here: ").strip()
            except Exception as e:
                print('Error using raw_input() - trying input()')
                code = input("Enter the authorization code here: ").strip()
            # This will fail if the user enters an invalid authorization code
            access_token, user_id = flow.finish(code)
        else:
            access_token = 'UCdViiUkgIkAAAAAAAAj4q5KsVyvlEgCLV3eDcJJtuLniMmXfnQ6Pj6qNHy1vBHH'

        client = dropbox.client.DropboxClient(access_token)
        print('linked account user: %s' % client.account_info()['display_name'])
        # print 'linked account: ', client.account_info()
        return client
Example #29
0
def main():
    # As a convenience to the user, we will calculate the number of keys that the current MAX_KEY_LENGTH and MAX_KEY_NUMBER settings will cause the breaker program to go through.
    possibleKeys = 0 # start the number of keys at 0.
    for i in range(1, MAX_KEY_LENGTH + 1):
        # In order to find the total number of possible keys, we need to add the total number of keys of 1 number, of 2 numbers, of 3 numbers, and so on up to MAX_KEY_LENGTH numbers.
        # To find the number of keys with i numbers in them, we multiply the range of numbers (that is, MAX_KEY_NUMBER) by itself i times. That is, we find MAX_KEY_NUMBER to the ith power.
        possibleKeys += MAX_KEY_NUMBER ** i

    # After exiting the loop, the value in possibleKeys is the total number of keys for MAX_KEY_NUMBER and MAX_KEY_RANGE. We then print this data to the user.
    print('Max key number: %s' % MAX_KEY_NUMBER)
    print('Max key length: %s' % MAX_KEY_LENGTH)
    print('Possible keys to try: %s' % (possibleKeys))
    print()

    # Python programs can be stopped at any time by pressing Ctrl-C (on Windows) or Ctrl-D (on Mac and Linux)
    print('(Press Ctrl-C or Ctrl-D to quit at any time.)')
    print('Breaking...')

    # The breakNull() function will have all the encryption breaking code in it, and return the original plaintext.
    brokenMessage = breakNull(myMessage)

    if brokenMessage == None:
        # breakNull() will return the None value if it was unable to break the encryption.
        print('Breaking failed. Unable to break this ciphertext.')
    else:
        # The plaintext is displayed on the screen. For the convenience of the user, we copy the text of the code to the clipboard.
        print('Copying broken message to clipboard:')
        print(brokenMessage)
        pyperclip.copy(brokenMessage)
def buscar_campo_serial(serial_number):
    msg = ''
    pyautogui.PAUSE = 0.5
    pyautogui.FAILSAFE = False
    pyperclip.copy('')
    
    dondeEstaElCampoSerial = pyautogui.locateOnScreen('operator-id-field.png')
    if dondeEstaElCampoSerial is None:
        msg = 'El campo de SERIAL NUMBER no fue encontrado'
        return (False, msg)
        
    else:
        campoSerialPos = list(dondeEstaElCampoSerial)
        #print campoSerialPos
         
    centrocampoSerial = pyautogui.center(campoSerialPos)     
    #print centrocampoSerial
    pyautogui.moveTo(centrocampoSerial)
    pyautogui.click(None,None,2)
    #pyautogui.typewrite('C3WB4E768226230')
    pyautogui.typewrite(serial_number)
    pyautogui.press('enter')
    #pyautogui.press('enter')
    #pyautogui.press('enter')
    
    return (True, msg)
Example #31
0
def copy_results():
    global AllResults
    pp.copy(AllResults)
Example #32
0
#! python3
# clip.py - A multi Clipboard programme

text = {'agree':"""Yes, I agree. That sounds fine""", 
		'busy': """ Sorry, can we do this later or next week?""", 
		'upsell':"""Would you consider making this a monthly donation"""}

import sys
import pyperclip

if len(sys.argv) < 2:
	print('Usage: python3 clip.py [keyphrase] - copy phrase text')
	sys.exit()

keyphrase = sys.argv[1]

if keyphrase in text:
	pyperclip.copy(text[keyphrase])
	print('Text copied')
else:
	print(f('There is no text for {keyphrase}'))
import pyperclip

# Display the programs instructions.
print('Press ENTER to begin. Afterwards, press ENTER to "click" the stopwatch.'
      'Press Ctrl-c to quit.')

input()
print('Started.')
start_time = time.time()
last_time = start_time
lap_num = 1

# Start tracking the lap times.
try:
    while True:
        input()
        lap_time = round(time.time() - last_time, 2)
        total_time = round(time.time() - start_time, 2)

        lap = 'lap # {} {} ({})'.format((str(lap_num) + ':').ljust(3),
                                        str(total_time).rjust(5),
                                        str(lap_time).rjust(6))
        print(lap, end='')

        lap_num += 1
        last_time = time.time()  # Reset the last lap time.
        pyperclip.copy(lap)  # Copy latest lap to clipboard.
except KeyboardInterrupt:
    # Handle the Ctrl-C exception to keep its error message from displaying.
    print('\nDone.')
Example #34
0
    def start(self):
        print("Let's do it!")
        if not self.login():
            print("Error {}".format(self.LastResponse.status_code))
            print(json.loads(self.LastResponse.text).get("message"))
        else:
            print("You'r logged in")

            if self.create_broadcast():
                print("Broadcast ID: {}")
                print("* Broadcast ID: {}".format(self.broadcast_id))
                print("* Server URL: {}".format(self.stream_server))
                print("* Server Key: {}".format(self.stream_key))

                try:
                    pyperclip.copy(self.stream_key)
                    print("The stream key was automatically copied to your clipboard")
                except pyperclip.PyperclipException as headless_error:
                    print("Could not find a copy/paste mechanism for your system")
                    pass

                print("Press Enter after your setting your streaming software.")

                if self.start_broadcast():
                    self.is_running = True

                    while self.is_running:
                        cmd = input('command> ')

                        if cmd == "stop":
                            self.stop()

                        elif cmd == "mute comments":
                            self.mute_comments()

                        elif cmd == "unmute comments":
                            self.unmute_comment()

                        elif cmd == 'info':
                            self.live_info()

                        elif cmd == 'viewers':
                            users, ids = self.get_viewer_list()
                            print(users)

                        elif cmd == 'comments':
                            self.get_comments()

                        elif cmd[:3] == 'pin':
                            to_send = cmd[4:]
                            if to_send:
                                self.pin_comment(to_send)
                            else:
                                print('usage: chat <text to chat>')

                        elif cmd[:5] == 'unpin':
                            self.unpin_comment()

                        elif cmd[:4] == 'chat':
                            to_send = cmd[5:]
                            if to_send:
                                self.send_comment(to_send)
                            else:
                                print('usage: chat <text to chat>')

                        elif cmd == 'wave':
                            users, ids = self.get_viewer_list()
                            for i in range(len(users)):
                                print(f'{i + 1}. {users[i]}')
                            print('Type number according to user e.g 1.')
                            while True:
                                cmd = input('number> ')

                                if cmd == 'back':
                                    break
                                try:
                                    user_id = int(cmd) - 1
                                    self.wave(ids[user_id])
                                    break
                                except:
                                    print('Please type number e.g 1')

                        else:
                            print(
                                'Available commands:\n\t '
                                '"stop"\n\t '
                                '"mute comments"\n\t '
                                '"unmute comments"\n\t '
                                '"info"\n\t '
                                '"viewers"\n\t '
                                '"comments"\n\t '
                                '"chat"\n\t '
                                '"pin"\n\t '
                                '"unpin"\n\t '
                                '"wave"\n\t')
#! python3
# bulletPointAdder.py - Adds Wikipedia bullet points to the start
# of each line of text on the clipboard.

import pyperclip
text = pyperclip.paste()

# Separate lines and add stars.
lines = text.split('\n')
for i in range(len(lines)): # loop through all indexes in the "lines" list
    lines[i] = '* ' + lines[i] # add star to each string in "lines" list


pyperclip.copy(text)
import pyperclip

pyperclip.copy('Pyperclip copies to and pastes from the clipboard.')
pyperclip.paste()
Example #37
0
 def insert_eq_nr(self):
     text = "\\begin{align}\n\n\\end{align}"
     pyperclip.copy(text)
     self.keyboard.press(Key.ctrl)
     self.keyboard.press('v')
Example #38
0
import os
import pyperclip
import pickle

if os.path.exists('clipboard.pickle'):
    with open('clipboard.pickle', 'rb') as f:
        clipboard = pickle.load(f)
else:
    clipboard = {
        'agree': """Yes, I agree. That sounds fine to me.""",
        'busy': """Sorry, can we do this later this week or next week?""",
        'upsell': """Would you consider making this a monthly donation?"""
    }

if len(sys.argv) < 2:
    print('Usage: python mclip.py [key] [value]')
    sys.exit()

keyphrase = sys.argv[1]
if len(sys.argv) > 2:
    phrase = sys.argv[2]
    clipboard[keyphrase] = phrase
    with open('clipboard.pickle', 'wb') as f:
        pickle.dump(clipboard, f)

if keyphrase in clipboard:
    pyperclip.copy(clipboard[keyphrase])
    print('Text for ' + keyphrase + ' copied to clipboard')
else:
    print('There is no text for ' + keyphrase)
	def copy_credential(cls,site_name):
		'''
		Class method that copies a credential's info after the credential's site name is entered
		'''
		find_credential = Credential.find_by_site_name(site_name)
		return pyperclip.copy(find_credential.password)
Example #40
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2018-01-30 09:25:49
# @Author  : Roger TX ([email protected])
# @Link    : https://github.com/paotong999
# @Version : $Id$

import os,sys,pyperclip

password = {'email':'123456',
                      'blog':'1qazXSW@',
                      'centos':'centos',
                      'card':'66666'}

if len(sys.argv) < 2:
    print ('Usage:python password.py [account] - copy account password')
    sys.exit()
    pass

account = sys.argv[1]

if account in password:
    pyperclip.copy(password[account])
    print('password for ' + account + ' copied to clipboard.')
else:
    print('there is no account named ' + account)
    pass
Example #41
0
 def copy_email(cls, number):
     password_found = Password.find_by_number(number)
     pyperclip.copy(password_found.email)
#! python3
# pw.py - An insecure password locker program.

PASSWORDS = {
    'email': 'F7minlBDDuvMJuxESSKHFhTxFtjVB6',
    'blog': 'VmALvQKAxiVH5G8v01if1MLZF3sdt',
    'luggage': '12345'
}

import sys, pyperclip
if len(sys.argv) < 2:
    print('Usage: python pw.py [account] - copy account password')
    sys.exit()

account = sys.argv[1]  # first command line arg is the account name

if account in PASSWORDS:
    pyperclip.copy(PASSWORDS[account])
    print('Password for ' + account + 'copied to clipboard.')
else:
    print('There is no account named ' + account)
Example #43
0
import pyautogui
import pyperclip

pyautogui.moveTo(441, 207, 1)
pyautogui.click()

# 문자입력
pyautogui.write("i'am a robot!", interval=0.1)

# 키보드 키입력
pyautogui.press('enter')
pyautogui.write("automatic program", interval=0.1)

# 한글입력
# 클립보드에 복사
pyperclip.copy("한글입력해보자")

# 붙여넣기
pyautogui.keyDown("ctrl")
pyautogui.press("v")
pyautogui.keyUp("ctrl")
Example #44
0
    option = option.split(':')[1]
    option = option.split('/')[0]
    return option


_id = '7costco'
_pw = '0206coco'

driver = webdriver.Chrome()
url = "https://sell.smartstore.naver.com/#/login"
driver.implicitly_wait(3)
driver.get(url)

# 로그인
driver.find_element_by_css_selector("#loginId").click()
pyperclip.copy(_id)
time.sleep(1)
pyautogui.hotkey('ctrl', 'v')
driver.find_element_by_css_selector("#loginPassword").click()
pyperclip.copy(_pw)
time.sleep(1)
pyautogui.hotkey('ctrl', 'v')
driver.find_element_by_css_selector("#loginButton").click()

# 팝업창 처리
print(len(driver.find_elements_by_css_selector('.modal-dialog')))
if (len(driver.find_elements_by_css_selector('.modal-dialog')) > 0):
    driver.find_element_by_css_selector(
        '#seller-content > div > div > div > div.modal-body > ncp-manager-notice-view > ng-transclude > button'
    ).click()
    time.sleep(1)
Example #45
0
def paste(foo):
    pyperclip.copy(foo)
    pyautogui.hotkey('ctrl', 'v')
        return templateForFirstSignupDay()
   elif (currentMonthTotalDays - 5) <= currentDayOfMonthIndex <= (currentMonthTotalDays - 1):
#    elif (currentMonthTotalDays - 6) <= currentDayOfMonthIndex <= (currentMonthTotalDays - 1):
        return templateForMiddleSignupDays()
   elif currentMonthTotalDays == currentDayOfMonthIndex:
        return templateForLastSignupDay()


def stringToPrint():
    answer = templateToUse()
    answer = re.sub('INITIAL_NUMBER', str(initialNumber), answer)
    answer = re.sub('CURRENT_MONTH_INDEX', str(currentMonthIndex), answer)
    answer = re.sub('CURRENT_MONTH_TOTAL_DAYS', str(currentMonthTotalDays), answer)
    answer = re.sub('CURRENT_MONTH_PENULTIMATE_DAY_INDEX', str(currentMonthPenultimateDayIndex), answer)
    answer = re.sub('CURRENT_MONTH_NAME', currentMonthName, answer)
    answer = re.sub('CURRENT_MONTH_URL', currentMonthURL, answer)
    answer = re.sub('NEXT_MONTH_INDEX', str(nextMonthIndex), answer)
    answer = re.sub('NEXT_MONTH_NAME', nextMonthName, answer)
    answer = re.sub('CURRENT_DAY_OF_MONTH_INDEX', str(currentDayOfMonthIndex), answer)
    answer = re.sub('CURRENT_DAY_OF_MONTH_NAME', currentDayOfMonthName, answer)
    answer = re.sub('CURRENT_DAY_OF_WEEK_NAME', currentDayOfWeekName, answer)
    answer = re.sub('UPPERCASE_MONTH', uppercaseMonth, answer)
    return answer


outputString = stringToPrint()
print "============================================================="
print outputString
print "============================================================="
pyperclip.copy(outputString)
import shelve
import pyperclip
import sys

mcb_shelf = shelve.open('mcb')

# Save clipboard content
if len(sys.argv) == 3 and sys.argv[1].lower() == 'save':
    mcb_shelf[sys.argv[2]] = pyperclip.paste()
elif len(sys.argv) == 3 and sys.argv[1].lower() == 'delete':
    del mcb_shelf[sys.argv[2]]
elif len(sys.argv) == 2:
    # List keywords and load content
    if sys.argv[1].lower() == 'list':
        pyperclip.copy(str(list(mcb_shelf.keys())))
    elif sys.argv[1].lower() == 'deleteall':
        for keyword in list(mcb_shelf.keys()):
            del mcb_shelf[keyword]
    elif sys.argv[1].lower() == 'printall':
        value_list = []
        for key, value in list(mcb_shelf.items()):
            value = value.strip()
            value_list.append(value)
        pyperclip.copy(str(value_list))
    elif sys.argv[1].lower() == 'addto':
        value_list = []
        value_string = ''
        for key, value in list(mcb_shelf.items()):
            value = value.strip()
            value_list.append(value)
Example #48
0
 def response(self, flow: mitmproxy.http.HTTPFlow):
     if flow.request.url == 'https://maimai.wahlap.com/maimai-mobile/home/':
         cookies = flow.response.headers.get('Set-Cookie')
         userId = cookies.split('userId=')[1].split(';')[0]
         pyperclip.copy(userId)
         print(f'userId: {userId} 已复制到剪切板')
 def copy_morse_code(self):
     cp= ''.join([str(elem) for elem in self.morse_code])
     pyperclip.copy(cp)
Example #50
0
def main():
    myMessage = input('Enter your message:')
    myKey = 200
    ciphertext = encryptMessage(myKey, myMessage)
    print(ciphertext + '|')
    pyperclip.copy(ciphertext)
Example #51
0
def copyToClipBoard(noWithStr):
    pyperclip.copy(noWithStr)

    keyboard.wait('enter')
    return 1
import sys
import pyperclip

account = {'facebook': '12345', 'gmail': '123456'}
if len(sys.argv) < 2:
    print('Please enter the account for password')
    sys.exit()
password = sys.argv[1]
if password in account:
    pyperclip.copy(account[password])
    print('Your password is copied')
else:
    print("You did't saved your password here")
Example #53
0
                    saveEvent, saveResult = saveWindow.read()

                    if saveEvent in (None, 'Close'):
                        saveWindow.close()
                        break

                    if saveEvent == 'Open file':
                        os.startfile(
                            os.path.join(os.getcwd(), 'json',
                                         f'{values[1]}.json'))

            if resultsEvent == 'Open magnet link':
                os.startfile(process.links[resultsValues[0][0]])

            if resultsEvent == 'Copy magnet link':
                pyperclip.copy(process.links[resultsValues[0][0]])

                clipboardLayout = [[sg.Text('\n', font=('Segoe UI Light', 5))],
                                   [
                                       sg.Text('Copied to clipboard!',
                                               font=('Segoe UI Light', 14),
                                               size=(17, 0),
                                               justification='left')
                                   ],
                                   [sg.Text('\n', font=('Segoe UI Light', 1))]]

                clipboardWindow = sg.Window('Sucess!',
                                            clipboardLayout,
                                            auto_close=True,
                                            icon='icon.ico')
    (\s*(ext|x|ext.)\s*\d{2,5})?    # extension
    )''', re.VERBOSE)  # 第二个参数表示忽略正则的空格和注释

# Create email regex.
emailRegex = re.compile(
    r'''(
    [a-zA-Z0-9._%+-]+       # username
    @                       # @ symbol
    [a-zA-Z0-9.-]+          # domain name\
    (\.[a-zA-Z]{2,4})       # dot-something
    )''', re.VERBOSE)

# Find matches in clipboard text.
text = str(pyperclip.paste())
matches = []
for groups in phoneRegex.findall(text):
    phoneNum = '-'.join([groups[1], groups[3], groups[5]])
    if groups[0] != '':
        phoneNum += ' x' + groups[0]
    matches.append(phoneNum)
for groups in emailRegex.findall(text):
    matches.append(groups[0])

# Copy results to the clipboard.
if len(matches) > 0:
    pyperclip.copy('\n'.join(matches))
    print('Copied to clipboard:')
    print('\n'.join(matches))
else:
    print('No phone numbers or email addresses found.')
Example #55
0
elif lg == '  ИТАЛЬЯНСКИЙ  ':
    dest1 = 'Italian'

elif lg == '  ИСПАНСКИЙ  ':
    dest1 = 'Spanish'

input = g.buttonbox(
    title="Выбор метода ввода",
    msg="          Вы можете ввести текст или открыть файл для перевода",
    choices=['  ВВЕСТИ ТЕКСТ  ', '  ОТКРЫТЬ ФАЙЛ  '])

if input == "  ВВЕСТИ ТЕКСТ  ":
    string = g.enterbox("      Введите текст который хотите перевести")
elif input == "  ОТКРЫТЬ ФАЙЛ  ":
    f = g.msgbox(title="Поддерживаемые форматы",
                 msg="                Вы можете открыть файл в формате .txt ")
    file = g.fileopenbox(title="Выбор файла")
    fl = open(file, 'r')
    string = fl.read()

translator = Translator()
ou = translator.translate(str(string), dest=dest1)
result = g.buttonbox(title="Результат перевода",
                     msg=str(ou.text),
                     choices=['  СКОПИРОВАТЬ  ', '  ВЫХОД  '])
if result == "  СКОПИРОВАТЬ  ":
    pyperclip.copy(str(ou.text))
    copy = g.msgbox(
        title="Успех!",
        msg="                          Текст скопирован в буфер обмена")
Example #56
0
def copyPoints(fileName):
    with open(fileName, "r") as f:
        pyperclip.copy(f.read())
        print("Points copied!")
        sleep(1)
Example #57
0
 def copy_username(cls, title):
     credential_found = Credential.find_by_title(title)
     pyperclip.copy(credential_found.username)
Example #58
0
import pyperclip

AFFILIATE_CODE = '&tag=pyb0f-20'

url = pyperclip.paste()

if 'amazon' not in url:
    print('sorry, invalid link')
else:
    new_link = url + AFFILIATE_CODE
    pyperclip.copy(new_link)
    print('Affiliate link generated and copied to clipboard')
        print(i, len(text_readline[i]), text_readline[i])

all_info = "\r\n".join(info_list)
# ================由频次排序================
for scenario in scenario_list:
    scenario_line_list = scenario.split("\t")
    scenario_count = str(1000-scenario_count_dict[scenario]).zfill(3)
    scenario_line_list.insert(1, scenario_count)
    scenario_line_full = '-'.join(scenario_line_list)
    scenario_list_full.append(scenario_line_full)

scenario_list_full.sort()
# scenario_list_full.reverse()

print(scenario_list_full)
# print(scenario_count_dict)

# ================pyperclip模块================
import pyperclip

pyperclip.copy(all_info)
spam = pyperclip.paste()
# ================运行时间计时================
run_time = time.time() - start_time
if run_time < 60:  # 两位小数的秒
    print("耗时:{:.2f}秒".format(run_time))
elif run_time < 3600:  # 分秒取整
    print("耗时:{:.0f}分{:.0f}秒".format(run_time // 60, run_time % 60))
else:  # 时分秒取整
    print("耗时:{:.0f}时{:.0f}分{:.0f}秒".format(run_time // 3600, run_time % 3600 // 60, run_time % 60))
    (\d{7,9}) # 7 to 9 digits
    )'''
countryDict["germany"] = germany

# Check if sys.argv[1] in countryDict and create regex object
argumentOne = ""
try:
    argumentOne = sys.argv[1]
except IndexError:
    exit("No argument given. Try again with a country as an argument")

if (argumentOne in countryDict):
    #Create regex object
    regexCompile = re.compile(countryDict[argumentOne], re.VERBOSE)
else:
    exit("No number format for that country found")

# Find matches in clipboard text.
text = str(pyperclip.paste())
matches = []
for groups in regexCompile.findall(text):
    phoneNumber = groups[0]
    matches.append(phoneNumber)

if len(matches) > 0:
    pyperclip.copy(' -+- '.join(matches))
    print("Phone number(s) found:")
    print('\n'.join(matches))
else:
    print('No phone number found.')