前言:这是初学时写的小项目,觉得有意思就写来玩玩,也当是巩固刚学习的知识。现在看来很不成熟,但还是记录一下做个纪念好了~

  1、名称网上网上银行及购物商城  

  2、项目结构

  当时刚接触python啦,哪里注意什么项目结构,就一脑子全塞到一个文件里面了

  

  •   代码全部在bank.py里面
  •   admin.txt记录所有用户的名字和密码(当时还不会用数据库)
  •   locked.txt记录被锁定用户的帐号
  •   huahua.pk是记录huahua这个用户的流水和消费情况

  3、效果:

  

  4、主要功能

  1.网上银行功能:

  •   能显示用户名与余额
  • 输入密码三次错误就锁定
  •   实现取钱,手续费3%
  •   将取钱记录写入账单中
  •   查看月流水
  •   每月的最后一天出账单

  2.购物商城功能:

  •   选购商品
  •   可以使用信用卡
  •   查看购物车
  •   购物车增加、删除商品
  •   结算扣款计入月账单

  5、设计过程

  5.1首先设置admin.txt中的用户名和密码

  5.2很骚气的设置打印出字体的颜色

  1. # 设置打印字体的颜色
  2. class change_color:
  3. HEADER = '\033[95m'
  4. OKBLUE = '\033[94m'
  5. OKGREEN = '\033[92m'
  6. WARNING = '\033[93m'
  7. FAIL = '\033[91m'
  8. ENDC = '\033[0m'
  9.  
  10. def disable(self):
  11. self.HEADER = ''
  12. self.OKBLUE = ''
  13. self.OKGREEN = ''
  14. self.WARNING = ''
  15. self.FAIL = ''
  16. self.ENDC = ''

  5.3验证帐号的函数

  判断帐号是否存在、锁定、密码是否正确,三次密码不正确就锁定该用户(写入lock 文件)

  1. # 判断帐号是否存在
  2. def admin_is_exist(user_admin):
  3. with open(admin_file, 'rb') as li:
  4. for i in li.readlines():
  5. i = i.strip().split()
  6. if user_admin in i:
  7. return True
  8. else:
  9. print '\n\t\t\t'+change_color.WARNING+'This admin is not exist! Please try again!'+change_color.ENDC
  10. return False
  11.  
  12. # 判断帐号是否被锁定
  13. def admin_is_locked(user_admin):
  14. with open(lock_file, 'rb') as lock:
  15. for i in lock.xreadlines():
  16. i = i.strip().split()
  17. if user_admin in i:
  18. print '\n\t\t\t'+change_color.WARNING+'This admin in locked! Please try another admin!'+change_color.ENDC
  19. return False
  20. else:
  21. return True
  22.  
  23. # 判断密码是否匹配
  24. def password_is_match(user_admin, pass_word):
  25. with open(admin_file, 'rb') as admin:
  26. for i in admin.readlines():
  27. i = i.strip().split()
  28. if user_admin in i:
  29. if pass_word == i[1]:
  30. return True
  31. else:
  32. return False
  33.  
  34. # 锁定用户
  35. def lock_user(user_admin):
  36. lock = open(lock_file, 'ab')
  37. lock.write('\n' + user_admin)
  38. lock.close()
  39. print '\n\t\t\t'+change_color.WARNING+'Password do not match admin for 3 times! Admin is locked!'+change_color.ENDC

  5.4网上银行相关函数

  给每个用户建立一个以该用户名为标题的账单、写入月账单、写入并读取余额、取钱、打印用户流水

  1. # 计算提现所需的余额(包括手续费)
  2. def caculate_cash_with_fee(cash):
  3. total = cash + cash * 0.05
  4. return total
  5.  
  6. # 计算取现后的余额
  7. def balance_caculate(cash, balance):
  8. total = balance - cash - cash * 0.05
  9. return total
  10.  
  11. # 初始化余额,如果有余额就不变,没有就初始化一个 (出错,文件为空)
  12. def create_dict_in_balance():
  13. filename = balance_file
  14. if os.path.exists(filename):
  15. if os.path.getsize(filename):
  16. return 0
  17. else:
  18. fw = open(filename, 'wb')
  19. user_balance = {'weiwei': 1520000, 'huahua': 52000, 'xiaoji': 100}
  20. pickle.dump(user_balance, fw)
  21. fw.close()
  22. return 'new one'
  23.  
  24. # 存储余额消息 # 每次初始化都替代,要改
  25. def save_balance(user_admin, balance):
  26. fr = open(balance_file, 'rb')
  27. user_balance = pickle.load(fr)
  28. user_balance[user_admin] = balance
  29. fr.close()
  30. fw = open(balance_file, 'wb')
  31. pickle.dump(user_balance, fw)
  32. fw.close()
  33.  
  34. # 在每个用户的流水文件中存入一个新的名字相同的列表
  35. def create_list_in_accout(user_admin):
  36. filename = u'%s\\%s.pk' % BASE_DIR, user_admin
  37. if os.path.exists(filename): # 如果文件存在
  38. with open(filename, 'rb') as f:
  39. li = pickle.load(f)
  40. if 'accout_list' == li: # 列表存在,不改变
  41. return 0
  42. else: # 文件或列表不存在,创建
  43. fw = open(filename, 'wb')
  44. accout_list = []
  45. pickle.dump(accout_list, fw)
  46. fw.close()
  47. return 'new list'
  48.  
  49. # 存储用户流水 (序列化存储多个数据时最好使用列表等方式) # 要改成‘withdraw’和‘shop’两种形式,增加一个参数
  50. def save_current_accout(user_admin, way, cash, balance):
  51. current_accout = 'time: %s %s: %d balance: %d' % (time.strftime('%y-%m-%d %H:%M:%S'), way, cash, balance)
  52. fr = open(u'%s\\%s.pk' % BASE_DIR, user_admin, 'rb')
  53. accout_list = pickle.load(fr)
  54. accout_list.append(current_accout) # 将新的流水写入列表
  55. fr.close()
  56. fw = open(u'%s\\%s.pk' % BASE_DIR, user_admin, 'wb')
  57. pickle.dump(accout_list, fw)
  58. fw.close()
  59. return current_accout
  60.  
  61. # 打印用户流水
  62. def print_user_accout(user_admin):
  63. f = open(u'%s\\%s.pk' % BASE_DIR, user_admin, 'rb')
  64. accout_list = pickle.load(f)
  65. f.close()
  66. for i in accout_list:
  67. print i
  68.  
  69. # 读出某用户文档中的余额
  70. def read_balance(user_admin):
  71. f = open(balance_file, 'rb')
  72. user_balance = pickle.load(f)
  73. f.close()
  74. return user_balance[user_admin]
  75.  
  76. # 读出余额的字典
  77. def read_balance_dict():
  78. f = open(balance_file, 'rb')
  79. user_balance = pickle.load(f)
  80. f.close()
  81. return user_balance

  5.5主函数

  购物这个功能是之后加的,所以直接在注函数实现,这样会让主函数十分冗余,不推荐。

  主函数就是一些基本的逻辑判断啊,人机交互之类的

  1. # (全局变量)用户余额信息
  2. shopping = {'orange': 30, 'milk': 50, 'bike': 200, 'lipstick': 350, 'bag': 3000, 'car': 100000, 'house': 1200000}
  3.  
  4. # 主程序
  5. if __name__ == '__main__':
  6. print '\n\t\t\t\t'+change_color.HEADER+'Welcome to Internet Bank!'+change_color.ENDC # 欢迎界面
  7. login = 1 # 为0表示已经登录进去了,为1表示尚未登录成功
  8. while login: # 登录主程序
  9. user_admin = raw_input('\n\t\t\t'+change_color.OKBLUE+'Please input your admin name:'+change_color.ENDC) # 输入帐号
  10. if admin_is_locked(user_admin): #判断帐号是否被锁定
  11. if admin_is_exist(user_admin): #判断帐号是否存在
  12. times = 3
  13. while times:# 可以输入密码三次
  14. pass_word = raw_input('\n\t\t\t'+change_color.OKBLUE+'Please input your password:'+change_color.ENDC) # 输入密码
  15. if password_is_match(user_admin, pass_word): # 密码正确,打印账户资料
  16. print '\n\t\t\t\t'+change_color.HEADER+'Welcome!'+change_color.ENDC
  17. login = 0
  18. break
  19. else:
  20. times -= 1
  21. print '\n\t\t\t'+change_color.WARNING+"Password do not match! You still have "+str(times)+" times to try!" + change_color.ENDC
  22. if times == 0: # 输入密码三次不正确,锁定用户
  23. lock_user(user_admin)
  24. print '\n\t\t\t'+change_color.WARNING+"%s is locked " %user_admin + change_color.ENDC
  25. sys.exit()
  26.  
  27. # 网上银行界面
  28. if login == 0:
  29. create_list_in_accout(user_admin)
  30. create_dict_in_balance()
  31. user_interface = 1
  32. while user_interface:
  33. print '\n\t\t\t'+change_color.OKBLUE+'''
  34. #################################################
  35. user name: %s
  36. user balance: %s
  37.  
  38. Operation:
  39. 1.withdraw cash
  40. 2.shopping
  41. 3.month account
  42. 4.exit
  43.  
  44. #################################################
  45. ''' % (user_admin, read_balance(user_admin)) + change_color.ENDC
  46.  
  47. # 用户选择要进行的操作
  48. operation = input('\n\t\t\t'+change_color.OKBLUE+'Please input the number of operation(1/2/3/4):'+change_color.ENDC)
  49.  
  50. if operation == 1: # 提现操作
  51. cash_interface = 1
  52. while cash_interface:
  53. cash = input('\n\t\t\t'+change_color.OKBLUE+'Please input cash you want:'+change_color.ENDC)
  54. user_balance = read_balance_dict()
  55. if user_balance[user_admin] >= caculate_cash_with_fee(cash): # 提现的钱不超过余额
  56. if cash <= 15000: # 小于额度
  57. balance = balance_caculate(cash, user_balance[user_admin]) # 计算新的余额
  58. print '\n\t\t\t'+change_color.OKGREEN+'You can take your cash! Your card still have %s:' % balance + change_color.ENDC
  59. # 将余额写入文档
  60. save_balance(user_admin, balance)
  61. # 将流水写入文档(做成函数)
  62. save_current_accout(user_admin, 'withdraw cash', cash, balance)
  63. else:
  64. print '\n\t\t\t'+change_color.WARNING+'You can not take more than 15000!'+change_color.ENDC
  65. else:
  66. print '\n\t\t\t'+change_color.WARNING+'You balance is not enough!'+change_color.ENDC
  67. # 选择是否继续
  68. choice = raw_input('\n\t\t\t'+change_color.OKBLUE+'Do you want to continue?(y/n):'+change_color.ENDC)
  69. if choice == 'y': # 继续提现
  70. continue
  71. else: # 返回主界面
  72. cash_interface = 0
  73.  
  74. if operation == 2: # 购物车系统
  75. buy_count = {} # 存放已经买的东西的种类
  76. buy_counts = [] # 所有东西都直接加到购物车中
  77. buy_balance = read_balance(user_admin)
  78. can_buy = 1
  79. while can_buy:
  80. print '\n\t\t\t\t'+change_color.OKBLUE+'Welcome for shopping!'+change_color.ENDC
  81. print
  82. print '\n\t\t\t\t'+change_color.OKBLUE+'****************************************'+change_color.ENDC
  83.  
  84. for i in enumerate(sorted(shopping.items(), key = lambda item:item[1]), 1): # 将字典中的元素转换成元组排序,编号并输出
  85. print '\t\t\t\t'+change_color.OKBLUE+'%d %s %d'% (i[0], i[1][0], i[1][1]) + change_color.ENDC
  86.  
  87. print '\t\t\t\t'+change_color.OKBLUE+'****************************************'+change_color.ENDC
  88.  
  89. # 读取用户余额
  90. print '\n\t\t\t'+change_color.OKBLUE+'You balance: %d' % buy_balance +change_color.ENDC
  91.  
  92. # 用户选择要进行的操作
  93. buy = input('\n\t\t\t'+change_color.OKBLUE+'Please input the number of goods you want to buy(1/2/3/4/...):'+change_color.ENDC)
  94. shopping_list = sorted(shopping.items(), key=lambda item: item[1])
  95.  
  96. if buy_balance > shopping_list[buy - 1][1]: # 工资卡里的钱可以购买这样东西
  97. # 把东西放到购物车里
  98. buy_counts.append(shopping_list[buy - 1][0])
  99. print '\n\t\t\t'+change_color.OKGREEN+'%s is added into you shopping car' % shopping_list[buy - 1][0] +change_color.ENDC
  100. # 计算新的余额
  101. buy_balance -= shopping_list[buy - 1][1]
  102. else: # 钱不够, 使用信用额度
  103. credit = raw_input( '\n\t\t\t'+change_color.WARNING+'Balance is not enough! Using credit(y/n)?'+change_color.ENDC)
  104. if credit =='y':
  105. # 把东西放到购物车里
  106. buy_counts.append(shopping_list[buy - 1][0])
  107. print '\n\t\t\t'+change_color.OKGREEN+'%s is added into you shopping car' % shopping_list[buy - 1][0] +change_color.ENDC
  108. # 计算新的余额
  109. buy_balance -= shopping_list[buy - 1][1]
  110. choice = raw_input('\n\t\t\t'+change_color.OKBLUE+'Continue?(y/n)'+change_color.ENDC) # 是否继续
  111. if choice == 'y':
  112. continue
  113. if choice == 'n':
  114. finish = 1
  115. while finish:
  116. print '\n\t\t\t'+change_color.OKBLUE+'''
  117. #################################################
  118.  
  119. Operation:
  120. 1.watch shopping car
  121. 2.add
  122. 3.reduce
  123. 4.accout
  124. 5.exit to user interface
  125. 6.exit system
  126.  
  127. #################################################
  128. ''' + change_color.ENDC
  129. # 用户选择要进行的操作
  130. buy_operation = input('\n\t\t\t'+change_color.OKBLUE+'Please input the number of operation(1/2/3/4/5):'+change_color.ENDC)
  131.  
  132. if buy_operation == 1: # 查看购物车
  133. # 购物车列表转换为集合去重
  134. buy_count = set(buy_counts)
  135. buy_list = list(buy_count)
  136. print '\n\t\t\t\t'+change_color.OKBLUE+'number name price amount' + change_color.ENDC # 打印选购的商品价格和数量
  137. for i in enumerate(buy_list, 1):
  138. print '\t\t\t\t'+change_color.OKBLUE+'%s %s %d %d' % (i[0], i[1], shopping[i[1]], buy_counts.count(i)) + change_color.ENDC
  139. print '\n\t\t\t'+change_color.OKGREEN+'All above is: %d' % (read_balance(user_admin) - buy_balance) +change_color.ENDC # 打印总价
  140. print '\n\t\t\t'+change_color.WARNING+ '10s later will come back to shopping operate interface' +change_color.ENDC
  141. time.sleep(10)
  142.  
  143. if buy_operation == 2: # 增加购物车里的东西
  144. finish = 0
  145.  
  146. if buy_operation == 3: # 减去购物车里的东西
  147. undo_finish = 1
  148. while undo_finish:
  149. # 读取用户余额
  150. print '\n\t\t\t'+change_color.OKBLUE+'You balance: %d' % buy_balance +change_color.ENDC
  151. # 打印购物车
  152. buy_count = set(buy_counts)
  153. buy_list = list(buy_count)
  154. print '\n\t\t\t\t'+change_color.OKBLUE+'number name price amount' + change_color.ENDC # 打印选购的商品价格和数量
  155. for i in enumerate(buy_list, 1):
  156. print '\t\t\t\t'+change_color.OKBLUE+'%s %s %d %d' % (i[0], i[1], shopping[i[1]], buy_counts.count(i)) + change_color.ENDC
  157. print '\n\t\t\t'+change_color.OKGREEN+'All above is: %d' % (read_balance(user_admin) - buy_balance) +change_color.ENDC # 打印总价
  158.  
  159. # 用户选择要进行的操作
  160. undo = input('\n\t\t\t'+change_color.OKBLUE+'Please input the number of goods you want to reduce(1/2/...):'+change_color.ENDC)
  161.  
  162. if buy_list[undo - 1] in buy_counts: # 如果商品在购物车中,删除
  163. buy_counts.remove(buy_list[undo - 1])
  164. print '\n\t\t\t'+change_color.OKGREEN+'%s is delete from you shopping car' % shopping_list[undo - 1][0] +change_color.ENDC
  165. # 计算新的余额
  166. buy_balance += shopping[buy_list[undo - 1]]
  167. else: # 购物车里没有该物品
  168. print '\n\t\t\t'+change_color.WARNING+'%s is not in you shopping car' % buy_list[undo - 1]+change_color.ENDC
  169.  
  170. undo_choice = raw_input('\n\t\t\t'+change_color.OKBLUE+'Continue?(y/n)'+change_color.ENDC) # 是否继续
  171. if undo_choice == 'y':
  172. continue
  173. if undo_choice == 'n':
  174. undo_finish = 0
  175.  
  176. if buy_operation == 4: # 结算
  177. buy_count = set(buy_counts)
  178. buy_list = list(buy_count)
  179. print '\n\t\t\t\t'+change_color.OKBLUE+'name price amount' + change_color.ENDC # 打印选购的商品价格和数量
  180. for i in buy_list:
  181. print '\t\t\t\t'+change_color.OKBLUE+'%s %d %d'% (i, shopping[i], buy_counts.count(i)) + change_color.ENDC
  182. total = read_balance(user_admin) - buy_balance
  183. print '\n\t\t\t'+change_color.OKGREEN+'All above is: %d' % total +change_color.ENDC # 打印总价
  184.  
  185. pay = raw_input('\n\t\t\t'+change_color.OKGREEN+'Do you want to pay(y/n)?'+change_color.ENDC)
  186. if pay == 'y': # 确认付款,将流水和余额写入文件
  187. # 余额
  188. save_balance(user_admin, buy_balance)
  189. print '\n\t\t\t'+change_color.OKGREEN+'Successful payment!'+change_color.ENDC
  190. print '\n\t\t\t'+change_color.OKBLUE+'You balance: %d' % buy_balance +change_color.ENDC
  191. # 流水写入文件
  192. save_current_accout(user_admin, 'shopping', total, buy_balance)
  193. finish = 0 # 返回主界面
  194. can_buy = 0
  195. time.sleep(3)
  196. if pay == 'n': # 如果不付款,返回商品操作界面
  197. can_buy = 0
  198.  
  199. if buy_operation == 5: # 退回主界面
  200. print '\n\t\t\t\t'+change_color.HEADER+'Thanks for Internet shopping!'+change_color.ENDC
  201. finish = 0
  202. can_buy = 0
  203.  
  204. if buy_operation == 6: # 退出
  205. print '\n\t\t\t\t'+change_color.HEADER+'Thanks for Internet shopping!'+change_color.ENDC
  206. sys.exit()
  207.  
  208. if not (buy_operation == 1 or buy_operation == 2 or buy_operation == 3 or buy_operation == 4 or buy_operation == 5 or buy_operation == 6):
  209. print '\n\t\t\t'+change_color.WARNING+'You have to input number as(1/2/3/...)'+change_color.ENDC
  210. time.sleep(3)
  211.  
  212. if operation == 3: # 查看流水账操作 #'dict' object has no attribute 'readline
  213. print_user_accout(user_admin)
  214. print '\n\t\t\t'+change_color.WARNING+'10s later will come back to user interface'+change_color.ENDC
  215. time.sleep(10)
  216.  
  217. if operation == 4: # 退出系统
  218. print '\n\t\t\t\t'+change_color.HEADER+'Thanks for using Internet Bank!'+change_color.ENDC
  219. sys.exit()
  220.  
  221. if not (operation == 1 or operation == 2 or operation == 3 or operation == 4):
  222. print '\n\t\t\t'+change_color.WARNING+'You have to input number as(1/2/3/...)'+change_color.ENDC
  223. time.sleep(3)

  整个系统的逻辑其实很简单,说一下我在这个过程中遇到的问题吧。

  由于我刚刚接触这个语言,代码写的非常不整洁,冗余部分很多(我的主函数太长了,长到我自己都有点懵),其实可以把很多部分单独拎出来作为一个函数,这样整个项目的可读性比较好。还有很多不足之处,一时也说不上来,等我回去想想~

  我会把整个项目贴在我的github上,欢迎大家来提供意见~

  完整项目代码 :https://github.com/huahua462/bank-sopping

Python实战之网上银行及购物商城的更多相关文章

  1. 洗礼灵魂,修炼python(81)--全栈项目实战篇(9)—— 购物商城登录验证系统

    都在线购物过吧?那么你应该体验过,当没有登录账户时,点开购物车,个人中心,收藏物品等的操作时,都会直接跳转到登录账户的界面,然后如果登录一次后就不用再登录,直到用户登出. 是的,本次项目就是做一个登录 ...

  2. Python开发程序:ATM+购物商城

    一.程序要求 模拟实现一个ATM + 购物商城程序 额度 15000或自定义 实现购物商城,买东西加入 购物车,调用信用卡接口结账 可以提现,手续费5% 每月22号出账单,每月10号为还款日,过期未还 ...

  3. Python实现ATM+购物商城

    需求: 模拟实现一个ATM + 购物商城程序 额度 15000或自定义 实现购物商城,买东西加入 购物车,调用信用卡接口结账 可以提现,手续费5% 每月22号出账单,每月10号为还款日,过期未还,按欠 ...

  4. Python学习笔记-练习编写ATM+购物车(购物商城)

    作业需求: 模拟实现一个ATM + 购物商城程序: 1.额度 15000或自定义 2.实现购物商城,买东西加入 购物车,调用信用卡接口结账 3.可以提现,手续费5% 4.支持多账户登录 5.支持账户间 ...

  5. python day19 : 购物商城作业,进程与多线程

    目录 python day 19 1. 购物商城作业要求 2. 多进程 2.1 简述多进程 2.2 multiprocessing模块,创建多进程程序 2.3 if name=='main'的说明 2 ...

  6. python 信用卡系统+购物商城见解

    通过完成信用卡系统+购物商城 使自己在利用 字典和列表方面有了较大的提升,感悟很深, 下面将我对此次作业所展示的重点列表如下: #!/usr/bin/env python3.5 # -*-coding ...

  7. Python 实现购物商城,含有用户入口和商家入口

    这是模拟淘宝的一个简易的购物商城程序. 用户入口具有以下功能: 登录认证 可以锁定用户 密码输入次数大于3次,锁定用户名 连续三次输错用户名退出程序 可以选择直接购买,也可以选择加入购物车 用户使用支 ...

  8. Python实战之ATM+购物车

    ATM + 购物车 需求分析 ''' - 额度 15000或自定义 - 实现购物商城,买东西加入 购物车,调用信用卡接口结账 - 可以提现,手续费5% - 支持多账户登录 - 支持账户间转账 - 记录 ...

  9. 商城项目实战 | 1.1 Android 仿京东商城底部布局的选择效果 —— Selector 选择器的实现

    前言 本文为菜鸟窝作者刘婷的连载."商城项目实战"系列来聊聊仿"京东淘宝的购物商城"如何实现. 京东商城的底部布局的选择效果看上去很复杂,其实很简单,这主要是要 ...

随机推荐

  1. Element ui 中的Upload用法

    效果图: 代码:

  2. 安装k8s集群(亲测)

    先安装一台虚拟机,然后进行克隆,因为前面的步骤都是一样的,具体代码如下: Last login: Mon Nov 25 00:40:34 2019 from 192.168.180.1 ##安装依赖包 ...

  3. 【BZOJ2200】道路和航线(并查集,拓扑排序,最短路)

    题意:n个点,有m1条双向边,m2条单向边,双向边边长非负,单向边可能为负 保证如果有一条从x到y的单项边,则不可能存在从y到x的路径 问从S出发到其他所有点的最短路 n<=25000,n1,m ...

  4. Numpy基础(数组创建,切片,通用函数)

    1.创建ndarray 数组的创建函数: array:将输入的数据(列表,元组,数组,或者其他序列类型)转换为ndarray.要么推断出dtype,要么显式给定dtype asarray:将输入转换为 ...

  5. 洛谷P1309 瑞士轮——题解

    题目传送 思路非常简单,只要开始时把结构体排个序,每次给赢的加分再排序,共r次,最后再输出分数第q大的就行了. (天真的我估错时间复杂度用每次用sort暴力排序结果60分...)实际上这道题估算时间复 ...

  6. 修改springboot控制台输出的图案

    原本启动springboot项目的日志是这样的: 但是我喜欢看见自己的名字,于是: 1.在src\main\resources文件夹下新建banner.txt 2.登录网站  patorjk.com/ ...

  7. Codeforce |Educational Codeforces Round 77 (Rated for Div. 2) B. Obtain Two Zeroes

    B. Obtain Two Zeroes time limit per test 1 second memory limit per test 256 megabytes input standard ...

  8. 如何在Ecplise调试之后恢复原来的界面

    在我们用Eclipse调试代码的时候,可以通过设置断点来调试,但是调试之后我们的界面会跟之前的不同,通过以下的方法可以让Eclipse的界面恢复成调试之前的样子. 在Ecplise中找到Window, ...

  9. Charles抓取手机https请求

    1.下载Charles工具,3.92破解版:http://pan.baidu.com/s/1cko2L4 密码:chmy 2.安装SSL证书,默认安装就可以 3.证书安装成功后,点击详细信息--> ...

  10. es之java搜索文档

    1:搜索文档数据(单个索引) @Test public void getSingleDocument(){ GetResponse response = client.prepareGet(" ...