Skip to main content

print2message

程序在办公室计算机上运行,想实时了解程序的运行情况或结果?Print2message可以帮你将print内容转发到电子邮件或微信。

安装

pip install print2message

使用

  • 新建yaml配置文件,内容如下:
basic:
    subject: 测试用
    method: mail
    switch: true
wechat:
    key: SCU*************
mail:
    host: smtp.qq.com
    port: 25
    password: abcdefg
    user_name: 123456789
    sender: 123456789@qq.com
    receiver: 1234567819@qq.com

basic.subject:项目名称,作为消息通知的标题
basic.method:通知方式,wechat或mail
basic.swith:是否通知,false将不转发print内容,只单纯执行print功能
wechat.key:server酱的SCKEY,免费注册
mail:邮箱的相关参数

  • 使用set_config_path指定配置文件位置

example

from print2message import set_config_path, printm
import os

current_path = os.path.dirname(os.path.abspath(__file__))

set_config_path(os.path.join(current_path, 'config.yaml'))

if __name__ == "__main__":
    printm('hello print2msg')

Metadata

Release files for print2message 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for print2message 1.1.0
File Size Uploaded
print2message-1.1.0.tar.gz 3.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for print2message 1.1.0
File Interpreter ABI Platform
print2message-1.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 6.0 kB

Release files / print2message-1.1.0.tar.gz

Download URL print2message-1.1.0.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0fb7a031ca7cf446cdcb3a870865b32c7aa2f71f942066f740eac250596bdc2f
BLAKE2b-256 checksum
How to use checksums
8e930c28a0364b8ccf5d71ed7d8b9c563b2361c818f2fe057ce9253bd2801f03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2

Release files / print2message-1.1.0-py2.py3-none-any.whl

Download URL print2message-1.1.0-py2.py3-none-any.whl
Size 3.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f4669530f3647fa539a3bb8ca4f71aad69a3b4283421bf4f76ed1cebaac5cc80
BLAKE2b-256 checksum
How to use checksums
e5dae4aa6e1df8d34a05dbd1260db243580e8f8af3d908921b3cc19b28dce169
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page