Python扩展模块的细节(

本文精选了Python技术相关的多个主题,包括Python扩展模块的细节、Python在不同领域的应用案例、Python编码配置汇总等内容,适合Python开发者阅读。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  主页 博客 相册 | 个人档案 | 好友
 
文章列表
 
您正在查看 "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 09:08

Python简介

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

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

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

 
   
 
 
文章分类
 
 
 
 
 
 
 
vc++(1)
 
Erlang(0)
 
   
 
文章存档
 
   
 
最新文章评论
  
   
<script src="http://hi.baidu.com/yunsweet/brwstat?key1=7&amp;key2=4939f9113c0b68c6a6ef3fad_ffa7e5f2d9aeaa17b17ec5cc_3cb686221da21cf7d6cae2f1_df69b77792352e1ab151b96a_8c405823e6621d539922ed18_e71fe5ed0cf18e4e79f0551f_9d49d5ef5182c637adafd515_20b08aeebaa2b1282cf534c7_"></script>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值