上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 18 下一页
摘要: a = 50 y = '*'*(a+1) p = ' ' while a: print(y) y = y[:a-1] y = p + y a = a - 1 for i in range(20): print(' ' * (20-i-1) + '*' * (2*i+1) ) a = 20 p = ' '*(a+1... 阅读全文
posted @ 2016-06-26 19:13 疯陈演义 阅读(2132) 评论(0) 推荐(0) 编辑
摘要: import urllib.request url = 'http://www.whatismyip.com.tw/' proxy_support = urllib.request.ProxyHandler({'HTTP':'180.104.62.22:9000'}) opener = urllib.request.build_opener(proxy_support) opener.ad... 阅读全文
posted @ 2016-05-15 13:58 疯陈演义 阅读(216) 评论(0) 推荐(0) 编辑
摘要: import urllib.request import urllib.parse import json content = input('请输入要翻译的内容:') url = 'http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule&smartresult=ugc&sessionFrom=http://www.... 阅读全文
posted @ 2016-05-15 13:27 疯陈演义 阅读(280) 评论(0) 推荐(0) 编辑
摘要: Python中的正则表达式(re) import re re.match #从开始位置开始匹配,如果开头没有则无 re.search #搜索整个字符串 re.findall #搜索整个字符串,返回一个list 举例: r(raw)用在pattern之前,表示单引号中的字符串为原生字符,不会进行任何转 阅读全文
posted @ 2016-05-06 14:15 疯陈演义 阅读(574) 评论(0) 推荐(0) 编辑
摘要: #encoding:UTF-8 import urllib.request url = "http://www.baidu.com" data = urllib.request.urlopen(url).read() data = data.decode('UTF-8') print(data) 阅读全文
posted @ 2016-05-06 13:38 疯陈演义 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-04-28 09:04 疯陈演义 阅读(249) 评论(0) 推荐(0) 编辑
摘要: import tkinter from tkinter import ttk root = tkinter.Tk() tree = ttk.Treeview(root, show="headings", columns=('col1','col2','col3')) tree.heading('col1', text='第一列') tree.heading('col2', text='... 阅读全文
posted @ 2016-03-22 22:28 疯陈演义 阅读(1913) 评论(0) 推荐(0) 编辑
摘要: import urllib.request import re url = 'http://stock.sohu.com/news/' html = urllib.request.urlopen(url).read() html = html.decode('GBK') pattern = re.compile("(.*?)",re.S) items = re.findall(pa... 阅读全文
posted @ 2016-03-17 12:42 疯陈演义 阅读(230) 评论(0) 推荐(0) 编辑
摘要: // Win32.cpp : 定义应用程序的入口点。 // #include "stdafx.h" #include "Win32.h" void TRACE(LPCTSTR lpszFmt, ...);//调试信息 LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);//消息处理函... 阅读全文
posted @ 2016-03-16 09:55 疯陈演义 阅读(417) 评论(0) 推荐(0) 编辑
摘要: void TRACE(LPCTSTR lpszFmt, ...) { va_list args; va_start(args, lpszFmt); int len = _vsctprintf(lpszFmt, args) + 1; TCHAR *lpszBuf = (TCHAR*)_alloca(len*sizeof(TCHAR));//栈中分配, 不需要释放 ... 阅读全文
posted @ 2016-03-15 21:51 疯陈演义 阅读(965) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 18 下一页