display-server-interactions-0.0.dev9
توضیحات
DSI allows you to perform basic interactions on your display server, like screenshotting a window or sending input to it.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | POSIX :: Linux |
| نام فایل | display-server-interactions-0.0.dev9 |
| نام | display-server-interactions |
| نسخه کتابخانه | 0.0.dev9 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Commandcracker |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/display-server-interactions/ |
| مجوز | Apache Software License |
# Display Server Interactions
[](https://pypi.org/project/display-server-interactions/)
[](https://display-server-interactions.readthedocs.io/en/latest)
[](https://pepy.tech/project/display-server-interactions)
[](https://pypi.org/project/display-server-interactions/)
[](https://github.com/Commandcracker/display-server-interactions/blob/main/LICENSE.txt)
[](https://github.com/Commandcracker/display-server-interactions/stargazers)
[](https://github.com/Commandcracker/display-server-interactions/network)
[](https://github.com/Commandcracker/display-server-interactions/issues)
[](https://github.com/Commandcracker/display-server-interactions/actions/workflows/pypi-publish.yml)
DSI allows you to perform basic interactions on your display server, like screenshotting a window or sending input to it.
Currently, DSI only supports X11/Xorg (GNU/Linux) and Windows but it aims to be cross-platform.
**WARNING: Please Do not use DSI in production, because it's currently in development!**
## Quick overview
Look at the [documentation](https://display-server-interactions.readthedocs.io/en/latest/) for moor information
### Get a window
```python
from display_server_interactions import DSI
dsi = DSI()
window = dsi.get_active_window()
```
### Get basic window information
```python
print("Active window: ")
print("\tName: {}".format(window.name))
print("\tPID: {}".format(window.pid))
```
### Take a screenshot of the window
```python
import cv2
import numpy as np
img = np.array(window.get_image())
cv2.imshow(f'Screenshot of "{window.name}"', img)
while True:
if cv2.waitKey(1) & 0xFF == ord('q'):
break
```
### Sending keys to a window
```python
window.send_str("Hello World")
```
### Move the mouse pointer
```python
window.warp_pointer(x=42, y=73)
```
### Sending mouse clicks
```python
window.send_mouse_click(x=42, y=73)
```
نحوه نصب
نصب پکیج whl display-server-interactions-0.0.dev9:
pip install display-server-interactions-0.0.dev9.whl
نصب پکیج tar.gz display-server-interactions-0.0.dev9:
pip install display-server-interactions-0.0.dev9.tar.gz