本文整理汇总了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
示例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)
示例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)
示例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)
示例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
示例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
示例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)
示例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)
示例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
示例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)
示例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)
示例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())
示例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')
示例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
示例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')