tcpreplay-edit提供了可对包进行修改的高级用法: --unique-ip Modify IP addresses each loop iteration to generate unique flows. This option must appear in combination with the following options: loop. This option must not appear in combination with any of the following
my_str = 'hello' # for循环 for v in my_str: print(v) # while 配合迭代器实现字符串的遍历 ite = iter(my_str) while True: try: each = next(ite) except StopIteration: break print(each) results: h e l l o h e l l o
动态条件查询 以下是我们数据库表 tb_user 的记录: 假设现在有一个需求,就是根据输入的用户年龄和性别,查询用户的记录信息.你可能会说,这太简单了,脑袋里立马蹦出如下的 SQL 语句: SELECT * FROM `tb_user` where age = 21 and sex = 1 你可能会觉得这条 SQL 语句还不够完美,因为用户名和年龄是输入的参数,不是写死,应该用占位符替换一下,所以修改如下: SELECT * FROM `tb_user` where age = ? and s