473,699 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to choose between python and java

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.
May 15 '07 #1
34 3677
In <f2**********@n ews-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
May 15 '07 #2

"Anthony Irwin" <no****@noemail here.nowherewro te 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

May 15 '07 #3
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

May 15 '07 #4
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.
It depends on what you see as the benefit of jar's. If it is purely a
matter of packing your whole application up into a single file that you
can distribute then there are a number of tools to do that, each with
their limits. Search for cx_freeze or py2exe (win32 only).
#2 What database do people recommend for using with python that is easy
to distribute across linux, mac, windows.
You could use sqlite, which comes included with Python 2.5. The database
files it creates are cross-platform usable and using sqlite saves you
the trouble of having to set up a database server
#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 guaranteed no. You'll simply have to test to see how
your program comes out on the other platforms. You could use a GUI
toolkit that draws its own widgets instead of one that uses the native
controls, like wxPython does. PyGTK comes to mind, not sure if it is
available on the 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?
The changes I can remember from the last couple of years seem to be
mostly addition of new features to the language and more standard
modules being included in the standard Python distribution. Of course,
some things were deprecated, but I think actual code-breaking changes
were not that common. But with Python 3.0 (still a long time to go)
there will definitely be some incompatibiliti es, but a lot can probably
be fixed automatically using an included conversion tool.

Here's a description of the changes in the last 3 releases (2.5, 2.4,
2.3). These span a bit more than 3 years, as 2.3.0 was released on July
29th, 2003, with 2.5.0 on September 19th, 2006. Perhaps you can get a
feel for the kind of changes from one release to the next.

http://docs.python.org/whatsnew/whatsnew25.html
http://www.python.org/doc/2.4/whatsnew/whatsnew24.html
http://www.python.org/doc/2.3/whatsnew/
Also does anyone else have any useful comments about python vs java
without starting a flame war.
I guess it all depends on what you're going to use it for and what your
goals and restrictions are. I've never seriously used Java (only a bit
of C#), but I've been developing a GUI app with wxPython for the last
couple of months and am pretty happy with it. Before that, I did lots of
tooling with Python (conversion scripts, small computational stuff, etc)
and was happy as well. So overall, I'm happy with Python :)

It's pretty powerful for a wide variety of applications, comes with a
large collection of modules for everything from networking to file
compression to encryption to xml parsing to database handling to ...
(see http://docs.python.org/lib/lib.html). I find code in Python to be
more easily readable because of the absence of unneeded brackets and the
fact that code that forms a block is always aligned properly (eeek,
possible flame-war subject here). And it saves on the number of type
strokes as well. Overall, great stuff!

Paul
May 15 '07 #5
Ant
On May 15, 6:30 am, Anthony Irwin <nos...@noemail here.nowherewro te:
#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
As someone else has said, Python has eggs: http://peak.telecommunity.com/DevCenter/PythonEggs
#3 Is there any equivalent to jfreechart and jfreereport
(http://www.jfree.orgfor details) in python.
I can't remember what it is I use - I haven't got access to my server
at the moment... But look in the cheese shop - I'm fairly sure it was
from there. I'll post details if I remember. Alternatively this looks
good (though I haven't tried it and it's only free for non-commercial
use): http://www.dislin.de
#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?
Any language will have some compatibility problems when upgrading to a
different version, and so you have the option of updating your program
or using an old version of the language. I'm a professional Java
developer, and though Java 6 has been out for some time now, every
company I've worked for in the last couple of years still uses Java
1.4 due to problems with the upgrade.

Python does strive however to stay backward compatible (3k not
withstanding), and I've upgraded from 2.3 to 2.4 and now 2.5 with no
problems.
Also does anyone else have any useful comments about python vs java
without starting a flame war.
As I said, I'm a professional Java developer, and much prefer
programming in Python when I can (and am even getting quite a lot of
Python work at the moment via Jython :-) )

--
Ant...

http://antroy.blogspot.com/
May 15 '07 #6
>#3 Is there any equivalent to jfreechart and jfreereport
>(http://www.jfree.org for details) in python.
ChartDirector
http://www.advsofteng.com/download.html

Again, not free for commercial use, but very versatile.

~Sean

May 15 '07 #7
Anthony Irwin a écrit :
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
Python eggs
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.
Note that while highly portable (and ported), Python is not as autistic
as Java and doesn't try to pretend the underlying platform doesn't
exists...
#2 What database do people recommend for using with python that is easy
to distribute across linux, mac, windows.
If you're thinking of embedded databases, the answer is SQLite. Else,
PostgreSQL and MySQL both run on Windows and mowt unices.
#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
s/depreciated/deprecated/
(I can fully remember which)
and old code stopped working.
This is very strange, and even looks like FUD. Python has gone very far
into maintaining compatibility, and there's a lot of pretty old code
still running on latest Python versions.
Is code written today likely to still work
in 5+ years or do they depreciate stuff and you have to update?
I still use code written more than five years ago.
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.
Err... reading the last words, I think I'd better shut my mouth now.

May 15 '07 #8
Steven Howe a écrit :
(snip)
>>
Flame war? Here amongst all the reasonable adults programmers? It never
happens.
Lol ! +1 QOTW
May 15 '07 #9
En Tue, 15 May 2007 05:43:36 -0300, Bruno Desthuilliers
<br************ ********@wtf.we bsiteburo.oops. comescribió:
>Is code written today likely to still work
in 5+ years or do they depreciate stuff and you have to update?

I still use code written more than five years ago.
Just as an example, PIL (Python Imaging Library) works unchanged with any
version from Python 1.5 (released 1999) till the latest 2.5 (released this
year)

--
Gabriel Genellina

May 15 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2842
by: Don Bruder | last post by:
A week or two ago, I asked here about porting Python to C. Got some good answers (Note 1) but now I've got another question. Actually, more a request for clarification of a topic that both the Python tutorial and docs leave a touch murky to my understanding. Dictionaries/"dict" types... Am I understanding/interpreting correctly when I go with the idea that a "dict" variable can be looked at as (effectively) two parallel arrays?...
14
3300
by: Wolfgang Keller | last post by:
Hello, as a non-developer I am currently participating in an industrial "research" project to develop a so-called "web application". This application serves at the same time as middleware to connect several other "conventional" enterprise-applications such as ERP, SCADA etc. and to provide a GUI frontend to the users. The developers are into Struts, Enterprise Java Beans and the like, so it will be entirely implemented in Java with all...
9
3764
by: F. GEIGER | last post by:
I've dev'ed a Python prototype of an app, that besides the internals making it up has a gui. While test-driven dev'ing the app's internals in Python is fun as usual, dev'ing the GUI is not so funny, at least for me. I guess dev'ing a GUI in a test-driven way is not possible, or is it? I'm using wxPython, so if anyone has an idea... For now most of the time I extend and change the gui things, then run it, do the clicks to go thru the...
6
3541
by: VM | last post by:
Although I program in C# and all of the projects I work on are in C#, I was just wondering why someone would choose VB .Net or C#. Since VB .Net is as similar to VB6 as C# is toVB6, why would a programmer choose one over the other? The reason I chose C# is because it's somewhat similar to C (and I've never liked VB6). I've had clients ask me that but I don't have a definite answer. Any links with info would be greatly appreciated. ...
17
2970
by: MilkmanDan | last post by:
I'll be a college freshman this fall, attending Florida Institute of Tech studying electrical engineering. I was considering taking some classes in programming and computer science, and I happened to notice that everything taught is using C++. After further research, it seems to me that C++ seems to be the dominating language in universities. By comparison, our local community college teaches a few classes in VB, Java, Javascript,...
0
8694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8621
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9041
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8928
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8890
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3060
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2355
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.