没有合适的资源?快使用搜索试试~ 我知道了~
首页Jython权威指南:Java平台上的Python编程
收藏
"The Definitive Guide to Jython: Python for the Java™ Platform"
本书是一部关于Jython的权威指南,旨在帮助读者掌握如何在Java平台上利用Python的灵活性和威力。Jython是Python的一种实现,它允许Python代码直接运行在Java虚拟机(JVM)上,从而结合了Python的易用性和Java的平台兼容性。
该书涵盖了Jython 2.5版本,这是Jython的一个重要里程碑,包含了对Python 2.5语言特性的支持。作者团队包括Josh Juneau, Jim Baker, Victor Ng, Leo Soto和Frank Wierzbicki,他们都是软件开发领域的专家,确保了内容的专业性和实用性。
书中内容可能涉及以下几个关键知识点:
1. **Jython介绍**:讲解Jython的基本概念,包括其起源、特点以及与标准CPython解释器的区别。
2. **Jython安装与环境配置**:如何在不同的操作系统上安装和配置Jython环境,包括依赖库的管理。
3. **Python for Java开发者**:针对有Java背景的开发者,介绍如何从Java过渡到Jython,以及如何调用Java类库和API。
4. **Jython语法和特性**:详细解析Jython的语法结构,包括变量、控制结构、函数、模块、异常处理等,并对比Python的相应部分。
5. **JVM集成**:讨论如何在Jython中使用Java对象,以及如何将Python代码与Java代码混合编写,实现跨语言的无缝协作。
6. **高级主题**:可能包含线程、网络编程、GUI开发(如使用JavaFX或Swing)、数据库访问、Web应用开发(例如使用Jython进行服务器端开发)等。
7. **性能优化**:探讨如何在Jython中优化代码,提高运行效率,以及与Java性能比较。
8. **案例研究与实践项目**:通过实际例子展示Jython在不同场景下的应用,如数据处理、自动化脚本、企业级应用等。
9. **调试和测试**:介绍Jython的调试工具和测试框架,如使用Python的unittest或Junit进行测试。
10. **社区与资源**:提供Jython社区的相关信息,如论坛、邮件列表、文档和第三方库,以便读者进一步学习和求助。
《The Definitive Guide to Jython》是一本全面而深入的Jython教程,适合对Python和Java都有一定了解,希望在Java平台上利用Python优势的开发者阅读。通过这本书,读者可以全面掌握Jython的使用技巧,提升跨平台开发能力。

■ CONTENTS
xiv
Integration with Java?................................................................................................................ 400!
Continuous Integration ................................................................................................................... 401!
Hudson ...................................................................................................................................... 401!
Getting Hudson .......................................................................................................................... 401!
Installing the Jython Plug-in....................................................................................................... 402!
Creating a Hudson Job for a Jython Project................................................................................ 403!
Using Nose on Hudson ............................................................................................................... 407!
Summary....................................................................................................................................... 410!
■ Chapter 19: Concurrency.............................................................................................................413
Java or Python APIs?...................................................................................................................... 414!
Working With Threads.................................................................................................................... 414!
Thread Locals ................................................................................................................................ 416!
No Global Interpreter Lock.............................................................................................................. 417!
Module Import Lock ....................................................................................................................... 417!
Working With Tasks ....................................................................................................................... 418!
Thread Safety ................................................................................................................................422!
Synchronization ......................................................................................................................... 423!
Deadlocks.................................................................................................................................. 426!
Other Synchronization Objects ................................................................................................... 427!
Atomic Operations ..................................................................................................................... 431!
Thread Confinement .................................................................................................................. 432!
Python Memory Model ................................................................................................................... 433!
Interruption .................................................................................................................................... 433!
Summary....................................................................................................................................... 436!
■ Appendix A: Using Other Tools with Jython ...............................................................................437
The Jython Registry ....................................................................................................................... 437!
Registry Properties..................................................................................................................... 437!
python.cachedir ..................................................................................................................... 437!
python.verbose ...................................................................................................................... 437!
python.security.respectJavaAccessibility................................................................................ 438!
python.jythonc.compiler......................................................................................................... 438!
python.jythonc.classpath .......................................................................................................438!
python.jythonc.compileropts .................................................................................................. 438!
python.console ...................................................................................................................... 438!
python.console.readlinelib ..................................................................................................... 438!
www.it-ebooks.info

■ CONTENTS
xv
Finding the Registry File............................................................................................................. 438!
Setuptools...................................................................................................................................... 438!
Virtualenv....................................................................................................................................... 442!
■ Appendix B: Jython Cookbook ....................................................................................................445
Logging.......................................................................................................................................... 445!
Using log4j with Jython, Josh Juneau ........................................................................................ 445!
Setting Up Your Environment ................................................................................................. 445!
Using log4j in a Jython Application......................................................................................... 446!
Working with Spreadsheets............................................................................................................ 447!
Creating and Reading Spreadsheets Using Apache Poi............................................................... 447!
Create Spreadsheet ............................................................................................................... 447!
Read an Excel File.................................................................................................................. 449!
Jython and XML ............................................................................................................................. 450!
Writing and Parsing RSS with ROME, Josh Juneau..................................................................... 450!
Setting up the CLASSPATH..................................................................................................... 450!
Parsing Feeds........................................................................................................................ 450!
Creating Feeds....................................................................................................................... 451!
Summary............................................................................................................................... 454!
Working with CLASSPATH .............................................................................................................. 454!
Using the CLASSPATH, Steve Langer.......................................................................................... 454!
What to Do?........................................................................................................................... 454!
Method .................................................................................................................................. 454!
Summary............................................................................................................................... 456!
Ant................................................................................................................................................. 456!
Writing Ant Tasks with Jython, Ed Takema................................................................................. 456!
Writing Custom Ant Tasks...................................................................................................... 457!
Setup Development Environment ........................................................................................... 457!
SimpleTask Jython Class ....................................................................................................... 457!
Compiling Jython Code to a Jar.............................................................................................. 458!
Build.XML File to Use the Task............................................................................................... 458!
A Task Container Task ........................................................................................................... 458!
Build.XML File to Use the TaskContainer ................................................................................ 459!
Things to Look Out For........................................................................................................... 460!
Summary............................................................................................................................... 461!
Developing Django Web Apps......................................................................................................... 461!
www.it-ebooks.info

■ CONTENTS
xvi
Using Django in Netbeans, Josh Juneau..................................................................................... 461!
■ Appendix C: Built-in Functions ...................................................................................................463
Constructor Functions .................................................................................................................... 463!
bool([x]) ..................................................................................................................................... 463!
chr(i).......................................................................................................................................... 463!
complex([real[, imag]]) ............................................................................................................... 464!
dict([arg])................................................................................................................................... 464!
file(filename[, mode[, bufsize]]).................................................................................................. 464!
float([x]) ..................................................................................................................................... 464!
frozenset([iterable]).................................................................................................................... 464!
int([x[, radix]]) ............................................................................................................................ 464!
iter(o[, sentinel])......................................................................................................................... 465!
list([iterable]).............................................................................................................................. 465!
object() ...................................................................................................................................... 465!
open(filename[, mode[, bufsize]])............................................................................................... 465!
range([start,] stop[, step])........................................................................................................... 466!
set([iterable]) ............................................................................................................................. 466!
slice([start,] stop[, step]) ............................................................................................................ 466!
str([object]) ................................................................................................................................ 467!
tuple([iterable]) .......................................................................................................................... 467!
type(name, bases, dict).............................................................................................................. 467!
unichr(i) ..................................................................................................................................... 467!
unicode([object[, encoding [, errors]]])........................................................................................ 467!
xrange([start,] stop[, step])......................................................................................................... 468!
Math Built-in Functions.................................................................................................................. 468!
abs(x)......................................................................................................................................... 468!
cmp(x, y).................................................................................................................................... 468!
divmod(a, b)............................................................................................................................... 468!
pow(x, y[, z]) .............................................................................................................................. 468!
round(x[, n]) ............................................................................................................................... 469!
Functions on Iterables.................................................................................................................... 469!
all(iterable)................................................................................................................................. 469!
any(iterable)............................................................................................................................... 469!
enumerate(sequence[, start=0])................................................................................................. 469!
filter(function, iterable)............................................................................................................... 469!
www.it-ebooks.info

■ CONTENTS
xvii
map(function, iterable, ...).......................................................................................................... 470!
max(iterable[, key])or max([, arg, ...][, key])................................................................................ 470!
min(iterable[, key]) or min([, arg, ...][, key]) ................................................................................ 470!
reduce(function, iterable[, initializer]) ......................................................................................... 470!
reversed(seq)............................................................................................................................. 470!
sorted(iterable[, cmp[, key[, reverse]]])....................................................................................... 470!
sum(iterable[, start=0]).............................................................................................................. 471!
zip([iterable, ...])......................................................................................................................... 471!
Conversion Functions..................................................................................................................... 472!
hex(x)......................................................................................................................................... 472!
long([x[, radix]]).......................................................................................................................... 472!
oct(x) ......................................................................................................................................... 472!
ord(c)......................................................................................................................................... 472!
Functions for Working with Code.................................................................................................... 472!
classmethod(function)................................................................................................................ 472!
compile(source, filename, mode[, flags[, dont_inherit]]) ............................................................. 473!
eval(expression[, globals[, locals]])............................................................................................. 474!
execfile(filename[, globals[, locals]]) .......................................................................................... 474!
property([fget[, fset[, fdel[, doc]]]]) ............................................................................................. 475!
staticmethod(function) ............................................................................................................... 476!
super(type[, object-or-type]) ......................................................................................................476!
Input Functions .............................................................................................................................. 477!
input([prompt])........................................................................................................................... 477!
raw_input([prompt])................................................................................................................... 477!
Functions for Working with Modules and Objects ........................................................................... 478!
callable(object)........................................................................................................................... 478!
delattr(object, name).................................................................................................................. 478!
dir([object]) ................................................................................................................................ 478!
getattr(object, name[, default])................................................................................................... 479!
globals()..................................................................................................................................... 479!
hasattr(object, name) ................................................................................................................. 479!
hash(object)............................................................................................................................... 480!
help([object]).............................................................................................................................. 480!
id(object).................................................................................................................................... 480!
isinstance(object, classinfo) ....................................................................................................... 480!
www.it-ebooks.info

■ CONTENTS
xviii
issubclass(class, classinfo) ........................................................................................................ 480!
len(s) ......................................................................................................................................... 480!
locals()....................................................................................................................................... 481!
reload(module)........................................................................................................................... 481!
repr(object) ................................................................................................................................ 482!
setattr(object, name, value)........................................................................................................ 482!
type(object)................................................................................................................................ 482!
vars([object]).............................................................................................................................. 482!
__import__(name[, globals[, locals[, fromlist[, level]]]]).............................................................. 483!
Index................................................................................................................................................485
!
www.it-ebooks.info
剩余544页未读,继续阅读
相关推荐









kn4444
- 粉丝: 0
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

最新资源
- Struts菜单教程:struts-menu-2.4.3压缩包
- appointy:基于GUI的JSON请求伪造测试工具
- VB6.0打印控件:MSFlexGrid及多种控件内容高效输出解决方案
- InceptionV2花卉识别模型及界面代码分享
- JDK1.8官方正版64位下载与安装教程
- Spring AOP XML实例入门教程
- ASRock华擎H77 Pro4/MVP主板BIOS 1.70版发布
- 简易STM32单片机LED闪烁程序详解
- 构建微服务:Go语言Echo框架入门指南
- JExcel:Java操作Excel文件的开放源码工具
- WebAppDaft学院:Python技术深度学习
- 三维网格远点采样技术及其网格保持研究
- Delphi实现WINSOCK UDP多播通信源代码解析
- 华擎H77 Pro4-M主板新BIOS驱动2.00版发布
- GAP包WreathProductElements:安装、使用与许可证指南
- 国外设计师简历模板大全(JPG、PDF格式)
安全验证
文档复制为VIP权益,开通VIP直接复制
