最後編輯 2020-11-01
列舉的種類基本上是生產力、健康相關,或是好用的工程師潮流精品(?)
這些是我偏好或想要的裝備,歡迎留言提供其他推薦裝備、發問為何要用或不用某個裝備、品牌。
免費的工具軟體雖然也很重要,但不在這邊討論,有興趣請查看 我的 Mac 環境設定。
| import string #匯入模組string | |
| import random #匯入模組random | |
| chs = string.ascii_letters + string.digits #ascill編碼的英文字母大小寫letters 以及 加入ascill數字 | |
| pwd="" | |
| for x in range(random.randint(8,12)): #會回傳8-12次的數字 | |
| pwd+=random.choice(chs) #隨機選一個 | |
| print(pwd) #列印出來 |
| def _move_leter(letter, n): | |
| """ | |
| 把字母變為字母表後n位的字母,z后面接a | |
| :param letter: 小写字母 | |
| :param n: 要移動的字母 | |
| :return: 移動的结果 | |
| """ | |
| return chr((ord(letter) - ord('a') + n) % 26 + ord('a')) | |
| Class PwdException(Exception): | |
| def _init_(self,pwd,len): | |
| super(). _init_(self) #呼叫基礎類別 | |
| self.pwd = pwd | |
| self.len = len | |
| try: | |
| pwd = input('請輸入密碼,長度至少為8個字元') | |
| if len(pwd) < 8: | |
| raise PwdException(pwd,len(pwd)) |
最後編輯 2020-11-01
列舉的種類基本上是生產力、健康相關,或是好用的工程師潮流精品(?)
這些是我偏好或想要的裝備,歡迎留言提供其他推薦裝備、發問為何要用或不用某個裝備、品牌。
免費的工具軟體雖然也很重要,但不在這邊討論,有興趣請查看 我的 Mac 環境設定。