- 浏览: 118797 次
- 性别:
最近访客 更多访客>>
文章分类
最新评论
-
差沙:
应该有django的Model
metaclass in python (part 1) -
beyking:
哈哈,恭喜
老子毕业了 -
towjzhou:
晕死,这种符号能打出来吗?
新的 pep ! -
xlp223:
好,需要这样的例子。自己用只能是从文档中获取一些,高级的用法, ...
SQLAlchemy Examples -
xlp223:
sql是个基础,脱离它去谈orm,有如纸上谈兵。
强大的 sqlalchemy
A Very Brief Introduction To Python And It's Data-Types
一篇短小精悍的 python tutorial 。对一些容易被忽视的问题讲得很清楚!很专业的 tutorial!摘录片段如下:
一篇短小精悍的 python tutorial 。对一些容易被忽视的问题讲得很清楚!很专业的 tutorial!摘录片段如下:
- The Python 'philosophy' emphasises readability, clarity and simplicity, whilst maximising the power and expressiveness available to the programmer.
看到这句话我不自觉地就想起了c++:“The c++ 'philosophy' emphasises performance, performance and performance, whilst maximising the power and expressiveness available to the programmer” ;-) 它们在各自的领域都做得很不错。 - The line of code x = 3 is a statement (more about that in a bit) which means it does a job. The job it does is to assign the value 3 to the variable 'x'. In Python terminology we say that it binds the name 'x' to the number three. This idea of variables being names bound to objects (or names which 'reference' objects) is important in Python.
- 'Under the hood' Python actually uses two types of integer, the integer and the 'long integer' for integers bigger than a certain amount.
- If you need to a lot of complicated maths with floating point numbers, then you may be interested in extensions like numpy or General Multiprecision Python project. These extensions provide very fast ways of doing mathematical operations. For normal use the capabilities built in to Python will be sufficient.
- The name 'string' probably comes from the fact that programming languages often treat text as a sequence of characters 'stringed' together.
- The basic string type (which I have called 'normal strings' below) store the text as a sequence of bytes (numbers) with one byte per character. .... They can also be used for storing binary data in.
- Unicode strings store text internally using the unicode standard. They are slightly more complicated, because you must know the 'encoding' the text is stored in whenever you read the text in or save it out. In the long run this can save a great deal of confusion.
- Because the interpreter knows the length and types of the members of a tuple, working with them can be more efficient than using a list.
- Dictionaries are an extremely useful and flexible datatype. In fact Python is built on them.
- Programs are actually compiled to byte-code before being executed, but the byte-code is then interpreted. In some ways this is similar to Java or .NET which also compile to byte-code. Because these languages are statically typed with JIT compiler, they are generally considered as compiled languages whilst Python is generally considered as being interpreted.
发表评论
-
如何在醉酒的情况下编写正确的程序
2007-06-22 09:12 1310答案很简单:Test Driven。哈哈,这个(http:// ... -
Evolution of a Python programmer
2007-05-26 07:51 1380http://dis.4chan.org/read/prog/ ... -
Python and vim: Two great tastes that go great together
2007-05-26 08:29 1711Python and vim: Two great taste ... -
字典与动态语言
2007-03-19 10:18 1392字典(或者叫哈希表、关联数组..)与动态语言的渊源可谓极深。动 ... -
使用 python 模拟 ruby 的 open class
2007-01-27 11:42 1303老早就写了这些代码,但一直懒得为它写篇博客,我觉得我永远也无法 ... -
do it runtime
2007-01-20 11:19 2650第一次从静态语言到动态语言的人肯定在思维上需要 ... -
PLY: 一个以教学为目的的lex、yacc实现
2006-09-16 12:37 3848官方网站 想学或正在学编译原理的同学可不要错过了,要是上个学期 ... -
意外收获:get_caller
2006-09-16 14:01 1241阅读 PLY 的 lex.py 的时候 ... -
python is obvious !
2006-09-18 17:40 1362初识 python 的时候常常会被一些陌生的概念绊倒,而当熟悉 ... -
compatibility of IronPython
2006-09-19 03:58 1767IronPython 1.0 的发布,在邮件列表中引起了很多争 ... -
Be Pythonic
2006-10-19 03:05 1135Be PythonicWhat is PythonicPyth ... -
metaclass in python (part 1)
2006-12-12 14:15 2671python 的东西虽然概念上容易理解 ,但是实际用起来却也不 ... -
metaclass in python (part 2)
2006-12-12 14:24 1801接着上一篇的讲。 现在我们知道了,metaclass 生 c ... -
python types and objects
2006-12-16 14:02 1337在探寻 metaclass 的过程 ... -
selfless python
2006-12-18 04:07 1095Eliminating self with Metaclass ... -
python virtual machines
2006-12-24 13:22 1490Jython,IronPython,PyPy。 ... -
理解 python 的 method 和 function 兼谈 descriptor
2007-01-01 07:34 4971总是看到有人对 python 中的 method 和 func ... -
写了个方便下载 tudou 网视频的小程序
2007-01-09 12:26 1760http://huangyilib.googlecode.co ... -
Build extensible application with egg
2007-01-17 02:49 1784在 python 社区中 egg 已经 ...
相关推荐
a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid ...
英文版的Python Tutorial的翻译版 8 Classes 类 8.1 A Word About Terminology 8.2 Python Scopes and Name Spaces 8.3 A First Look at Classes 8.4 Random Remarks 8.5 Inheritance 8.6 Private Variables ...
Python is an interpreted language that has become popular with many programmers and ...Read more: Python SSL Tutorial | eHow.com http://www.ehow.com/how_7552729_python-ssl-tutorial.html#ixzz1hH81k1Pc
- **Using Python as a Calculator**:利用Python作为计算器进行基本数学运算。 - **First Steps Towards Programming**: - **变量与数据类型**:介绍Python中的基本数据类型(如整型、浮点型、字符串等)以及变量...
- **读写模式**:包括读('r')、写('w')、追加('a')等模式。 - **文件操作函数**:read(), readline(), readlines(), write(), seek()等。 7. **正则表达式** Python的re模块提供了正则表达式的支持,可...
The Python Tutorial 1 1. Whetting Your Appetite 4 2. Using the Python Interpreter 6 2.1. Invoking the Interpreter 7 2.1.1. Argument Passing 8 2.1.2. Interactive Mode 8 2.2. The Interpreter and Its ...
这个“Python tutorial”来源于新西兰坎特伯雷大学,旨在为初学者提供一个全面的学习路径,涵盖了Python的基础知识到进阶技巧。 一、Python基础知识 在Python编程的初始阶段,我们将学习变量、数据类型和控制结构。...
- **Using Python as a Calculator(将Python用作计算器)** - 展示如何利用Python进行基本的数学计算。 - 涉及加减乘除、幂运算等操作。 - **First Steps Towards Programming(编程第一步)** - 介绍变量、数据...
Hands-On Python A Tutorial Introduction for Beginners. Python 3.1 Version. Computer Science Department, Loyola University Chicago
通过一个实例代码完全描述了决策树的构造过程。具有很好的学习和借鉴意义。(PDF文档)
### Python入门教程:从“Hello, World!”到高级特性 #### 概述 Python是一种流行的、易学且功能强大的编程语言。它不仅适用于文本处理,还广泛用于数据分析、Web开发、自动化脚本编写以及人工智能等领域。本文将...
- **作为计算器使用(Using Python as a Calculator)**:展示Python如何用于基本的数学运算,包括加减乘除、指数运算等,帮助理解数据类型和运算符。 - **迈向编程的第一步(First Steps Towards Programming)**:介绍...
##### 3.1 使用 Python 作为计算器 (Using Python as a Calculator) - **基本运算**:介绍 Python 支持的基本数学运算符,包括加减乘除、取模、指数等。 - **内置函数**:列举一些常用的内置数学函数,如 abs()、...
### Python Curses编程教程知识点概览 #### 一、概述 **1.1 功能** 在许多常用的程序中,为了实现高效的人机交互,需要利用终端的光标移动能力。例如,`vi` 编辑器中的大多数命令都依赖于这种能力:按下 `j` 键...
of the official Python Tutorial. That is true, but there is a catch: because the language is easy to learn and put to use, many practicing Python programmers leverage only a fraction of its powerful ...
一个Python标识符以字母A-Z或a-z或下划线(_)开头,后面可以跟零个或多个字母、数字和下划线。Python不允许在标识符中使用诸如@、$、%等标点字符。理解这些基础知识点后,学习者可以进一步深入Python编程语言,探索其...
Python是一种高级编程语言,以其简洁明了的语法和强大的功能深受初学者和专业人士的喜爱。以下是一些关于Python基础入门的知识点: 1. **Input和Output**:`input()` 函数用于从用户那里获取输入,例如在例子中用来...
It serves as a tutorial or guide to the Python language for a beginner audience. If all you know about computers is how to save text files, then this is the book for you. This book is updated for ...