首页 软件开发 代码片段 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 865

#Python
简单的python入门语法

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

2015-09-19 191

#Python
python上传和下载

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

2015-09-18 1,007

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

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

2015-09-17 324

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

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

2015-09-16 275

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

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

2015-09-16 308

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

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

2015-09-15 708

#Python
leetcode 上的一道题:Largest Number

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

2015-09-15 689

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

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

2015-09-14 338

#Python
python正则表达式验证ipv6地址

def ipv6_addr(addr): ''' Returns True if the IPv6 address (and optional subnet) are valid,…

2015-09-13 795

#Python
python验证文件是否可读可写

# Import python libs import os def is_writeable(path, check_parent=False): ''' Check if a …

2015-09-13 451
1 20 21 22 23 24 90