这是最后一条NLP了......来吧
十二,动机和情绪总不会错,只是行为没有效果而已
动机在潜意识里,总是正面的。潜意识从来不会伤害自己,只会误会的以为某行为可以满足该动机,而又不知道有其他做法的可能。
情绪总是给我们一份推动力,情绪使我们在该事情之中有所学习,学到了,情绪便会消失。
我们可以接受一个人的动机和情绪,同时不接受他的行为。
接受动机和情绪,便是接受那个人,那个人也会感觉出你对他的接受,因而更肯让你去引导他做出改变。
任何一次行为不等于一个人。
行为不能接受,是因为没有效果,找出更好的做法,是两个人共同的目标,能使两个人有跟好的沟通和关系。
找出更好的做法的方法之一是追查动机背后的价值观。
员工信息表
题目:
接下来是代码了,哇果然是敲着敲着就发现好多以前从来没注意的东西,好多细节。
staff_list文件如下:
1,alex,22,13651054608,IT
2,egon,23,133043202533,teacher
3,nezha,25,1333235322,IT
代码:
1 #!usr/bin/env/ python 2 # -*- coding:utf-8 -*- 3 # Author: XiaoFeng 4 import os 5 li = ["id", "name", "age", "phone", "job"] 6 flag = False 7 staff_id = None 8 number = "xiaofeng" 9 word = "123456" 10 11 12 def login(func): 13 def inner(): 14 global flag 15 if not flag: 16 print("如想操作员工信息,请先等录:") 17 account = input("请输入您的账号:").strip() 18 password = input("请输入您的密码:").strip() 19 if account == number and password == word: 20 flag = True 21 print("登陆成功!") 22 res = func() 23 return res 24 else: 25 print("账号或密码错误,登陆失败!") 26 else: 27 res = func() 28 return res 29 return inner 30 31 32 def handle(content_1): 33 if "select" or "set" in content_1 and "where" in content_1: 34 info_start = content_1.index("t") + 1 35 info_end = content_1.index("where") - 1 36 info = content_1[info_start:info_end].strip() 37 condition = content_1[info_end + 6:].strip() 38 return info, condition 39 else: 40 print("输入错误!") 41 42 43 def seek(): 44 content = input("请输入操作:(如select name, age where age>22)").strip().lower() 45 if content.startswith("select") and "where" in content: 46 handle_str_1 = handle(content) 47 out_list = [] 48 for p in li: 49 if p in handle_str_1[1]: 50 if ">" in handle_str_1[1]: 51 info_list = handle_str_1[0].split(",") 52 str_info = " ".join(info_list) 53 info_list = str_info.split() # 去字符串内空格 54 index_0 = handle_str_1[1].index(">") 55 character = handle_str_1[1][:index_0].strip() 56 num = handle_str_1[1][index_0 + 1:].strip() 57 if num.isdigit(): 58 num = int(num) 59 with open("staff_list", "r", encoding="utf-8") as f: 60 for line in f: 61 if not line.isspace(): 62 line_list = line.strip().split(",") 63 character_value = int(line_list[li.index(character)]) 64 if character_value > num: 65 if handle_str_1[0].strip() == "*": 66 out = " ".join(line_list) 67 print(out) 68 out_list.clear() 69 else: 70 for n in info_list: 71 out_list.append(line_list[li.index(n)]) 72 out = " ".join(out_list) 73 print(out) 74 out_list.clear() 75 else: 76 print("请输入数字!") 77 elif "<" in handle_str_1[1]: 78 info_list = handle_str_1[0].split(",") 79 str_info = " ".join(info_list) 80 info_list = str_info.split() 81 index_1 = handle_str_1[1].index("<") 82 character = handle_str_1[1][:index_1].strip() 83 num = handle_str_1[1][index_1 + 1:].strip() 84 if num.isdigit(): 85 num = int(num) 86 with open("staff_list", "r", encoding="utf-8") as f: 87 for line in f: 88 if not line.isspace(): 89 line_list = line.strip().split(",") 90 character_value = int(line_list[li.index(character)]) 91 if character_value < num: 92 if handle_str_1[0].strip() == "*": 93 out = " ".join(line_list) 94 print(out) 95 out_list.clear() 96 else: 97 for n in info_list: 98 out_list.append(line_list[li.index(n)]) 99 out = " ".join(out_list) 100 print(out) 101 out_list.clear() 102 else: 103 print("请输入数字!") 104 elif "=" in handle_str_1[1]: 105 info_list = handle_str_1[0].split(",") 106 str_info = " ".join(info_list) 107 info_list = str_info.split() 108 index_2 = handle_str_1[1].index("=") 109 character = handle_str_1[1][:index_2].strip() 110 num = handle_str_1[1][index_2 + 1:].strip() 111 if num.isdigit(): 112 num = int(num) 113 with open("staff_list", "r", encoding="utf-8") as f: 114 for line in f: 115 if not line.isspace(): 116 line_list = line.strip().split(",") 117 character_value = int(line_list[li.index(character)]) 118 if num == character_value: 119 if handle_str_1[0].strip() == "*": 120 out = " ".join(line_list) 121 print(out) 122 out_list.clear() 123 else: 124 for n in info_list: 125 out_list.append(line_list[li.index(n)]) 126 out = " ".join(out_list) 127 print(out) 128 out_list.clear() 129 else: 130 with open("staff_list", "r", encoding="utf-8") as f: 131 for line in f: 132 if not line.isspace(): 133 line_list = line.strip().split(",") 134 character_value = line_list[li.index(character)] 135 if num == character_value: 136 if handle_str_1[0].strip() == "*": 137 out = " ".join(line_list) 138 print(out) 139 out_list.clear() 140 else: 141 for n in info_list: 142 out_list.append(line_list[li.index(n)]) 143 out = " ".join(out_list) 144 print(out) 145 out_list.clear() 146 elif "like" in handle_str_1[1]: 147 info_list = handle_str_1[0].split(",") 148 str_info = " ".join(info_list) 149 info_list = str_info.split() 150 index_3 = handle_str_1[1].index("like") 151 character = handle_str_1[1][:index_3].strip() 152 num = handle_str_1[1][index_3 + 4:].strip() 153 with open("staff_list", "r", encoding="utf-8") as f: 154 for line in f: 155 if not line.isspace(): 156 line_list = line.strip().split(",") 157 character_value = line_list[li.index(character)] 158 if num in character_value: 159 if handle_str_1[0].strip() == "*": 160 out = " ".join(line_list) 161 print(out) 162 out_list.clear() 163 else: 164 for n in info_list: 165 out_list.append(line_list[li.index(n)]) 166 out = " ".join(out_list) 167 print(out) 168 out_list.clear() 169 else: 170 print("