• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python pyperclip.paste函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: main

def main():
    text = db.get_lastest_paste()

    while True:
        if text == pyperclip.paste():
            sleep(1)
            continue

        text = pyperclip.paste()
        print("Detected new text", text)
        db.save_new_paste(text)
        sleep(0.5)
开发者ID:Arya04,项目名称:hello-world,代码行数:12,代码来源:script.py


示例17: copy_data

 def copy_data(self, key=0):    # background mode
     "将CVirtualGridCtrl|Custom<n>的数据复制到剪贴板,默认取当前的表格"
     if key:
         self.switch_tab(self.two_way, key)    # 切换到持仓('W')、成交('E')、委托('R')
     print("正在等待实时数据返回,请稍候...")
     pyperclip.copy('')
     # 查到只有列表头的空白数据等3秒...orz
     for i in range(10):
         time.sleep(0.3)
         op.SendMessageW(reduce(op.GetDlgItem, NODE['FORM'], self.main),
                         MSG['WM_COMMAND'], MSG['COPY_DATA'], NODE['FORM'][-1])
         if len(pyperclip.paste().splitlines()) > 1:
             break
     return pyperclip.paste()
开发者ID:fasiondog,项目名称:hikyuu,代码行数:14,代码来源:puppet.py


示例18: console

def console():
    '''
    cli hook
    return -- integer -- the exit code
    '''
    default_f = os.path.join(os.getcwd(), datetime.datetime.now().strftime("%Y-%m-%d-%H:%M.txt"))

    parser = argparse.ArgumentParser(description='Listen to the system clipboard and write out new contents to file')
    parser.add_argument('filepath', nargs="?", default=default_f, help='File where clipboard contents will be written')
    #parser.add_argument('--clean', action='store_true', help='If Passed in, paste with no metadata')
    parser.add_argument(
        '--delim', '-d', '--postfix', '-p',
        dest="delim",
        default="\n",
        type=lambda x: x.decode('string_escape'),
        help='will be added to the end of the pasted text'
    )
    parser.add_argument("--version", "-V", action='version', version="%(prog)s {}".format(__version__))

    args = parser.parse_args()
    delim = args.delim
    last_paste_txt = pyperclip.paste()
    backoff = 0.15
    cb_count = 0
    with codecs.open(args.filepath, encoding='utf-8', mode='a') as fp:

        print("Hello! Pasted text will be written to {}\n".format(args.filepath))
        fileno = fp.fileno()

        try:
            while True:
                time.sleep(backoff)

                paste_txt = pyperclip.paste()
                if paste_txt != last_paste_txt:
                    if paste_txt and not paste_txt.isspace():
                        cb_count += 1
                        print("{}. {}".format(cb_count, paste_txt))

                        fp.write(paste_txt)
                        fp.write(delim)
                        fp.flush()
                        os.fsync(fileno)

                        last_paste_txt = paste_txt

        except KeyboardInterrupt:
            print("\nGoodbye! Pasted text was written to {}".format(args.filepath))

    return 0
开发者ID:Jaymon,项目名称:ghostboard,代码行数:50,代码来源:ghostboard.py


示例19: _test_copies_columns

    def _test_copies_columns(self):
        pyperclip.copy("old clipboard contents")

        self.page.driver.switch_to.default_content()
        self.page.driver.switch_to_frame(
            self.page.driver.find_element_by_tag_name("iframe"))
        self.page.find_by_xpath(
            "//*[@data-test='output-column-header' and "
            "contains(., 'some_column')]"
        ).click()
        self.page.find_by_xpath("//*[@id='btn-copy-row']").click()

        self.assertTrue('"Some-Name"' in pyperclip.paste())
        self.assertTrue('"Some-Other-Name"' in pyperclip.paste())
        self.assertTrue('"Yet-Another-Name"' in pyperclip.paste())
开发者ID:thaJeztah,项目名称:pgadmin4,代码行数:15,代码来源:query_tool_journey_test.py


示例20: check_status

def check_status(bar=1,bulge=0):
    
    numFails = 0
    clipboard_old = pyperclip.paste()
    while True:
        clipboard = pyperclip.paste()
        
        if (clipboard != clipboard_old):
            print "New ID!",clipboard
            clipboard_old = clipboard

            #Load data object for that classification
            # Have lookup table of the form id, bar, bulge  where bar&bulge are out of 1,0

            classification=read_object_classification(clipboard_old)  #in the form [id,bar,bulge]
            #classification=['1ds4',1,0]    #example of a barred galaxy withotu a bulge
            print "Galaxy data",classification,"Location data",bar,bulge
            status=bar==classification[1] and bulge==classification[2]

            if status:
                print "Success :) Do the things!"
                ser.write('1\n')
                return_code = subprocess.call(["afplay", musicFile])
                ser.write('0\n')
                time.sleep(0.5)
                ser.write('M\n')
                time.sleep(8)
                ser.write('N\n')

            else:
                numFails += 1
                if (numFails%5 != 0):
                    print "Fail :( No bubbles for you"
                    return_code = subprocess.call(["say", failText])
                else:
                    print "Fail :( No bubbles for you, but here's a Rickroll anyway..."
                    return_code = subprocess.call(["say", rickText])
                    #ser.write('1\n')
                    return_code = subprocess.call(["afplay", musicFile_rick])
                    #ser.write('0\n')



            print '-------------'

        time.sleep(0.5)

        headers={'Content-Type':'application/json','Accept':'application/vnd.api+json; version=1'}
开发者ID:chrislintott,项目名称:GZMaze,代码行数:48,代码来源:qrcodetoclassification.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python component.Component类代码示例发布时间:2022-05-27
下一篇:
Python pyperclip.copy函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap