试图在python和java之间进行选择 [英] Trying to choose between python and java

查看:76
本文介绍了试图在python和java之间进行选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我目前正在尝试在使用python或java之间做出决定并且有几个关于python的快速问题你可能能够帮助。


#1 python是否有像javas .jar包这样的东西。 jar文件

包含所有程序文件,你可以用

执行程序java -jar program.jar


我我有点希望python有这样的东西,因为我觉得它

使得在平台之间分发更容易,例如linux,mac

windows等


#2人们推荐使用python的数据库

易于分发跨越linux,mac,windows。


#3有没有相当于jfreechart和jfreereport

http://www.jfree.org 了解详情)在python中。


#4如果我写的话一个程序用linux下的python-wxgtk2.6进行测试

程序窗口看起来可能在windows和mac下面吗?


#5有人说他们过去常常使用python但因为

语言改变或使东西折旧(我完全记得

哪个)和旧代码停止工作而停止了。今天编写的代码可能会在5年以上仍然有效吗?或者它们是否会折旧并且您需要更新?


无论如何,希望有人可以帮助我最后几个问题

我有。


其他人也有任何有用的评论关于python vs java

没有开始一场火焰战。

-

亲切的问候,

Anthony Irwin

http://www.irwinresources.com
http://www.makehomebusiness.com

电子邮件:上述域名的anthony, - www。

解决方案

在< f2 ********** @ news-01.bur.connect.com.au>中,Anthony Irwin写道:


#1 python是否有像javas .jar包这样的东西。 jar文件

包含所有程序文件,你可以用

执行程序java -jar program.jar



有.egg文件,但通常分发一个程序包含

几个文件不是一个大问题。有一种机制可以编写一个

`setup.py`,将文件复制到正确的位置。在库文档中查找

`distutils`。


#2人们推荐使用什么数据库与python一起使用

易于在linux,mac,windows上分发。



从Python 2.5开始,标准库包含SQLite支持。对于MySQL,PostgreSQL,Oracle等许多DBMS都有第二方库。


Windows下MySQL绑定的情况有点麻烦最近
。绑定的作者没有使用Windows而且没有提供预先构建的二进制文件。


#4如果我写了一个用linux下的python-wxgtk2.6编程测试它是什么?b $ b程序窗口看起来可能在windows和mac下面吗?



可能是的,但你最好检查一下。这同样适用于Java GUI。


#5有人说他们曾经使用过python而停止了因为

语言改变了或使得东西折旧了(我完全记得

哪个)和旧代码停止工作。今天编写的代码可能会在5年以上仍然有效吗?或者它们是否会折旧并且您必须更新?



这听起来很奇怪,因为语言和标准库非常好向后兼容。有些东西已被弃用了

文档和某些情况下的运行时警告,但代码仍然有用。


使用Python 3.0,有些东西会休息,因为随着时间的推移,

语言和库中存在一些残余,只是因为向后支持
兼容性是如此高优先级。 2.x系列将支持

平行于3.x的时间,因此有足够的时间进行迁移。


Ciao,
Marc''BlackJack''Rintsch




" Anthony Irwin" < no **** @ noemailhere.nowherewrote in message

news:f2 ********** @ news-01.bur.connect.com.au ...

| #2人们推荐使用什么数据库与python一起使用

|易于在linux,mac,windows上分发。


查看sqlite3模块。 (但我还没用过它。)


| #5有人说他们曾经使用过python而停止了因为

|语言改变或使东西折旧(我完全记得

|哪个)和旧代码停止工作。今天写的代码可能是

|仍然可以工作5年以上,或者他们贬值东西,你必须更新?b / b
大多数版本的Python仍然可用。您可以自由使用和

无限期地分发您的副本。几个旧版本仍在使用




最新版本增加了功能,但除了错误之外删除的很少。

不幸的是,删除bug有时会破坏代码。功能增加

偶尔会引入错误或以其他方式破坏代码,但这就是为什么

是最终版本之前的alpha,beta和候选版本。


Python3会一次删除很多东西。一个转换工具正在写b
。如果有的话,没有期望生产代码应该立即转换为




Terry Jan Reedy


Anthony Irwin写道:


大家好,


我目前正在努力决定使用python或java并且有几个关于python的快速问题你可以帮忙。


#1 python是否有类似javas的内容.jar包。 jar文件

包含所有程序文件,你可以用

执行程序java -jar program.jar


我我有点希望python有这样的东西,因为我觉得它

使得在平台之间分发更容易,例如linux,mac

windows等


#2人们推荐使用python的数据库

易于分发跨越linux,mac,windows。


#3有没有相当于jfreechart和jfreereport

http://www.jfree.org 了解详情)在python中。


#4如果我写的话一个程序用linux下的python-wxgtk2.6进行测试

程序窗口看起来可能在windows和mac下面吗?


#5有人说他们过去常常使用python但因为

语言改变或使东西折旧(我完全记得

哪个)和旧代码停止工作而停止了。今天编写的代码可能会在5年以上仍然有效吗?或者它们是否会折旧并且您需要更新?


无论如何,希望有人可以帮助我最后几个问题

我有。


其他人也有任何有用的评论关于python vs java

没有开始火焰战。



火焰战?在所有合理的成人程序员中间?它永远不会发生



1)我一直认为jar文件很奇怪。改变你的运行模式

python脚本,然后一遍又一遍地运行它。

chmod u + x program.py

.. /program.py

毫无疑问,你是(颤抖)一个Windows用户(并且在晚上在

壁橱中打败自己)。毫无疑问,Windows具有在文件上设置

特权以使其可执行的功能。运气好的话,我永远都不会知道。


2)Python接口与我见过的每个数据库附近,

无论如何数据库位于同一系统或远程。在最坏的情况下

的情况下,它似乎有ODBC连接(是的,我知道,C和连接是

同样的事情,就像美国人说Fujiyama,是

当然,富士山(Mount Fuji Mount)功能。不像目标

连接器那么精确,但它确实有效。甚至有多种方法可以看到

数据库。作为字符串,列表,对象,行,表和词典。

这是一个非常强大的工具。图片,选择你如何看到''
数据库。谁会有thunk!


3)不知道jfree。也许在Google上进行一些关键字搜索或

Sourceforge会给你一个答案。


6)从未编程过wx。但它似乎在程序上非常稳定

我已经下载了。无论如何将一个GUI映射到另一个GUI总是一个不精确的努力(特别是当你在产品上拥有235项专利时,你不敢告诉任何人有关b $ b)。没有两种心态真正满足,

尤其是涉及金钱的时候。


5)所有语言都在增长。克服它。但是,如果您保留旧的

解释器,您仍然可以运行旧脚本。在NCR,我不得不支持
支持6种不同版本的Perl,因为程序员不会修改/更新他们的代码。似乎他们有更好的事情要做,你可以

总是期待系统管理员保存你的培根。

但是如果你没有达到这一点(六个版本到支持)但是,在升级前的测试中,你可以运行程序并记下将要破旧的

功能。通常,在删除破旧功能之前,您会有一些次要的版本(年份或更长时间)。

然后您可以决定是否升级/修复或运行多个版本的

python是适合你的路径。使用PYTHONPATH环境

变量是一种很好的方法,可以通过较旧的翻译重定向旧脚本以使用破旧的

功能。


(6)你没有问过。作为系统管理员,我讨厌Java。这是一种资源匮乏。

小任务占用数百兆字节的RAM。人们可以期待什么。

它是计算机内部的虚拟机。猪必须! Python在内存占用方面略微变得有点苗条,我觉得调试要好得多了.b
。甚至strace也可用于python程序。从来没有工作过Java脚本。


(7)你没有问过。上个月在python-list上发生了关于

java / python的全面火焰战争。大约15天后它逐渐消失。你可以查看档案以了解自己的档案(所以我们没有

重复战争,只为你)。


sph

-

HEX:09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


Hi All,

I am currently trying to decide between using python or java and have
a few quick questions about python that you may be able to help with.

#1 Does python have something like javas .jar packages. A jar file
contains all the program files and you can execute the program with
java -jar program.jar

I am sort of hoping python has something like this because I feel it
makes it easier to distribute between platforms e.g. linux, mac
windows etc.

#2 What database do people recommend for using with python that is
easy to distribute across linux, mac, windows.

#3 Is there any equivalent to jfreechart and jfreereport
(http://www.jfree.org for details) in python.

#4 If I write a program a test it with python-wxgtk2.6 under linux are
the program windows likely to look right under windows and mac?

#5 someone said that they used to use python but stopped because the
language changed or made stuff depreciated (I can fully remember
which) and old code stopped working. Is code written today likely to
still work in 5+ years or do they depreciate stuff and you have to update?

Anyway hopefully someone can help me out with these last few questions
I have.

Also does anyone else have any useful comments about python vs java
without starting a flame war.
--
Kind Regards,
Anthony Irwin

http://www.irwinresources.com
http://www.makehomebusiness.com
email: anthony at above domains, - www.

解决方案

In <f2**********@news-01.bur.connect.com.au>, Anthony Irwin wrote:

#1 Does python have something like javas .jar packages. A jar file
contains all the program files and you can execute the program with
java -jar program.jar

There are .egg files but usually distributing a program consisting of
several files isn''t a big problem. There is a mechanism to write a
`setup.py` that copies the files into the correct locations. Look for
`distutils` in the library docs.

#2 What database do people recommend for using with python that is
easy to distribute across linux, mac, windows.

From Python 2.5 the standard library contains SQLite support. There are
third party libraries to many DBMSs like MySQL, PostgreSQL, Oracle etc.

The situation with MySQL bindings under Windows was a bit troublesome
recently. The author of the bindings doesn''t use Windows and does not
provide pre-built binaries.

#4 If I write a program a test it with python-wxgtk2.6 under linux are
the program windows likely to look right under windows and mac?

Likely yes, but you better check. Same applies to Java GUIs.

#5 someone said that they used to use python but stopped because the
language changed or made stuff depreciated (I can fully remember
which) and old code stopped working. Is code written today likely to
still work in 5+ years or do they depreciate stuff and you have to update?

That sounds odd because the language and standard library is very
backwards compatible. There are some things deprecated with a comment in
the docs and in some cases runtime warnings, but the code still works.

With Python 3.0 some things will break, because there''s some cruft in the
language and library that accumulated over time, just because backwards
compatibility was such a high priority. The 2.x series will be supported
for some time parallel to 3.x, so there is enough time to migrate.

Ciao,
Marc ''BlackJack'' Rintsch



"Anthony Irwin" <no****@noemailhere.nowherewrote in message
news:f2**********@news-01.bur.connect.com.au...
| #2 What database do people recommend for using with python that is
| easy to distribute across linux, mac, windows.

Check out the sqlite3 module. (But I have not used it yet).

| #5 someone said that they used to use python but stopped because the
| language changed or made stuff depreciated (I can fully remember
| which) and old code stopped working. Is code written today likely to
| still work in 5+ years or do they depreciate stuff and you have to
update?

Most versions of Python are still available. You are free to use and
distribute your copies indefinitely. Several older versions are still in
use.

Recent releases have added features but removed very little except bugs.
Unfortunately, bug removal sometimes breaks code. And feature additions
occasionally introduce bugs or otherwise break code, but that is why there
are alpha, beta, and candidate releases before a final release.

Python3 will remove many things at once. A conversion tool is being
written. And there is no expectation that production code should be
immediately converted, if ever.

Terry Jan Reedy


Anthony Irwin wrote:

Hi All,

I am currently trying to decide between using python or java and have
a few quick questions about python that you may be able to help with.

#1 Does python have something like javas .jar packages. A jar file
contains all the program files and you can execute the program with
java -jar program.jar

I am sort of hoping python has something like this because I feel it
makes it easier to distribute between platforms e.g. linux, mac
windows etc.

#2 What database do people recommend for using with python that is
easy to distribute across linux, mac, windows.

#3 Is there any equivalent to jfreechart and jfreereport
(http://www.jfree.org for details) in python.

#4 If I write a program a test it with python-wxgtk2.6 under linux are
the program windows likely to look right under windows and mac?

#5 someone said that they used to use python but stopped because the
language changed or made stuff depreciated (I can fully remember
which) and old code stopped working. Is code written today likely to
still work in 5+ years or do they depreciate stuff and you have to update?

Anyway hopefully someone can help me out with these last few questions
I have.

Also does anyone else have any useful comments about python vs java
without starting a flame war.

Flame war? Here amongst all the reasonable adults programmers? It never
happens.

1) I always thought jar files were weird. Change the run mode on you
python script and just run it, over and over.
chmod u+x program.py
../program.py
No doubt you are (shudder) a Windows user (and beat yourself in the
closet at night as well). No doubt Windows has a feature to set the
privilege on a file to make it executable. With any luck, I''ll never know.

2) Python interfaces with with damn near every database I''ve ever seen,
regardless if the database is on the same system or remote. At worst
case, it seems to have ODBC connection (yes I know, C and connect are
the same thing, like an American saying Mount Fujiyama, which is of
course, Mount Fuji Mount) feature. Not as precise as a targeted
connector, but it works. There are even multiple ways to ''see'' the
database. As strings, lists, objects, rows, tables and dictionaries.
It''s all quite a powerful tool. Image, getting to choose how you ''see''
the database. Who''d have thunk!

3) No idea about jfree. Perhaps a few keyword searchs on Google or
Sourceforge would give you an answer.

6) Never programmed wx. But it seems to be very stable on the programs
I''ve downloaded. Anyway mapping one GUI to another is always an
imprecise effort (especially when you have 235 patents on the product
that you dare not tell anyone about). No two mindset ever really meet,
especially when money is involved.

5) All languages grow. Get over it. But, if you keep the older
interpreter around, you can still run your old scripts. At NCR I had to
support 6 different version of Perl because the programmers wouldn''t
fix/update their code. Seem they had better things to do and you can
always expect the Sysadmin to save your bacon.
But if you haven''t got to that point (six version to support) yet,
during pre-upgrade tests, you might run the program and note the
features that are going to be decrepit. Generally you have a few minor
version releases (year or more) before the decrepit feature is dropped.
Then you can decide if upgrading/fix or running multiple version of
python is the right path for you. Using the PYTHONPATH environment
variable is a good way to redirect your older scripts to use decrepit
feature via an older interpreter.

The (6) you didn''t ask. As a Sysadmin, I hate Java. It''s a resource hog.
Little tasks take hundreds of megabytes of RAM. What can one expect.
It''s a virtual machine inside your computer. Hog it must be! Python is a
bit slimmer on the memory footprint and I think a hell of a lot easier
to debug. Even strace can be used on python programs. Never got strace
to work on Java scripts.

The (7) you didn''t ask. Last month there was a full flame war about
java/python on the python-list. It petered out after about 15 days. You
might review the archives to get a sense for yourself (so we don''t have
repeat the war, just for you).

sph
--
HEX: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


这篇关于试图在python和java之间进行选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆