473,569 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

python vs java

hi,

some of my friends told that python and java are similar in the idea of
platform independency. Can anyone give me an idea as i'm a newbie to java
and python but used to C++. My idea is to develop an app which can run both
in windows and linux.

Pls help.

Thanks in advance....
Sep 6 '06 #1
8 2428

Aravind wrote:
hi,

some of my friends told that python and java are similar in the idea of
platform independency. Can anyone give me an idea as i'm a newbie to java
and python but used to C++. My idea is to develop an app which can run both
in windows and linux.
That's true to an extent. Both Java and Python come with extensive
standard libraries, providing a useful toolkit for the programmer.
Python does have a number of cross-platform GUI toolkits abailable too,
including one in the standard library, although WxWidgets (formerly
WxWindows) is also popular.

I'd say that Python is easier to learn and more productive as a
language, but Java has a much larger selection of add-ons and libraries
available. I can't give you much more help without knowing what the app
will do, and therefore what language features or library/framework
support would be helpful.

Simon Hibbs

Sep 6 '06 #2

Aravind wrote:
some of my friends told that python and java are similar in the idea of
platform independency.
Similar in goal, but quite different in approach.

Python supports lots of platforms and goes to great lengths to offer
facades around whatever features a platform does have, so as to offer
the same benefits as Unix. Java lives in a virtualised environment
where it pretends there aren't any platforms. Perl pretends everything
_is_ Unix and falls flat when it isn't.

If you can cope with this, Java is simpler and less platform-bound.

If you actually need to get OS-level work done, Python is wonderful.
You can write stuff that hooks in at a fairly deep level, yet really is
portable.

Sep 6 '06 #3
On Wed, 6 Sep 2006 17:53:29 +0530, Aravind <ar************ @yahoo.co.inwro te:
hi,

some of my friends told that python and java are similar in the idea of
platform independency. Can anyone give me an idea as i'm a newbie to java
and python but used to C++.
Well, what Java and Python (and some other languages) have in common is a
large standard library.

The C++ standard library is smaller, and doesn't cover things like advanced
file I/O, networking, concurrency, or user interfaces. You either have to
find third-party portable libraries for the things you want to do, or target
a specific platform.

As a side note, Python differs from Java by happily including non-portable
things in its standard library. If Unix people need access to poll(2); fine,
then they make it available, even though it won't work on e.g. Win32.
And document that it isn't portable.

/Jorgen

--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.dyn dns.org R'lyeh wgah'nagl fhtagn!
Sep 6 '06 #4
Aravind wrote:
hi,

some of my friends told that python and java are similar in the idea of
platform independency.
Well, not quite IMHO.

Java treats the problem by taking the autistic attitude of pretending
the underlying platform doesn't exists - which can be a major PITA.

Python is much more pragmatic, and can even offer really strong
integration with the platform *without* sacrifying portability - the
core language is platform-independant and tries to help you wrinting
platform-independant code (cf the os and os.path modules), and
platform-specific stuff is usually isolated in distinct packages with a
BIG caution note on it !-)
Can anyone give me an idea as i'm a newbie to java
and python but used to C++. My idea is to develop an app which can run both
in windows and linux.
With a GUI ? If so, you probably want to check out wxPython or PyGTK
(wxPython will also buy you MacOS X IIRC, and wil perhaps be easier to
install on Windows).

Else (web, command-line, what else ?), you should not have any
particular problem as long as you avoid using platform-specific packages
and always use the portability helper features (ie os.path etc).

Coming from C++, you'll probably need a few days to grasp Python's
object model and idioms (Python looks much less like a dumbed-down C++
than Java), but my bet is that you'll be productive *way* sooner with
Python, and *much* more productive.

My 2 cents,
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom. gro'.split('@')])"
Sep 6 '06 #5
Bruno Desthuilliers wrote:
With a GUI ? If so, you probably want to check out wxPython or PyGTK
(wxPython will also buy you MacOS X IIRC, and wil perhaps be easier to
install on Windows).
Just a warning: wxPython does operate slightly differently between Mac
OS X, Linux, and Windows. The differences are usually minor and easy
to clean up in a cross-platform manner, but be aware that you need to
test on all platforms that you're going to release on.

For example, MDI apps are anthema to Linux's GTK, so wxGTK uses a
tabbed dialog to approximate the same thing. While Mac OS X can
associate a Python object (in my case, None) with a hidden top-level
tree control node, Windows will throw a C++ assertion.

If you are used to using MFC, wxWidgets (which wxPython uses) provides
a very MFC'ish programming experience. It's pretty decent, and the
wxPython demo provides lots of neat interactive examples.

--Jason

Sep 6 '06 #6
Jason wrote:
Bruno Desthuilliers wrote:
>With a GUI ? If so, you probably want to check out wxPython or PyGTK
(wxPython will also buy you MacOS X IIRC, and wil perhaps be easier to
install on Windows).

Just a warning: wxPython does operate slightly differently between Mac
OS X, Linux, and Windows. The differences are usually minor and easy
to clean up in a cross-platform manner, but be aware that you need to
test on all platforms that you're going to release on.
I don't think one could pretend writing a cross-platform application
without testing it on all targeted platforms.

(snip)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom. gro'.split('@')])"
Sep 7 '06 #7
2006/9/7, Bruno Desthuilliers <on***@xiludom. gro>:
I don't think one could pretend writing a cross-platform application
without testing it on all targeted platforms.
E.g: while creating a free software, you may not have an Apple
computer but you may want to be *possible* to run your program there.
You don't test it, but you *think* it runs there. Not everybody has a
spare MacOS X to test apps.

Of course, if your software *needs* to run in some particular OS then
you have to test on it.

--
Felipe.
Sep 7 '06 #8
Felipe Almeida Lessa wrote:
2006/9/7, Bruno Desthuilliers <on***@xiludom. gro>:
I don't think one could pretend writing a cross-platform application
without testing it on all targeted platforms.

E.g: while creating a free software, you may not have an Apple
computer but you may want to be *possible* to run your program there.
You don't test it, but you *think* it runs there. Not everybody has a
spare MacOS X to test apps.
Ah, but those with the Intel Apples can run Linux, Windows, and Mac OS
X at the same time! *grin*

Actually, that's how I'm working on my wx/Python application. I write
it under Mac OS X and occasionally pull it into my Windows and Ubuntu
virtual machines for further testing.
Of course, if your software *needs* to run in some particular OS then
you have to test on it.
Certainly. And this point should be emphasized for any cross-platform
language, especially for folk who may not have done such development
before. The "write once, run everywhere" phrase does have a footnote.
Python's documentation is very good at pointing out what is platform
independent and what isn't, but other packages are not as thorough.

--Jason

Sep 7 '06 #9

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

Similar topics

2
3453
by: Dave Brueck | last post by:
Below is some information I collected from a *small* project in which I wrote a Python version of a Java application. I share this info only as a data point (rather than trying to say this data "proves" something) to consider the next time the "Python makes developers more productive" thread starts up again. Background ========== An...
1
3015
by: bezeee | last post by:
At my work we are in the process of building a tool to test an XML based API. Basically, XML in and XML out over http. Currently, there are two engines that do all of the schema validations, xml diffs, sending/receiving, etc. One of these engines in implemented in C# and the other in Java. Now the choice comes down to which scripting...
46
6221
by: Jon Perez | last post by:
Can one run a 1.5 .pyc file with the 2.x version interpreters and vice versa? How about running a 2.x .pyc using a 2.y interpreter?
14
3277
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...
114
9725
by: Maurice LING | last post by:
This may be a dumb thing to ask, but besides the penalty for dynamic typing, is there any other real reasons that Python is slower than Java? maurice
53
3503
by: john67 | last post by:
The company I work for is about to embark on developing a commercial application that will cost us tens-of-millions to develop. When all is said and done it will have thousands of business objects/classes, some of which will have hundreds-of-thousands of instances stored in a DB. Our clients will probably have somewhere between 50-200 users...
2
1799
by: Hal Vaughan | last post by:
I'm self taught and most of what I've been working on for the past several years has been entirely in Perl and Java. I've noticed that I can code about 5 times faster in Perl than Java, in part because I feel like whenever I want to do something in Java, I have to create an object, do a few preperatory things, then do what I need, but in...
30
2757
by: Stuart Turner | last post by:
Hi Everyone, I'm working hard trying to get Python 'accepted' in the organisation I work for. I'm making some good in-roads. One chap sent me the text below on his views of Python. I wondered if anyone from the group could give me some advice on how to respond / if they had been in a similar position. Any help appreciated, Thanks in...
25
5718
by: abhinav | last post by:
Hello guys, I am a novice in python.I have to implement a full fledged mail server ..But i am not able to choose the language.Should i go for C(socket API) or python for this project? What are the advantages of one over the other in implementing this server.which language will be easier? What are the performance issues?In what language are...
17
2955
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...
0
7695
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...
0
7922
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. ...
0
7964
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...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
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...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1209
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.