关于Oppen Live Writer中插入可折叠代码的插件
Posted vcan123
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于Oppen Live Writer中插入可折叠代码的插件相关的知识,希望对你有一定的参考价值。
插件:OLW Plugins
提取码:ex9m
1.在Oppen Live Writer安装目录下的app_xx目录下创建Plugins文件夹
2.将下载的压缩包解压后将文件夹中的所有文件复制到Plugins文件夹下即可.
这个插件也是在其他大佬的博客中找到的,推荐一下,挺不错的。
插入代码折叠方式可如下
1 __Author__ = "YiMi Du" 2 3 from core import auth 4 from core import creditcard 5 from core import log 6 from core import shopping 7 from core import user 8 def main_list(): 9 msg = [" ATM ", 10 "购物商城", 11 "管理系统", 12 "退出程序 输入 q", ] 13 14 index = 0 15 for i in msg: 16 print(" ", index + 1, " ", i) 17 index += 1 18 19 20 ‘‘‘ATM页面列表‘‘‘ 21 22 23 def atm_list(): 24 msg = ["信用卡信息", 25 "信用卡取现", 26 "信用卡转账", 27 "信用卡还款", 28 "申请信用卡", 29 "信用卡绑定", 30 "信用卡流水", 31 "返回上一层 输入 q", 32 "退出程序 输入 exit"] 33 34 index = 0 35 for i in msg: 36 print(" ", index + 1, " ", i) 37 index += 1 38 39 40 ‘‘‘购物车页面列表‘‘‘ 41 42 43 def shopp_list(): 44 msg = ["购物", 45 "购物车", 46 "购物结算", 47 "购物记录", 48 "清空购物车", 49 "返回上一层 输入 q", 50 "退出程序 输入 exit"] 51 52 index = 0 53 for i in msg: 54 print(" ", index + 1, " ", i) 55 index += 1 56 57 ‘‘‘管理员页面列表‘‘‘ 58 59 60 def admin_list(): 61 msg = ["冻结信用卡", 62 "解冻信用卡", 63 "创建用户", 64 "锁定用户", 65 "解锁用户", 66 "返回上一层 输入 q", 67 "退出程序 输入 exit"] 68 69 index = 0 70 for i in msg: 71 print(" ", index + 1, " ", i) 72 index += 1 73 74 ‘‘‘主函数‘‘‘ 75 76 def main(): 77 print("购物商城ATM系统".center(40, "-")) 78 user.lock() # 三次锁定模块 79 while True: 80 print("欢迎来到购物商城ATM系统".center(40, "-")) 81 print(" ID 信息") 82 main_list() 83 choice = input("请选择 ID :").strip() 84 if choice == "q": 85 print(" bye bye ".center(50, "-")) 86 exit() 87 if choice.isdigit(): 88 choice = int(choice) 89 if choice >= 1 and choice <= 4: 90 if choice == "q": break 91 while True: 92 if choice == 1: 93 print("欢迎来到信用卡中心".center(50, "-")) 94 print(" ID ATM信息") 95 atm_list() # 信用卡列表 96 atm_choice = input("请选择 ATM ID :").strip() 97 if atm_choice == "q": break 98 if atm_choice == "exit": exit() 99 if atm_choice.isdigit(): 100 atm_choice = int(atm_choice) 101 if atm_choice >= 1 and atm_choice <= 7: 102 while True: 103 if atm_choice == 1: 104 creditcard.creditcard_data() # 信用卡信息模块 105 break 106 elif atm_choice == 2: 107 creditcard.creditcard_auth() # 信用卡认证模块 108 creditcard.takenow() # 信用卡取现模块 109 break 110 elif atm_choice == 3: 111 creditcard.creditcard_auth() # 信用卡认证模块 112 creditcard.transfer() # 信用卡转账模块 113 break 114 elif atm_choice == 4: 115 creditcard.creditcard_auth() # 信用卡认证模块 116 creditcard.repayment() # 信用卡还款模块 117 break 118 elif atm_choice == 5: 119 creditcard.new_creditcard(limit=15000, locked=False) # 申请信用卡模块 120 break 121 elif atm_choice == 6: 122 creditcard.link_creditcard() # 用户绑定信用卡模块 123 break 124 elif atm_choice == 7: 125 creditcard.cat_cred_record() # 查看信用卡流水模块 126 break 127 else: 128 print("请输入正确的 ID ") 129 else: 130 print("请输入正确的 ID ") 131 132 elif choice == 2: 133 print("欢迎来到购物中心".center(50, "-")) 134 print(" ID 商城信息") 135 shopp_list() # 商城列表 136 shopp_choice = input("请选择 商城 ID :").strip() 137 if shopp_choice == "q": break 138 if shopp_choice == "exit": exit() 139 if shopp_choice.isdigit(): 140 shopp_choice = int(shopp_choice) 141 if shopp_choice >= 1 and shopp_choice <= 5: 142 while True: 143 if shopp_choice == 1: 144 shopping.shopping_mall() # 购物商城模块 145 break 146 elif shopp_choice == 2: 147 shopping.Shopping_car() # 购物车模块 148 break 149 elif shopp_choice == 3: 150 shopping.shopping_pay() # 购物结算模块 151 break 152 elif shopp_choice == 4: 153 shopping.cat_shopp_record() # 查看购物记录模块 154 break 155 elif shopp_choice == 5: 156 shopping.del_shopping_car() # 清空购物车模块 157 break 158 else: 159 print("请输入正确的 ID ") 160 else: 161 print("请输入正确的 ID ") 162 163 elif choice == 3: 164 print("欢迎来到管理中心".center(50, "-")) 165 print(" ID 操作信息") 166 admin_list() # 管理中心列表 167 admin_choice = input("请选择 信息 ID :").strip() 168 if admin_choice == "q": break 169 if admin_choice == "exit": exit() 170 if admin_choice.isdigit(): 171 admin_choice = int(admin_choice) 172 if admin_choice >= 1 and admin_choice <= 5: 173 while True: 174 if admin_choice == 1: 175 auth.admin_auth() # 管理员用户验证模块 176 creditcard.lock_creditcard() # 冻结信用卡模块 177 break 178 elif admin_choice == 2: 179 auth.admin_auth() # 管理员用户验证模块 180 creditcard.unlock_creditcard() # 解冻信用卡模块 181 break 182 elif admin_choice == 3: 183 auth.admin_auth() # 管理员用户验证模块 184 # 创建用户模块 185 user.new_user(address="None", locked=False, creditcard=False) 186 break 187 elif admin_choice == 4: 188 auth.admin_auth() # 管理员用户验证模块 189 user.lock_user() # 锁定用户模块 190 break 191 elif admin_choice == 5: 192 auth.admin_auth() # 管理员用户验证模块 193 user.unlock_user() # 解锁用户模块 194 break 195 196 elif choice == 4: 197 exit() 198 199
以上是关于关于Oppen Live Writer中插入可折叠代码的插件的主要内容,如果未能解决你的问题,请参考以下文章