随笔分类 -  python

摘要:def get_ip(count='10', start='2001:2:3:4:5:6:7:8'): starts = start.split(':') A = int(starts[0], 16) # int('a',16) 将字符串'a'进行16进制转换 base 存在时,视 x 为 base 阅读全文
posted @ 2021-06-17 20:54 dmwc 阅读(242) 评论(0) 推荐(0)
摘要:def get_ip(count='10', start='2001:2:3:4:5:6:7:8'): starts = start.split(':') A = int(starts[0], 16) # int('a',16) 将字符串'a'进行16进制转换 base 存在时,视 x 为 base 阅读全文
posted @ 2021-06-17 20:52 dmwc 阅读(111) 评论(0) 推荐(0)
摘要:def get_ip(count='10', start='2001:2:3:4:5:6:7:8'): starts = start.split(':') A = int(starts[0], 16) # int('a',16) 将字符串'a'进行16进制转换 base 存在时,视 x 为 base 阅读全文
posted @ 2021-06-17 20:51 dmwc 阅读(303) 评论(0) 推荐(0)
摘要:import timeimport calendar print('*'*50+str(time.time())+'*'*50)print(time.localtime(time.time()))print(time.asctime(time.localtime(time.time())))prin 阅读全文
posted @ 2021-06-15 20:01 dmwc 阅读(142) 评论(0) 推荐(0)
摘要:python模块 pip install ipython pip install itchat 阅读全文
posted @ 2021-05-19 20:53 dmwc 阅读(55) 评论(0) 推荐(0)
摘要:生成主机地址: 1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 4 def getIP(count=1000, startIP='1.1.1.1'): 5 a1 = int(startIP.split('.')[0]) 6 a2 = int(s 阅读全文
posted @ 2021-05-19 20:51 dmwc 阅读(1046) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- def getIP(count=1000, startIP='1.1.1.1'): a1 = int(startIP.split('.')[0]) a2 = int(startIP.split('.')[1] 阅读全文
posted @ 2020-09-17 19:04 dmwc 阅读(375) 评论(0) 推荐(0)
摘要:i = 2 while(i < 100): j = 2 while(j <= (i/j)): if not (i % j): break j = j + 1 if(j > i / j): print(i,"是素数") i = i + 1 阅读全文
posted @ 2020-07-30 17:26 dmwc 阅读(83) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*- with open(r'.\test_data\demo.txt','w',encoding='utf-8') as f: f.write('相对abc') print("*"*50+"相对路径测试end"+"*"*50) with open(r'C: 阅读全文
posted @ 2020-07-24 13:38 dmwc 阅读(135) 评论(0) 推荐(0)