stampa i pdf da un gruppo google a una stampate di rete hp
10K+
This script downloads PDF attachments from unread emails in Gmail that have the label "stampa", prints them to a printer and changes the label to "stampata" (meaning "printed" in Italian). The script runs continuously and checks for new emails every minute.
This script requires Python 3 and the following Python packages:
osbase64syspickleloggingtimecupsjsongoogle-authgoogle-auth-oauthlibgoogle-auth-httplib2google-api-python-clientThe script also requires a credentials.json file containing the Google API credentials for the Gmail account that will be accessed, and a printer that can receive data via port 9100.
To install the required packages, run:
pip install -r requirements.txt
where requirements.txt is a file containing the names of the required packages.
To use this script:
credentials.json.PRINTER_IP variable in the script to match the IP address of the printer.python print_email_attachments.py
The script will continuously check for new unread emails with attachments and the label "stampa", download any PDF attachments, print them to the specified printer, and change the label to "stampata". The script will repeat this process every minute until interrupted.
The script logs its activity to a file called log_file.log in the same directory as the script. The log file contains information about the script's activity, including any errors that occurred during execution.
This script is licensed under the MIT License.
Content type
Image
Digest
sha256:d4e137cd6…
Size
210.2 MB
Last updated
over 3 years ago
docker pull jacklugano/pdf-printer