当前位置: 首页>>代码示例>>Python>>正文


Python pyperclip.paste函数代码示例

本文整理汇总了Python中pyperclip.paste函数的典型用法代码示例。如果您正苦于以下问题:Python paste函数的具体用法?Python paste怎么用?Python paste使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了paste函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: episode_get_mcn_and_ref

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
开发者ID:varnell-holdings,项目名称:new_billing,代码行数:27,代码来源:login_and_run.py

示例2: address_scrape

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)
开发者ID:varnell-holdings,项目名称:new_billing,代码行数:34,代码来源:login_and_run.py

示例3: run

 def run(self):
     recent_value = ""
     while not self._stopping:
         if pyperclip.paste() != recent_value:
             recent_value = pyperclip.paste()
             process(recent_value)
         time.sleep(self._pause)
开发者ID:18z,项目名称:abc,代码行数:7,代码来源:watcher_no_thread.py

示例4: run

    def run(self):
        clipboard = pyperclip.paste()
        settings = QtCore.QSettings('glimmer', 'glimmer')
        print 'Monitoring clipboard.'

        while True:
            if (pyperclip.paste() != clipboard
                    and pyperclip.paste() is not None):

                clipboard = pyperclip.paste()
                pyperclip.copy("")

                time.sleep(0.35)

                if clipboard == pyperclip.paste():
                    print 'Double copy detected, trying to make a POST now.'
                    try:
                        post(clipboard, settings.value('apiKey'))
                    except ConnectionError:
                        print 'Hmm, can\'t connect to the server bud.'
                    except:
                        print "Something went wrong, couldn't POST that."
                else:
                    print 'Looks like you didn\'t copy twice bud.'
                    pyperclip.copy(clipboard)
            else:
                pass
            time.sleep(0.1)
开发者ID:LarryBrid,项目名称:glimmer-client,代码行数:28,代码来源:client.py

示例5: main

def main():
    try:
        druglist = set(load_jt('druglist.json'))
    except:
        druglist = set()  
    query_list = generate_querylist()
    
    Delay(1)
    drugname = ''
    for query in query_list:
        for i in range(1,51):
            print 'Now crawling %s - %s' % (query, i)
            Delay(0.5)
            enter_query(query, t = 0.1)
            Delay(4)
            Down(i, dl=0.1)
            Enter(dl=0.5)
            Ctrl_a(dl=0.5)
            Ctrl_c(dl=0.5)
            try:
                if pyperclip.paste() == drugname: # 如过跟上一次重复,就跳过
                    break
                else:
                    drugname = pyperclip.paste()
                    druglist.add(drugname)
                    dump_jt(list(druglist), 'druglist.json', replace = True)
            except:
                pass
开发者ID:MacHu-GWU,项目名称:EFA-on-going-projects,代码行数:28,代码来源:get_quotable_drug.py

示例6: test_fsl

def test_fsl(original, flipped):
    """Test flipping all slashes/backslashes."""
    assert slbsl.fsl(original) == flipped
    assert pyperclip.paste() == flipped

    assert slbsl.fsl(flipped) == original
    assert pyperclip.paste() == original
开发者ID:cb109,项目名称:slbsl,代码行数:7,代码来源:test_slbsl.py

示例7: main

def main():
    while True:
        if mailto.canaccept(pyperclip.paste()):
            a = pyperclip.paste()
            pyperclip.copy(mailto.fix(pyperclip.paste()))
            print 'Fixed ' + a + ' into ' + pyperclip.paste()
        time.sleep(1)
开发者ID:vaio127,项目名称:PyURLFixer,代码行数:7,代码来源:pyurlfixer.py

示例8: mode_clipboard_watch

def mode_clipboard_watch(options):
    """Clipboard Watch Mode: watches for a new string on the clipboard, and tries to fetch that URL"""
    articles = set()
    failures = set()

    print('Hello, this is news-scraper. Copy a URL to start!')
    print('To quit, press CTRL+C in this window.\n')
    url = pyperclip.paste()
    while True:
        try:
            tmp_value = pyperclip.paste()
            if tmp_value != url:
                url = tmp_value
                print('Fetching article...')
                if options.debug:
                    print("Value changed: %s" % str(url)[:100])

                article = _get_article(url=url, bodyLines=options.bodyLines, debug=options.debug)
                if (article):
                    articles.add(article)
                else:
                    failures.add(url)
                    time.sleep(0.2)
        except KeyboardInterrupt:
            break

    _output(articles, options.outputFile, failures, options.failureFile)
开发者ID:mnkhouri,项目名称:news_scraper,代码行数:27,代码来源:ui.py

示例9: on_release

        def on_release(key):
            global edicao
            global link_e
            global res
            global semi_res

            try:
                key = key.char
            except:
                pass

            if key == u'q':
                if semi_res is not None:
                    res.append(copy.copy(semi_res))

                semi_res = {
                    u'edicao': edicao,
                    u'titulo': pyperclip.paste(),
                    u'link': link_e}

            if key == u'w':
                semi_res['subtitulo'] = pyperclip.paste()

            if key == u'e':
                semi_res['tags'] = pyperclip.paste()

            if key == keyboard.Key.esc:
                # Stop listener
                return False
开发者ID:pedrocicoleme,项目名称:extracao-noticias-ciencia,代码行数:29,代码来源:jornal_da_ciencia_impresso.py

示例10: run

	def run(self):
		while not self._stopping:
			# print 'Producer'
			if self._current_value != pyperclip.paste():
				self._current_value = pyperclip.paste()
				self._queue.put(pyperclip.paste())
				print ' [q] ' + pyperclip.paste()
			time.sleep(self._pause)
开发者ID:TheLinoman,项目名称:ClipboardMQ-Python,代码行数:8,代码来源:Producer.py

示例11: run

 def run(self):
     recent_value = ""
     while not self._stopping:
         if pyperclip.paste() != recent_value:
             recent_value = pyperclip.paste()
             print "print from watcher.run() "+recent_value
             if __parser__.url(pyperclip.paste()) is True:
                 __modules__['print_url'].run(pyperclip.paste())
         time.sleep(self._pause)
开发者ID:18z,项目名称:abc,代码行数:9,代码来源:watcher.py

示例12: __init__

    def __init__(self):
        QtGui.QDialog.__init__(self)
        self.setupUi(self)
        self.aria = Aria2Manager()
        self.edtDir.setText(HOME_DIR + '/Downloads')

        # Monitor clipboard for URLs
        if len(clip.paste()) > 4:
            if clip.paste()[:4] == 'http' or clip.paste()[:3] == 'ftp':
                self.edtUrl.setText(clip.paste())
开发者ID:a-atalla,项目名称:BarqDM,代码行数:10,代码来源:NewDownload.py

示例13: job

def job(file,mode):
    if mode == 1:
        url = upload_with_full_Path(file)
    if mode == 2:
        url = upload_with_full_Path_cmd(file)
    pyperclip.copy(url)
    pyperclip.paste()
    print url
    with open('Markdown-格式外链.txt', 'a') as f:
        f.write(url+'\n')
开发者ID:snakeliwei,项目名称:qiniu4blog,代码行数:10,代码来源:qiniu4blog.py

示例14: test_wtf

def test_wtf(path):
    # smoke test for now
    with swallow_outputs() as cmo:
        wtf(dataset=path)
        assert_not_in('## dataset', cmo.out)
        assert_in('## configuration', cmo.out)
        # Those sections get sensored out by default now
        assert_not_in('user.name: ', cmo.out)
    with chpwd(path):
        with swallow_outputs() as cmo:
            wtf()
            assert_not_in('## dataset', cmo.out)
            assert_in('## configuration', cmo.out)
    # now with a dataset
    ds = create(path)
    with swallow_outputs() as cmo:
        wtf(dataset=ds.path)
        assert_in('## configuration', cmo.out)
        assert_in('## dataset', cmo.out)
        assert_in('path: {}'.format(ds.path), cmo.out)

    # and if we run with all sensitive
    for sensitive in ('some', True):
        with swallow_outputs() as cmo:
            wtf(dataset=ds.path, sensitive=sensitive)
            # we fake those for tests anyways, but we do show cfg in this mode
            # and explicitly not showing them
            assert_in('user.name: %s' % _HIDDEN, cmo.out)

    with swallow_outputs() as cmo:
        wtf(dataset=ds.path, sensitive='all')
        assert_not_in(_HIDDEN, cmo.out)  # all is shown
        assert_in('user.name: ', cmo.out)

    skip_if_no_module('pyperclip')

    # verify that it works correctly in the env/platform
    import pyperclip
    with swallow_outputs() as cmo:
        try:
            pyperclip.copy("xxx")
            pyperclip_works = pyperclip.paste().strip() == "xxx"
            wtf(dataset=ds.path, clipboard=True)
        except (AttributeError, pyperclip.PyperclipException) as exc:
            # AttributeError could come from pyperclip if no DISPLAY
            raise SkipTest(exc_str(exc))
        assert_in("WTF information of length", cmo.out)
        assert_not_in('user.name', cmo.out)
        if not pyperclip_works:
            # Some times does not throw but just fails to work
            raise SkipTest(
                "Pyperclip seems to be not functioning here correctly")
        assert_not_in('user.name', pyperclip.paste())
        assert_in(_HIDDEN, pyperclip.paste())  # by default no sensitive info
        assert_in("cmd:annex:", pyperclip.paste())  # but the content is there
开发者ID:hanke,项目名称:datalad,代码行数:55,代码来源:test_plugins.py

示例15: job

def job(file, mode):
    if mode == 1:
        url = upload_with_full_Path(file)
    if mode == 2:
        url = upload_with_full_Path_cmd(file)
    pyperclip.copy(url)
    pyperclip.paste()
    print url
    with open('MARKDOWN_FORMAT_URLS.txt', 'a') as f:
        image = '![' + url + ']' + '(' + url + ')' + '\n'
        f.write(image + '\n')
开发者ID:Cahost,项目名称:qiniu4blog,代码行数:11,代码来源:qiniu4blog.py


注:本文中的pyperclip.paste函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。