![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python学习总结
Y-AND-M
这个作者很懒,什么都没留下…
展开
-
python
import urllib.requesturl = 'http://xa.fangjia.com/'file = urllib.request.urlopen(url)出现错误:无法访问进行浏览器的模拟:header('User-Agent','Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like...原创 2020-02-25 15:08:35 · 165 阅读 · 0 评论 -
python time部分功能
import time# time.time() 返回当前时间的时间戳(1970元年后的浮点数)# time.localtime() 接收时间戳,并返回当地时间下的元组t# time.strftime() 把一个代表时间的元组或者struct_time转化为格式化的时间字符串。t = time.time() #输出结果为:1557820668.4665997t2 = tim...翻译 2019-05-14 16:31:08 · 125 阅读 · 0 评论 -
python demo_水仙花数字
# 011# 打印所有的“水仙花数”:一个三位数,其各个数字立方和等于该数本身。for i in range(100,1000): a = i % 10 temp = int(i / 10) b = temp % 10 c = int(temp / 10) if a**3+b**3+c**3==i: # ** 2个连续的星号就是次方 ...转载 2019-05-14 16:32:15 · 369 阅读 · 0 评论 -
python datetime模块
import datetimeprint(datetime.date.today().strftime("%d/%m/%Y"))mytime = datetime.date(1992,12,20) #创建一个日期对象print(mytime.strftime("%Y-%m-%d")) #将日期格式化mynextdat = mytime + datetime.timedelta(...翻译 2019-05-14 16:52:53 · 194 阅读 · 0 评论 -
python demo_图案设计
# 013 打印图案for line1 in range(4): for space in range(4-line1-1): print(" ",end="") for star in range(2*line1+1): print("*",end="") print()for line2 in range(3): for ...原创 2019-05-14 18:06:16 · 539 阅读 · 0 评论 -
Python包安装之源码安装
cmd 进入py C:\Users\lzl\Downloads\xadmin-master然后,输入命令:python setup.py install 回车即可原创 2019-06-01 16:38:46 · 4954 阅读 · 0 评论