Can Python do the same things as Java?

6 Answers
Raghav Dua
Raghav DuaDeveloped AmicShop's back end, worked on Image Processing Projects in Python
574 Views
Unless you decide to be more specific than that, I’m going to assume you mean can Python & Java both perform:
  1. GUI Development
  2. Server-Side software & APIs
  3. Mathematical computation & Machine Learning
  4. Video/Audio (other binary data)
  5. Networking Software
  6. Other Application Software
Python & Java are both General Purpose Programming Languages. This means they had been designed in a way so as to enable the user to create almost anything. That said, it would be wiser to develop a Web Page in HTML rather than Python (although you CAN do it). They both have a large community and an even larger number of Modules &Libraries that give us different functionality.
Ultimately, they both have the same underlying capabilities of talking to the OS Kernel (via system calls), accessing hardware and networking services, manipulating processes and threads, GPUs, etc. These low level services are what gives us the ability to do all kinds of stuff with these languages.
For eg- for server side & API development, Python provides Frameworks like Django, Flask & Pyramid whereas Java provides frameworks like Drop Wizard.
(And here’s the fun part: regardless of the language and framework its made in, the underlying system call used by a typical networking server application is socket (), bind () & listen (). Refer to Beej's Guide to Network Programming)
for GUI development, Python provides Tkinter and Java provides Swing.
In this regard, Python, Java, C, C++ - all can accomplish the same task.
It is the different business needs that help us decide which language is the best for our scenario.
ps- One thing that will be really simple with Java but not so simple with Python isAndroid Development (but who knows, this might change in future).
Garry Taylor
Garry TaylorWrites Java,C,Python, Objective-C, PHP, C#,Swift
3.7k Views • Most Viewed Writer in Computer Programming with 1590+ answers
Yes, theoretically.
Python does not limit you in any real way vs. Java, the languages are equally powerful.
The reality is that while the languages are basically equally powerful, there are real-world issues which are more about the runtimes/libraries than the languages.
For example you might want to use a library or GUI toolkit, or web framework, which is available for one but not the other. That’s not a language issue, it’s a “reality on the ground” issue.
Reality on the ground will also affect performance, as Python’s default runtime is generally considered to be a fair bit slower than Java, and also it cannot use multiple processors, though there are many ways to mitigate both issues.
Theoretically, Python and Java are equally powerful, in practice I prefer the capabilities which I find easy to get hold of with Java, than I do in Python.
Rodolfo De Nadai
Rodolfo De NadaiWork as a programmer for about 10 years. Worked with PHP/Javascript/Java/Python
102 Views
It can! Pretty sure about that…
The only thing nowdays that i don’t see python doing but Java does is Android development… simply because Java is the main language on the platform and plays a big role in there.
For web development you have:
  1. Python
    1. django
    2. flask
    3. pyramid
    4. bottle
    5. many others…
  2. Java
    1. Spring
    2. JSF
    3. GWT
    4. Play
    5. many others…
For desktop development:
  1. Java
    1. Swing
    2. SWT
    3. Q Jambi (binding for QT)
  2. Python
    1. Tk
    2. wxPython
    3. PySide (binding for QT)
    4. PyQt (binding for QT)
For mobile (Android):
  1. Python
    1. Kivi
  2. Java
    1. Native support
Every other library or framework could be put in some of this categories or in between them in some niche category like: machine learning, pentest, numeric computation, networking and more…
Now days there’s much more support for machine learning in python (or at least you hear much more talk about) than in Java… but it’s a niche in TI.
Both languages are very good… do not sticky with only one… of course, learn one better than the other.
Kirk Augustin
Kirk AugustinProgrammed in Python for 5 years, but in C/C++ for 40 years.
1.8k Views
There is a huge difference. Java can use multiple processors and cores, while Python can not. Java has a full GUI development library, while Python does not. There are many other areas where Python clearly is not ready for prime time.
You can use Java for remote execution, because you can install the vm as well. But Python can not be remotely installed and downloaded. So it is useless for remote process control.
Adeel Ahmed
Adeel AhmedC#,Php, C++, Python, Asp.Net, Vb.net, Java
218 Views
No! There are some prominent differences between the two because they are different intellects.
Dynamic vs Static Typing
One of the biggest differences between Python and Java is the way that each language handles variables. Java forces you to define the type of a variable when you first declare it and will not allow you to change the type later in the program. This is known as static typing. In contrast, Python uses dynamic typing, which allows you to change the type of a variable, by replacing an integer with a string, for example.
Dynamic typing is easier for the novice programmer to get to grips with, because it means you can just use your variables as you want to without worrying too much about their types. However, many developers would argue that static typing reduces the risk of undetected errors plaguing your program. When variables do not need to be explicitly declared before you use them, it is easy to misspell a variable name and accidentally create a whole new variable.
Braces vs Indentation
Python is unusual among programming languages in that it uses indentation to separate code into blocks. Java, like most other languages, uses curly braces to define the beginning and end of each function and class definition. The advantage of using indentation is that it forces you to set your program out in a way that is easy to read, and there is no chance of errors resulting from a missing brace.
You can learn more about the unique features of Python in The Ultimate Python Programming Tutorial. This course will teach you to create clear, efficient code, as well as how to debug your applications after writing them.
Speed vs Portability
The great advantage of Java is that it can be used to create platform-independent applications. Any computer or mobile device that is able to run the Java virtual machine can run a Java application, whereas to run Python programs you need a compiler that can turn Python code into code that your particular operating system can understand. Thanks to the popularity of Java for web applications and simple desktop programs, most devices already have the Java virtual machine installed, so a Java programmer can be confident that their application will be usable by almost all users. The disadvantage of running inside a virtual machine is that Java programs run more slowly than Python programs.
Python vs Java: Which is Easier to Use?
Most programmers agree that Python is an easier language for novice programmers to learn. You will progress faster if you are learning Python as a first language than Java. However, the popularity of Java means that learning this powerful language is essential if you want to develop apps for Android, for example. If you do need to learn Java, then help is at hand: The Ultimate Java Tutorial will walk you through everything you need to know.
Peter Bleackley
Peter BleackleyI have used 9 programming languages.
179 Views
Looking at the languages' features, one thing you can do in Python that you can't do in Java is operator overloading.
This makes it easier to do mathematical programming in Python for two reasons. First, formulae are much easier to read and write in standard mathematical notation than long chains of method calls. Secondly, the language looks after operator precedence for you.

Comments

Popular posts from this blog

Short Story Idea

ALBERT EINSTEIN QUOTES TO TICKLE YOUR FANCY!!!