We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb1e1e6 commit 1f90b0dCopy full SHA for 1f90b0d
xianhuan/README.md
@@ -10,6 +10,8 @@ Python技术 公众号文章代码库
10
11
## 实例代码
12
13
+[几个有趣且有用的Python自动化脚本](https://github.com/JustDoPython/python-examples/tree/master/xianhuan/pyscripts):几个有趣且有用的Python自动化脚本
14
+
15
[用 Python 实现图片转字符画,so easy!](https://github.com/JustDoPython/python-examples/tree/master/xianhuan/charPic):用 Python 实现图片转字符画,so easy!
16
17
[绝了!自动点赞,我用 PyAutoGUI!](https://github.com/JustDoPython/python-examples/tree/master/xianhuan/pyautogui2):绝了!自动点赞,我用 PyAutoGUI!
xianhuan/pyscripts/draftPic
@@ -0,0 +1,22 @@
1
+import cv2
2
3
+img = cv2.imread("C:\\pworkspace\\mypy\\pythontech\\funnyscripts\\elon.png")
4
5
+ ## Image to Gray Image
6
+gray_image = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
7
8
+ ## Gray Image to Inverted Gray Image
9
+inverted_gray_image = 255-gray_image
+ ## Blurring The Inverted Gray Image
+blurred_inverted_gray_image = cv2.GaussianBlur(inverted_gray_image, (19,19),0)
+ ## Inverting the blurred image
+inverted_blurred_image = 255-blurred_inverted_gray_image
+ ### Preparing Photo sketching
18
+sketck = cv2.divide(gray_image, inverted_blurred_image,scale= 256.0)
19
20
+cv2.imshow("Original Image",img)
21
+cv2.imshow("Pencil Sketch", sketck)
22
+cv2.waitKey(0)
xianhuan/pyscripts/pdfencry
@@ -0,0 +1,5 @@
+import pikepdf
+pdf = pikepdf.open("test.pdf")
+pdf.save('encrypt.pdf', encryption=pikepdf.Encryption(owner="your_password", user="your_password", R=4))
+pdf.close()
xianhuan/pyscripts/sendEmail
@@ -0,0 +1,26 @@
+import smtplib
+from email.message import EmailMessage
+import pandas as pd
+def send_email(remail, rsubject, rcontent):
+ email = EmailMessage()
+ # 发件人邮箱
+ email['from'] = '发件人邮箱'
+ # 收件人邮箱
+ email['to'] = remail
+ # 主题
+ email['subject'] = rsubject
+ # 内容
+ email.set_content(rcontent)
+ with smtplib.SMTP(host='smtp.qq.com',port=25)as smtp:
+ smtp.ehlo()
+ smtp.starttls()
+ # 授权码登录
+ smtp.login("发件人邮箱","授权码")
+ smtp.send_message(email)
+ print("email send to ",remail)
23
+if __name__ == '__main__':
24
+ send_email('目标邮箱','test','test')
25
26
xianhuan/pyscripts/zipfile
+# 解压文件
+from zipfile import ZipFile
+unzip = ZipFile("C:\\Users\\cxhuan\\Downloads\\file_upload.zip", "r")
+unzip.extractall("C:\\Users\\cxhuan\\Downloads\\file_upload")
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments