![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
wo1182929447
这个作者很懒,什么都没留下…
展开
-
python--利用datetime模块计算时间差
python中通过datetime模块可以很方便的计算两个时间的差,datetime的时间差单位可以是天、小时、秒,甚至是微秒,下面我们就来详细看下datetime的强大功能:from datetime import datetime a=datetime.now() b=datetime.now() >>>a>>>datetime.datetime(2015, 4, 7, 4,转载 2017-09-04 20:51:05 · 194585 阅读 · 2 评论 -
python--两个list 求交\并\差集
在Python中,数组可以用list来表示。如果有两个数组,分别要求交集,并集与差集,怎么实现比较方便呢? 当然最容易想到的是对两个数组做循环,即写两个for循环来实现。这种写法大部分同学应该都会,而且也没有太多的技术含量,本博主就不解释了。这里给大家使用更为装bility的一些方法。def diff(listA,listB): #求交集的两种方式 retA转载 2017-09-04 20:59:05 · 1042 阅读 · 0 评论 -
Python 各种数据格式间的转换
string-->int1、10进制string转化为int int('12')2、16进制string转化为int int('12', 16)int-->string1、int转化为10进制string str(18)2、int转化为16进制string hex(18)原创 2017-08-31 19:53:53 · 899 阅读 · 0 评论 -
Python判断--文件和文件夹--是否存在的方法
一、python判断文件和文件夹是否存在、创建文件夹 >>> import os>>> os.path.exists('d:/assist')True>>> os.path.exists('d:/assist/getTeacherList.py')True>>> os.path.isfile('d:/assist')False>>> os.path.isfile('转载 2017-09-01 15:09:32 · 16278 阅读 · 0 评论