Clipboard utilities for use with Python.
Project description
Description
Package for accessing the clipboard with Python.
Installation
pip install clip-util
Features
Windows Only
Allows you to set text and HTML to the clipboard on Windows.
Supported Clipboard Formats
- Text
- HTML
- RTF
Usage
Clipboard
Will open and close every time the values are set, or retrieved. It's better to use a context manager.
from clipboard import Clipboard
clipboard = Clipboard()
# Set Clipboard
clipboard['text'] = 'Hello World!'
# OR
clipboard.set_clipboard('text') = 'Hello World!'
# Get Clipboard
text = clipboard['text']
# OR
text = clipboard.get_clipboard('text')
# Supports HTML
clipboard['html'] = '<h1>Hello World</h1>'
Context Manager
from clipboard import Clipboard
with Clipboard() as clipboard:
# Set Clipboard
clipboard['text'] = 'Hello World!'
# OR
clipboard.set_clipboard('text') = 'Hello World!'
# Get Clipboard
text = clipboard['text']
# OR
text = clipboard.get_clipboard('text')
# HTML
clipboard['html'] = '<h1>Hello World</h1>'
Clipboard Formats
You can use clip-util
to access the clipboard formats directly.
ClipboardFormats
: Enum for clipboard formats.
ClipboardFormats.CF_HTML
: Represents HTML format.
ClipboardFormats.CF_RTF
: Represents RTF format.
from clipboard import Clipboard
from clipboard import ClipboardFormats
from clipboard import HTMLClipboard
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
clip-util-0.1.17.tar.gz
(9.1 kB
view hashes)
Built Distribution
clip_util-0.1.17-py3-none-any.whl
(10.3 kB
view hashes)
Close
Hashes for clip_util-0.1.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c453da6d2ef64a8fe7cc8cae3edc7b05801a84adcb286b297ea0f5a14c2553ce |
|
MD5 | b356c620f642fef47452e52066115c77 |
|
BLAKE2b-256 | efe6dde18e82f6eba534cbe58bc4543492c369eea99852abb634a35f2b209dca |