python
Peng4Wang1
这个作者很懒,什么都没留下…
展开
-
欢迎使用CSDN-markdown编辑器
python 的testunit.TestCase import unittestclass ArithTestSupper(unittest.TestCase): def setUp(self): print(“Setting up ArithTest cases”) def tearDown(self): print(“Cleaning u原创 2016-03-11 15:57:33 · 427 阅读 · 0 评论 -
python Tkinter 详解
!/usr/bin/python-- coding: utf-8 --import sys from Tkinter import *def result(): print(“The sum of 2+2 is “,2+2) “”” win = Frame() win.pack() Label(win,text=”Click add to get the sum of quit原创 2016-03-11 16:04:42 · 2419 阅读 · 1 评论 -
python 单元测试(assert 或者 unittest.TestCase)
import unittestclass ArithTestSupper(unittest.TestCase): def setUp(self): print(“Setting up ArithTest cases”) def tearDown(self): print(“Cleaning up ArithTest cases”)class A原创 2016-03-11 16:06:12 · 1440 阅读 · 1 评论 -
python sqlite operation
!/usr/bin/python-- coding:utf-8 --import os import sqlite3create the connectconn = sqlite3.connect(‘sample_database’)recive the cursor 游标cursor=conn.cursor();cursor.execute(“”“create table employee( e原创 2016-03-11 16:09:39 · 385 阅读 · 0 评论 -
a simple email test in python
!/usr/bin/python-- coding:utf-8 --import os import smtplibfromAddress=’########@163.com’ toAddress=’****@qq.com’ msg=”Subject:Hello\n\n This is the body of the message.” server = smtplib.SMTP(“smtp原创 2016-03-11 16:16:13 · 427 阅读 · 0 评论 -
Idiomatic Python, well format in python
Looping over a range of numbers exercise 1: for i in [0, 1, 2, 3, 4, 5]: print i**2 for i in range(6): print i**2 Idiomatic python for i in xrange(6): print i**2 xrange creates an原创 2016-03-11 17:00:14 · 472 阅读 · 0 评论