V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
feihu
V2EX  ›  Python

有人在实际开发环境中使用python调用java的lib吗?请给点建议

  •  
  •   feihu · May 2, 2013 · 7205 views
    This topic created in 4747 days ago, the information mentioned may be changed or developed.
    10 replies    1970-01-01 08:00:00 +08:00
    tkliuxing
        1
    tkliuxing  
       May 2, 2013
    请使用jython
    Muninn
        2
    Muninn  
       May 2, 2013
    见楼上 而且何苦呢~
    python的lib很齐全的呀其实
    除非是要调用以前自己写的
    可是重写一遍顺便重构这种事情不是很爽么。。。
    jjx
        3
    jjx  
       May 2, 2013
    dreampuf
        4
    dreampuf  
       May 2, 2013
    不推荐,使用JPype封装了Apache POI,写用JAVA API写Python Code
    推荐Groovy或者Jython,封装为jar后命令行调用吧。
    kshatriya
        5
    kshatriya  
       May 3, 2013
    java? Clojure
    mrluanma
        6
    mrluanma  
       May 3, 2013
    用Python的C-API通过JNI调用Java API,Java的著名程序Lucene的Python封装PyLucene就是用的这个思路。

    它们的代码生成器叫做JCC:http://lucene.apache.org/pylucene/jcc/
    ygtq
        7
    ygtq  
       May 3, 2013
    lz,你和我的头像一样!!
    jamiesun
        8
    jamiesun  
       May 4, 2013
    大多数情况下直接命令行调用jar完全够了。
    feihu
        9
    feihu  
    OP
       May 4, 2013
    @jamiesun 直接命令行会不会很占内存?我只有一台小机器。怕带不动
    @tkliuxing jython有成功的案例吗?
    jamiesun
        10
    jamiesun  
       May 4, 2013
    @feihu 主要还是看你应用在什么场景了,如果只是个人应用,没什么担忧的,顶多在调用java时增加一些内存限制,不至于把系统搞死。

    若是网络应用,基于socket消息通讯机制来做更好,比如使用thrift。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2561 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 12:43 · PVG 20:43 · LAX 05:43 · JFK 08:43
    ♥ Do have faith in what you're doing.