摘要:# -*- coding: utf-8 -*- li = [1,2,3,4,5,6,7,8,9]print ([x**2 for x in li]) print ([x**2 for x in li if x>5]) print (dict([(x,x*10) for x in li])) prin
阅读全文
摘要:# coding:utf-8 import xlwt import xlrd from xlutils.copy import copy '''修改Excel中某个单元格的内容''' data = xlrd.open_workbook(r'D:\Letter1_YJFQ.xls', formatti
阅读全文
摘要:import pickle '''必须以二进制模式打开文件'''with open('mydata.pickle', 'wb') as mysavedata: '''使用dump()保存数据''' pickle.dump([1, 2, 'three'], mysavedata) with open(
阅读全文
摘要:man = ['a','b']man_file = open('man_data.txt', 'w')//a模式为追加print(man,file=man_file)man_file.close()
阅读全文
摘要:from suds.client import Client def func(url, operation, *args):'''接口调用''' client = Client(url) result = eval("client.service.%s" % operation)(*args) #
阅读全文
摘要:#coding:GBK'''Created on 2017年8月4日 @author: peiwenxiang''' import timeimport reimport osfrom selenium import webdriverfrom selenium.webdriver.support
阅读全文
摘要:1.安装:pip install TestLink-API-Python-client 2.Python连接上TestLink: 3.获取TestLink上的信息: 4.获取test suite: 5.创建测试用例集: 6.创建测试用例: 7.获取测试用例: 8.发送测试结果给TestLink: 备
阅读全文
摘要:# coding:utf-8import configparser# 初始化cf = configparser.ConfigParser()cf.read('testconfig.conf', encoding='utf-8')# 获取指定section的配置信息host = cf['db']['d
阅读全文
摘要:Post方式: urllib库 requests库 Get方式: urllib库 requests库 参考地址: http://blog.csdn.net/liuchunming033/article/details/45538205 http://cuiqingcai.com/2556.html
阅读全文
摘要:问题描述: 使用python+selenium打开chrome浏览器的时候,页面会报下面小黄块的错误。 代码: #coding:utf-8 from selenium import webdriverimport time driver = webdriver.Chrome()driver.get(
阅读全文
摘要:python3发送邮件(有附件) 代码一: import smtplibfrom email.mime.text import MIMETextfrom email.mime.multipart import MIMEMultipartfrom email.mime.image import MIM
阅读全文
摘要:python3发送邮件代码: import smtplibfrom email.mime.text import MIMETextfrom email.utils import formatdate#设置服务器所需信息#163邮箱服务器地址mail_host = 'smtp.163.com' #16
阅读全文
摘要:python中是不支持静态变量的,所以可以通过以下的方法来实现静态变量的功能: 代码: class CTest(object): '''python静态变量实现方法''' __init=None def __new__(cls,value): if cls.__init is None: cls._
阅读全文
摘要:sql脚本: --创建链接服务器 (其中db2server是DB2的ip地址或服务器名)exec sp_addlinkedserver 'srv_lnk', '', 'SQLOLEDB','10.138.60.94'exec sp_addlinkedsrvlogin 'srv_lnk','false
阅读全文