首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴shlgj的代码贴全部
# -*- coding: UTF-8 -*- 
import pymysql

def readSQL():
    #查询 SQL 语句
    sql = "SELECT id,'apiname',apiurl from apitest_apistep where apitest_apistep.Apitest_id = 2"
    #打开 MySQL 数据库链接
    coon = pymysql.connect(user='root', passwd = 'test123456',db = 'autotest', port = 3306, host='127.0.0.1',charset='utf8')
    #获取数据库操作游标
    cursor = coon.cursor()
    #执行 MySQL 查询语句
    aa = cursor.execute(sql)
......................
阅读全部 | 2022年1月28日 14:50
#-*- coding:UTF-8 -*-

def wfile():
    try: 
        filename = "C:\\Users\\zh\\"+"test.html"
    except IOError:
        print("file creat error")
    else:
        fp = open(filename,'wb')
        fp.write('test'.encode('utf-8'))
        fp.close()
        
......................
阅读全部 | 2022年1月27日 19:45
1
shlgj