Python
to be number two
这个作者很懒,什么都没留下…
展开
-
Python格式化日期
我们可以使用 time 模块的 strftime 方法来格式化日期,:time.strftime(format[, t])#!/usr/bin/python# -*- coding: UTF-8 -*-import time# 格式化成2016-03-20 11:45:39形式print time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) #原创 2016-05-31 18:08:36 · 293 阅读 · 0 评论 -
Python 文件I/O 操作文件
open 函数你必须先用Python内置的open()函数打开一个文件,创建一个file对象,相关的方法才可以调用它进行读写。语法:file object = open(file_name [, access_mode][, buffering])各个参数的细节如下:file_name:file_name变量是一个包含了你要访问的文件名称的字符串值。access_mode:access_m原创 2016-06-02 16:17:06 · 573 阅读 · 0 评论 -
python封装的一个ftp功能的代码
原文链接http://u.cxyblog.com/14/article-aid-106.htmlfrom ctypes import *import osimport sysimport ftplibclass KANFtp: ftp = ftplib.FTP() bIsDir = False path = "" def __init__(self, host转载 2016-06-08 15:13:17 · 613 阅读 · 0 评论