Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98807

copy a multi line variable to clipboard python

$
0
0

my code calls a program and copies output to a variable

info = os.popen('info filename').read()

which outputs a multi line sting

line
line1 : ABC
line2 : (efg)
line3 : ABCDEFG! (hijkl)
......................................

lets say i want to delete (efg) from that variable so

info = info.replace('(egf)' , '')

now i want to copy the variable to clipboard. So i can paste it using selenium since that info string is very large and selenium in chrome types one key at a time it just scrambles all letters in info variable while typing

so if i can copy this variable to clipboard i should just be able to do

textarea.sendkeys(Keys.CONTROL , 'v')

i've heard about pyperclip but i cant use that


Viewing all articles
Browse latest Browse all 98807


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>