forked from 35enidoi/MisT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutil.py
44 lines (40 loc) · 1.19 KB
/
util.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
def pypcopy(url):
"""
copyする奴
optionalのpyperclipがあればcopyする"""
try:
import pyperclip
try:
pyperclip.copy(url)
return True
except pyperclip.PyperclipException:
return False
except (ImportError):
return False
def webshow(url):
"""
WEBを開く関数
デスクトップ環境がない場合動作しないことを確認済み(Raspberry Pi OS Lite(Bullseye) : Raspberrypi Zero 2 W)(SSH接続)"""
import webbrowser
webbrowser.open(url)
def mistfigleter():
"""
'MisT'をFiglet化する関数"""
from pyfiglet import figlet_format
from random import randint
fonts = ["binary","chunky","contessa","cybermedium","hex","eftifont","italic","mini","morse","short"]
randomint = randint(0,len(fonts)+1)
if randomint == len(fonts):
mist_figs = "MisT\n"
elif randomint == len(fonts)+1:
mist_figs = """
MM MM TTTTTTTTTTT
M M M M I T
M M M M I SSS T
M M M S T
M M I SSS T
M M I S T
M M I SSS T """
else:
mist_figs = figlet_format("MisT",fonts[randomint])
return mist_figs