sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #59571
Re: [Question #819182]: Delete blanks
Question #819182 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/819182
scarley jeo posted a new comment:
It seems your current approach to copying the text and removing spaces
may have an issue in how you're handling the clipboard or whitespace
processing. Here's how you can modify the logic to achieve the desired
result:
Ensure that the Env.getClipboard() function is correctly fetching the clipboard content.
Use .replace() instead of .strip() to remove all spaces from the string, as .strip() only removes leading and trailing spaces.
Confirm that the clipboard is storing the content correctly and matches the expected format.
Here’s an updated snippet for your code:
python
Copy
Edit
doubleClick()
type('c', Key.CTRL) # Copy the text to the clipboard
box1 = Env.getClipboard().replace(" ", "").encode("utf-8") # Remove all spaces and encode
print(box1)
This change ensures that all spaces are removed from the content, not just leading or trailing ones. Test this and let me know if further adjustments are needed!
for more just keep visiting https://ejhrc.com/
--
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.