Created
November 12, 2022 15:48
-
-
Save synodriver/5e6d80ede7cd1eaa09ed5cfe21229661 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from matplotlib import pyplot as plt | |
from PIL import Image,ImageColor, ImageDraw, ImageFont | |
import numpy as np | |
import zhconv | |
text = """A140 , 、 。 . ‧ ; : ? ! ︰ … ‥ ﹐ ﹑ ﹒ | |
A150 · ﹔ ﹕ ﹖ ﹗ | – ︱ — ︳ ╴ ︴ ﹏ ( ) ︵ | |
A160 ︶ { } ︷ ︸ 〔 〕 ︹ ︺ 【 】 ︻ ︼ 《 》 ︽ | |
A170 ︾ 〈 〉 ︿ ﹀ 「 」 ﹁ ﹂ 『 』 ﹃ ﹄ ﹙ ﹚ | |
A1A0 ﹛ ﹜ ﹝ ﹞ ‘ ’ “ ” 〝 〞 ‵ ′ # & * | |
A1B0 ※ § 〃 ○ ● △ ▲ ◎ ☆ ★ ◇ ◆ □ ■ ▽ ▼ | |
A1C0 ㊣ ℅ ¯  ̄ _ ˍ ﹉ ﹊ ﹍ ﹎ ﹋ ﹌ ﹟ ﹠ ﹡ + | |
A1D0 - × ÷ ± √ < > = ≦ ≧ ≠ ∞ ≒ ≡ ﹢ ﹣ | |
A1E0 ﹤ ﹥ ﹦ ~ ∩ ∪ ⊥ ∠ ∟ ⊿ ㏒ ㏑ ∫ ∮ ∵ ∴ | |
A1F0 ♀ ♂ ⊕ ⊙ ↑ ↓ ← → ↖ ↗ ↙ ↘ ∥ ∣ / """ | |
text = re.sub(r"[A-Z]\d[0-9A-F]0", "", text) | |
text = zhconv.convert(text, "zh-hans") | |
print(text) | |
import ctypes | |
from ctypes.wintypes import LPDWORD, DWORD | |
kernel32 = ctypes.windll.kernel32 | |
GetConsoleProcessList = kernel32.GetConsoleProcessList | |
GetConsoleProcessList.argtypes = [LPDWORD, DWORD] | |
GetConsoleProcessList.restype = DWORD | |
ids_t = DWORD*5 | |
ids = ids_t() | |
GetConsoleProcessList(ids, 5) | |
im = Image.new('RGB', (200, 200), color="black") | |
draw = ImageDraw.Draw(im) | |
font = ImageFont.truetype(font='simsun.ttc', size=8) | |
draw.text(xy=(10, 10), text=text, fill=(255, 255, 255), font=font) | |
plt.imshow(np.asarray(im)) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment