随笔分类 -  Python3

摘要:你肯定不满足于只打印"Hello World"吧? 你想要的更多 - 你希望得到一些输入,操纵它后再从中得到某些东西.我们可以使用python中的常量和变量实现这些功能。字面常量(literal constant)字面常量的一个例子是数字诸如5, 1.23, 9.25e-3或字符串This is a... 阅读全文
posted @ 2012-12-10 10:46 方倍工作室 阅读(11276) 评论(5) 推荐(0) 编辑
摘要:介绍 我们现在来看看如何在Python中运行传统的”Hello world”程序。这会教你如何写、保存以及运行Python程序。有两种办法来运行您的Python程序——使用交互式的解释器提示符或者源代码文件。我们现在来分别看一看这两种方法。使用解释器提示符 在命令提示符中输入python来打开解释器... 阅读全文
posted @ 2012-12-10 10:43 方倍工作室 阅读(14522) 评论(0) 推荐(0) 编辑
摘要:如果你已经安装了Python 2.x,你不需要在安装Python 3.0前卸载Python 2.x。这两者可以共存。GNU/Linux用户和BSD用户 如果你使用类似于Ubuntu、Fedora、OpenSUSE、Debian、CentOS或其他你选择的GNU/Linux发行版,或类似于FreeBS... 阅读全文
posted @ 2012-12-10 10:38 方倍工作室 阅读(19676) 评论(0) 推荐(0) 编辑
摘要:介绍 Python是少有的几种既强大又简单的编程语言。你将惊喜地发现通过使用Python即可轻松专注于解决问题而非和你所用的语言格式与结构。下面是Python的官方介绍:Python is an easy to learn, powerful programming language. It has... 阅读全文
posted @ 2012-12-10 10:36 方倍工作室 阅读(5817) 评论(0) 推荐(0) 编辑
摘要:Python也许是为数不多的既简单又强大的编程语言。这有利于新手甚至于专家,更重要的是用它编程所带来的乐趣。 这本书的目的是帮助您了解这种神奇的语言,展示如何快速而轻松地完成事情——事实上”编程问题的完美解决方案!”本书的读者 本书可以作为Python编程语言的一本指南或者教程。它主要是为新手而设计... 阅读全文
posted @ 2012-12-10 10:35 方倍工作室 阅读(5726) 评论(0) 推荐(0) 编辑
摘要:这里有许许多多本书不同语言的译本,感谢那些不知疲倦的志愿者们!如果你想帮助这些译本,请参看下面的关于志愿者和语言的列表,然后决定是要开始一个新的翻译项目还是帮助改进现有的翻译项目。如果你计划开始一个新的翻译项目,请参阅如何翻译.阿拉伯语 Here is the link for the Arabic... 阅读全文
posted @ 2012-12-10 10:34 方倍工作室 阅读(9593) 评论(0) 推荐(0) 编辑
摘要:A Byte of Python'A Byte of Python' is a free book on programming using the Python language. It serves as a tutorial or guide to the Python language fo... 阅读全文
posted @ 2012-12-10 10:32 方倍工作室 阅读(8482) 评论(0) 推荐(0) 编辑
摘要:关键字:Python 属性 方法原文:http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.htmlShalabhChaturvediCopyright © 2005-2009 Shalabh ChaturvediAll Rights Reserved.About This BookExplains the mechanics of object attribute access for new-style Python objects:how functio 阅读全文
posted @ 2012-11-30 09:41 方倍工作室 阅读(3654) 评论(0) 推荐(0) 编辑
摘要:关键字:Python 类型 对象原文:http://wiki.woodpecker.org.cn/moin/PyTypesAndObjects关于本书解释新式的Python对象(new-style):<type 'type'> and <type 'object'>是什么东西用户定义的类及实例是如何相互关联的,和内置类型有啥关系how user defined classes and instances are related to each other and to built-in typesmetaclass是什么新式类型New-s 阅读全文
posted @ 2012-11-30 09:27 方倍工作室 阅读(9531) 评论(0) 推荐(0) 编辑
摘要:http://www.simple-is-better.com/sites/http://www.oschina.net/project/lang/25/pythonhttps://github.com/languages/Python 阅读全文
posted @ 2012-10-22 17:30 方倍工作室 阅读(1227) 评论(0) 推荐(0) 编辑
摘要:关键字:python3 域名查询 域名查询接口 whois查询原文:http://www.cnblogs.com/txw1958/archive/2012/08/31/python3-domain-whois.html1. 域名查询万网提供了域名查询接口,接口采用HTTP协议:接口URL:http://panda.www.net.cn/cgi-bin/check.cgi接口参数:area_domain,接口参数值为标准域名,例:doucube.com调用举例:http://panda.www.net.cn/cgi-bin/check.cgi?area_domain=doucube.com返回: 阅读全文
posted @ 2012-08-31 16:59 方倍工作室 阅读(8794) 评论(5) 推荐(1) 编辑
摘要:首先来设置一个原始的字符串,Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> website = 'http://www.cnblogs.com/txw1958/'>>> type(website)< 阅读全文
posted @ 2012-08-31 15:02 方倍工作室 阅读(95771) 评论(0) 推荐(2) 编辑
摘要:Keyword: Python3 Oauth2 新浪微博本接口基于廖雪峰的weibo python SDK修改完成,其sdk为新浪官方所推荐,原作者是用python2写的经过一些修改,这里提供基于python3的 weibo SDK#!/usr/bin/env python# -*- coding: utf-8 -*-__version__ = '1.04'__author__ = 'Liao Xuefeng (askxuefeng@gmail.com)'__publish__ = 'http://www.cnblogs.com/txw1958/' 阅读全文
posted @ 2012-08-13 00:37 方倍工作室 阅读(4893) 评论(8) 推荐(1) 编辑
摘要:keywords: python jsonsource: http://txw1958.cnblogs.com/先看下JSON的语法规则:JSON 语法规则JSON 语法是 JavaScript 对象表示法语法的子集。数据在名称/值对中数据由逗号分隔花括号保存对象方括号保存数组JSON 名称/值对JSON 数据的书写格式是:名称/值对。名称/值对包括字段名称(在双引号中),后面写一个冒号,然后是值:"firstName" : "John"这很容易理解,等价于这条 JavaScript 语句:firstName = "John"JSON 阅读全文
posted @ 2012-08-02 17:31 方倍工作室 阅读(7163) 评论(0) 推荐(1) 编辑
摘要:A Byte of Python v1.92 (for Python 3.0)官方下载地址,当前(20120730) 最新版本 1.92 基于Python3的 下载: http://files.swaroopch.com/python/byte_of_python_v192.pdf在线阅读:http://www.cnblogs.com/txw1958/archive/2012/12/10/A_Byte_of_Python3.html简明Python3教程《A Byte of Python3》是一本关于用Python3语言编程的书。可以作为初学这的入门教程。也可以供计算机相关人员参考。本书可作为 阅读全文
posted @ 2012-07-30 18:29 方倍工作室 阅读(3280) 评论(0) 推荐(0) 编辑
摘要:download address: http://pypi.python.org/pypi/lxml/2.3lxml is a Pythonic, mature binding for the libxml2 and libxslt libraries. It provides safe and convenient access to these libraries using the ElementTree API.It extends the ElementTree API significantly to offer support for XPath, RelaxNG, XML Sc 阅读全文
posted @ 2012-07-28 23:21 方倍工作室 阅读(2913) 评论(0) 推荐(0) 编辑
摘要:#!/usr/local/bin/python3#coding=utf-8#source http://www.cnblogs.com/txw1958/import os, io, sys, re, time, json, base64import webbrowser, urllib.requestperiod_All_List = [ "min", #分时线 "daily", #日K线 "weekly", #周K线 "m... 阅读全文
posted @ 2012-07-28 00:16 方倍工作室 阅读(30386) 评论(0) 推荐(2) 编辑
摘要:一、下载\安装\配置1. python3Python3下载网址:http://www.python.org/getit/当前最新版本是python3.2,下载地址是http://www.python.org/ftp/python/3.2.3/python-3.2.3.msi安装过程就不用说了,默认安装到C:\Python32目录中。安装好后,将安装目录C:\Python32添加到环境变量中。然后打开命令提示符窗口,输入python,如果能返回python版本说明安装成功以及环境变量设置成功。C:\>pythonPython 3.2.3 (default, Apr 11 2012, 07: 阅读全文
posted @ 2012-07-22 23:00 方倍工作室 阅读(30158) 评论(1) 推荐(2) 编辑
摘要:#!/usr/local/bin/python3# coding=utf-8# Created: 20/07/2012# Copyright: http://www.cnblogs.com/txw1958/'''A Chinese Calendar Library in Python'''import os, io, sys, re, time, datetime, base64__version__ = "$Rev: 123 $"__all__ = ['LunarDate']solar_year = 1900 阅读全文
posted @ 2012-07-20 18:59 方倍工作室 阅读(11772) 评论(1) 推荐(0) 编辑
摘要:1.性能Py3.0运行 pystone benchmark的速度比Py2.5慢30%。Guido认为Py3.0有极大的优化空间,在字符串和整形操作上可以取得很好的优化结果。Py3.1性能比Py2.5慢15%,还有很大的提升空间。2.编码Py3.X源码文件默认使用utf-8编码,这就使得以下代码是合法的: >>> 中国 = 'china' >>>print(中国) china3. 语法1)去除了<>,全部改用!=2)去除``,全部改用repr()3)关键词加入as 和with,还有True,False,None4)整型除法返回浮点数 阅读全文
posted @ 2012-07-20 17:16 方倍工作室 阅读(589) 评论(0) 推荐(0) 编辑