码迷,mamicode.com
首页 >  
搜索关键字:python3 datetime    ( 17497个结果)
怎么使用Delphi获取当前的时间,精确到毫秒
直接先参考下面的代码段,很简单很直白很方便 var currentTime:TSystemTime; year, month, day, hour, minute, second, millisecond: string; datetime: string;begin GetS...
分类:Windows程序   时间:2015-08-17 21:21:49    阅读次数:234
python3.4多线程实现同步的四种方式
临界资源即那些一次只能被一个线程访问的资源,典型例子就是打印机,它一次只能被一个程序用来执行打印功能,因为不能多个线程同时操作,而访问这部分资源的代码通常称之为临界区。1. 锁机制threading的Lock类,用该类的acquire函数进行加锁,用realease函数进行解锁import thre...
分类:编程语言   时间:2015-08-17 18:56:02    阅读次数:198
C#根据日期DateTime和持续时间int找到日期
protected DateTime GetFinish(DateTime start, int duration) { return start.AddDays(duration); } protected DateTime Ge...
分类:Windows程序   时间:2015-08-17 11:44:32    阅读次数:129
生成指定格式的流水号
程序应用场景:1、对数据表的增删改查中的增加数据时,对于主键值得自动生成2、银行的自动叫号系统 以下是程序代码:private void codechange() { //提前设置流水号的格式; string onecode = DateTime.Now.ToStr...
分类:其他好文   时间:2015-08-17 10:02:50    阅读次数:116
date、datetime、string的相互转换
import datetimeimport timestring转datetime str = '2012-11-19' date_time = datetime.datetime.strptime(str,'%Y-%m-%d') d...
分类:其他好文   时间:2015-08-17 00:56:49    阅读次数:99
【转载】python发送邮件实例
本文转自:http://www.cnblogs.com/lonelycatcher/archive/2012/02/09/2343463.html这几天要用python发送邮件,上网找到这篇文章感觉蛮全面的,故转载收藏之。1. 文件形式的邮件#!/usr/bin/env python3 #codin...
分类:编程语言   时间:2015-08-17 00:53:22    阅读次数:178
Python3.4 Python的一些特色
1.使用列表综合>>> listone = [2, 3, 4] >>> listtwo = [2*i for i in listone if i > 2] >>> print(listtwo) [6, 8] 这里我们为满足条件(if i > 2)的数指定了一个操作(2*i),从而导出一个新的列表。注意原 来的列表并没有发生变化。在很多时候,我们都是使用循环来处理列表中的每一个元素,而使 用列表综...
分类:编程语言   时间:2015-08-16 12:28:14    阅读次数:149
服务端缓存HttpRuntime.Cache的使用
HttpRuntime.Cache.Insert("缓存key", "缓存content", null, DateTime.Now.AddMinutes(3), TimeSpan.Zero);//存入本地服务端string cacheContent = string.Empty; if...
分类:Web程序   时间:2015-08-16 12:00:16    阅读次数:207
Python3 字符串
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32Type "copyright", "credits" or "license()" for more info...
分类:编程语言   时间:2015-08-15 22:53:16    阅读次数:162
python3 slice
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32Type "copyright", "credits" or "license()" for more info...
分类:编程语言   时间:2015-08-15 22:43:35    阅读次数:127
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!