Python教程
Python是一种面向对象的解释型...
-
Python 实现的amp;#034;冒泡排序amp;#034; Pythonjiaocheng/20171102/550.html">python"> ''''' Bubble Sort @author: aihua.sun ''' import string import random number = ... 继续阅读Python 实现的amp;#034;冒泡排序amp;#034;
:2018-05-17
-
python 非utf8编码转换utf-8 python">strutf8 = teststr.encode('utf-8').decode('utf-8', 'ignore') 标签:python ... 继续阅读python 非utf8编码转换utf-8
:2018-05-17
-
python通过PyGame播放Midi和Mp3文件 python">''' pg_midi_sound101.py play midi music files (also mp3 files) using pygame tested with Python273/331 and pygame192 by vegaseat ''' import pygame as pg def pl... 继续阅读python通过PyGame播放Midi和Mp3文件
:2018-05-17
-
python查看zip包中的文件及大小 python">#!/usr/bin/env python import zipfile z = zipfile.ZipFile("test.zip","r") for filename in z.namelist(): print 'File:',filename, bytes = z.read(filename) ... 继续阅读python查看zip包中的文件及大小
:2018-05-17
-
python 打印列表内容 python">values = [4, 10, 3, 8, -6] for i in range(len(values)): print(i, values[i]) 标签:python ... 继续阅读python 打印列表内容
:2018-05-17
-
Python数据库操作 文件型数据库sqllite读写操作:“`python None MySQL数据库读写操作:```python def ExecSql(sql, dbName="", host="", user="", passwd="", charset=''): import MySQLdb conn = MySQLdb.connec... 继续阅读Python数据库操作
:2018-05-17
-
python 匹配IP和匹配域名 python">class JianKong(): '''查询IDC信息,封ip和过白名单''' def __init__(self): pass @classmethod def ip_verify(cls,str): '验证IP地址规范' pattern=re.compi... 继续阅读python 匹配IP和匹配域名
:2018-05-17
-
python编写的一个通过多线程扫描端口的代码 python">#!/usr/bin/env python import socket import sys import threading import time NORMAL = 0 ERROR = 1 TIMEOUT = 5 def ping(ip , port , timeout=TIMEOUT): try: ... 继续阅读python编写的一个通过多线程扫描端口的代码
:2018-05-17
-
python 删除指定格式的文件 python">#!/usr/bin/python """ 2015.07.02 Clean all the genrated files during compile. Edited by Grey """ import os,re def CleanAll(file_ext): # remove all file... 继续阅读python 删除指定格式的文件
:2018-05-17
-
Python连接Oracle python 3.4.3 cx_Oracle“` python !/usr/bin/env python import time start = time.clock() import cx_Oracle tns = cx_Oracle.makedsn(‘127.0.0.1’, ‘1534’, ‘dsn’) db = cx_Oracle.connect(‘user... 继续阅读Python连接Oracle
:2018-05-17