文章列表
 
您正在查看 "python技术" 分类下的文章

2008-01-12 16:11

Python Tip

原文地址: http://blog.donews.com/limodou/category/33791.aspx

Q:如何在安装setuptools模块时不生成egg压缩包而是源码,这样有时可以修改代码进行调试

A:其实很简单,就在setup.py中的setup函数中增加 zip_safe=False, 参数即可。

这样安装后的东西不再是一个egg文件了,而是象以前一样的目录结构。

Q:如何判断一个字符串只包含数字字符

A:一种方法是 a.isdigit()。但这种方法对于包

 
2007-12-26 16:51

在PYTHON中编码是经常遇到的问题,也是我们需要解决的首要问题.
背景: 由于各种开源的开发库操作都需要进行编码设置.否则将不能进行操作.
下面就我遇到的几个问题进行一个归纳.

1. PYTHON本身
这是最主要的,在各种组建面前影响最大.修正他可以有效使的组件中没有设置编码方式的源码可以按照制定方式进行处理.
默认是ascii 在LIB/site.py (python2.5.1) line 370
    # encoding = "ascii" # Default value set by _PyUnicode_Init()
    encoding =

 
2007-05-13 18:04
以下内容出自:http://http://www.codeproject.com/cpp/embedpython_1.asp

Introduction

Inspired by the article "Embedding Python in Multi-Threaded C/C++ Applications" (Linux Journal), I felt the need for a more comprehensive coverage on the topic of embedding Python. While writing this article, I had two objectives:

 
2007-05-07 20:26
22.5.4. Data Conversions

22.5.4. 数据转换

C module functions are responsible for converting Python objects to and from C datatypes. In Example 22-1, message gets two Python input objects passed from the Python interpreter: args is a Python tuple holding the arguments passed from the Python caller (the values listed in parentheses in a Python program), and self is ignored. It is useful only for extension types (discussed later in this chapter).

C模块函数要负责Python对
 
2007-05-07 20:25
Programming Python, 3rd Edition 翻译
最新版本见:http://wiki.woodpecker.org.cn/moin/PP3eD


22.5. Extension Module Details

22.5. 扩展模块的细节

Now that I've shown you the somewhat longer story, let's fill in the rest. The next few sections go into more detail on compilation and linking, code structure, data conversions, error handling, and reference counts. These are core ideas in Python C extensionssome
 
2007-05-07 20:10
Pyton和C分别有着各自的优缺点,用Python开发程序速度快,可靠性高,并且有许多现成模块可供使用,但执行速度相对较慢;C语言则正好相反,其执行速度快,但开发效率低。为了充分利用两种语言各自的优点,比较好的做法是用Python开发整个软件框架,而用C语言实现其关键模块。本文介绍如何利用C语言来扩展Python的功能,并辅以具体的实例讲述如何编写Python的扩展模块。

一、简介

Python是一门功能强大的高级脚本

 
2007-05-07 9:08

Python简介

Python是一种简单易学,功能强大的解释型编程语言,它有简洁明了的语法,高效率的高层数据结构,能够简单而有效地实现面向对象编程,特别适用于快速应用程序开发,也可以用来开发大规模的重要的商业应用。Python是一个理想的脚本语言。

Python免费开源,可移植到多种操作系统,只要避免使用依赖于特定操作系统的特性,Python程序无需修改就可以在各种平台上面运行。

Python拥有现代编程语言所具有的一切强大功能,Python标准库十分庞大,可以帮助开发者处理各种工作,如:图

 
 
   
 
 
文章分类
 
   
 
文章存档
 
     
 
最新文章评论
  

好复杂啊
 

蓝牙地址可以重新写入吗 我的是LG KS20
 

我也是遇到这个问题,目前还有解决。 上海蚂蚁空间(http://www.shspace.net),上海社
   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu