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

代码片段 8064

#Python
Python连接和关闭MySQL数据库,获取MySQL数据库版本。

# coding:utf-8 #安装MYSQL DB for python import MySQLdb as mdb con = None dbpath='E:\Database…

2014-12-30 547

#Python
下载全国城市经纬度

 import re import os import shutil import urllib.request home = "http://jingwei.supfree.n…

2014-12-30 552

#HTML
8个通用的web字体集

/* The Times New Roman-based serif stack: */ font-family: Cambria, "Hoefler Text", Utopia,…

2014-12-30 986

#Python
Python邮件服务

#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Zoa Chou' # see http://www.mud…

#PHP
PHP页面跳转的三种方式

PHP页面跳转一:header()函数 header()函数的定义如下: void header (string string [,bool replace [,int http_…

php
2014-12-30 479

#Python
python实现堆排序算法代码

#!/usr/bin/python import sys def left_child(node): return node * 2 + 1 def right_child(nod…

2014-12-30 951

#PHP
查找页面中所有链接的PHP代码

function get_links($link) { $html = file_get_contents($link); $html = str_replace("\n…

php
2014-12-30 603

#Python
Python测试Sqlite代码

from sqlite3 import * import os, time, datetime, platform path = "./testP.sqlite"…

2014-12-30 124

#PHP
使用正则表达式来检测标签是否关闭

function check_html($html) { preg_match_all("/<([a-zA-Z0-9]+)\\s*[^\\/>]*>/&…

php
2014-12-30 200

#Python
Python发邮件带附件

import os import sys from smtplib import SMTP from email.MIMEMultipart import MIMEMultipar…

2014-12-30 856

#C/C++
C++读取文件,将文件内容读取到struct中

struct定义: #include "stdafx.h" //内存对齐1字节 #pragma pack(1) struct Day { int DateTim…

2014-12-30 497

#Python
smtplib模块发送邮件

# 导入 smtplib 和 MIMEText import smtplib from email.mime.text import MIMEText # 定义发送列表 mailt…

2014-12-30 776