首页 软件开发 代码片段 python ( Page 22 )

python 1073

#Python
utf8编码

def main(): fin = open('utf8.txt', 'r', encoding='utf_8') fout = open('utf8.html', 'w') ou…

2015-09-21 887

#Python
简单的python入门语法

#!/usr/bin/python3 # 开始学习python print("hello,world") # 条件语句 a, b = 3, 1 if a < b: print…

2015-09-19 210

#Python
python上传和下载

#!/usr/bin/env python import paramiko,datetime,os hostname='192.168.0.102' username='root'…

2015-09-18 1,027

#Python
Python 发送邮件可以添加附件

#!/usr/bin/python from email.MIMEText import MIMEText from email.MIMEMultipart import MIME…

2015-09-17 342

#Python
写了一个简单的库,可以直接在终端打印表格

from pylsy import PylsyTable def main(): attributes=["name","age","sex","id","time"] table…

2015-09-16 329

#Python
搞不定里也得发出来,哈哈,见笑了

#!/usr/bin/python def fx(x): if x == 1: return 1 else: return 0; def f(func ,n): if (n == …

2015-09-16 298

#Python
leetcode 上的一道题:Largest Number

class Solution: # @param num, a list of integers # @return a string def largestNumber(self…

2015-09-15 707

#Python
Python下载网易云音乐的高清MV

#coding=utf-8 import urllib import re import os def getHtml(url): page = urllib.urlopen(ur…

2015-09-15 730

#Python
获取情敌电脑内照片神器

#!usr/bin/env python #coding=utf-8 print ' **********************************************'…

2015-09-14 370

#Python
Python 定时运行脚本

#coding=utf-8 import sys import os import datetime import time class ArgsDealwith: def arg…

2015-09-13 710

#Python
Python异步任务队列

很多场景为了不阻塞,都需要异步回调机制。这是一个简单的例子。 #!/usr/bin/env python # -*- coding: UTF-8 -*- import loggin…

2015-09-13 1,013
1 20 21 22 23 24 90