473,903 Members | 4,410 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Will Python Be Good For This Type Of Project?

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 Perl, I just call the
routine.

Java, however, does much better at cross platform apps, especially if I need
a GUI (I find Swing easy to use). I need to write a setting editor which
basically consists of a GUI with a lot of checkboxes, radio buttons, and
option select lists. I originally had something to do this in Javascript,
but Javascript was not strong enough to let me create data structures to
keep track of the data. I had to store it in 3d arrays, which was hard to
keep up with.

I was planning on writing the new setting editor in Java for several
reasons, including the ability to create my own objects to store groups of
settings. I also can write it so it'll run on a computer by itself, or as
an applet with very little extra work. That's a benefit, since it means it
can be run from anywhere through a Java enabled browser and a username and
password. It can also be run on a system where it's been installed without
using a browser (either way, it reads and writes the settings from a URL).

Someone on a mailing list I'm on has suggested that I look into Python, and
use Jython to compile it. I see that I can write applications and applets
in Python (but I haven't seen references to being able to write one
application just once and have it work as both). I also know Python is a
higher level than Java (a few people I know say it's almost like writing
pseudo code).

At this time I don't know Python (I've looked at some sample code and I'm
still getting used to loops and if statements without closing braces!).
What I'm trying to determine is 1) if it's relatively easy to write a
program to work as an application AND an applet (depending on how it's
called), 2) If it'll handle the networking to read what amounts to web
pages full of setting info and write that back in POST statements without
problems from the user's point of view and easily from the programmer's
point of view, 3) What coding time and difficulty is like in Python
compared to, most specifically, Java and Perl, 4) Is it easy for me to
interface Java and Python classes seamlessly, and 5) (I realize only I can
answer this for sure, but opinions and experience of others would be a
help!) Is Python easy enough and fast enough to code in that it'd be worth
me taking time to learn it and doing the project Python instead of Java?

Any help, thoughts, comments, and such are appreciated!

Thank you!

Hal
Sep 29 '05 #1
2 1826
Hal Vaughan wrote:
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 Perl, I just call the
routine.

Java, however, does much better at cross platform apps, especially if I need
a GUI (I find Swing easy to use). I need to write a setting editor which
basically consists of a GUI with a lot of checkboxes, radio buttons, and
option select lists. I originally had something to do this in Javascript,
but Javascript was not strong enough to let me create data structures to
keep track of the data. I had to store it in 3d arrays, which was hard to
keep up with.
If you find Swing interfaces easy to build ans use then Jython should be
a natural: you can do all the GUI stuff in Java and control it from
Jython, thereby neatly avoiding yet another potential "What's the best
GUI toolkit" [answer: same place as the world's best hamburger].
I was planning on writing the new setting editor in Java for several
reasons, including the ability to create my own objects to store groups of
settings. I also can write it so it'll run on a computer by itself, or as
an applet with very little extra work. That's a benefit, since it means it
can be run from anywhere through a Java enabled browser and a username and
password. It can also be run on a system where it's been installed without
using a browser (either way, it reads and writes the settings from a URL).
Java does have the advantage when it comes to dynamic clients right now,
given that the Python virtual machine can't be assumed to be available
in the browser environment.
Someone on a mailing list I'm on has suggested that I look into Python, and
use Jython to compile it. I see that I can write applications and applets
in Python (but I haven't seen references to being able to write one
application just once and have it work as both). I also know Python is a
higher level than Java (a few people I know say it's almost like writing
pseudo code).
I have been known to provoke people by calling Java "object-oriented
COBOL", but if you're happy with Java you might find Python a bit terse,
and be a bit nervous about it's apparently happy-go-lucky attitude to
namespace protection.

If you like to be able to easily mix procedural and object-oriented
approaches then I think you might want to give Python a try.
At this time I don't know Python (I've looked at some sample code and I'm
still getting used to loops and if statements without closing braces!).
What I'm trying to determine is 1) if it's relatively easy to write a
program to work as an application AND an applet (depending on how it's
called), 2) If it'll handle the networking to read what amounts to web
pages full of setting info and write that back in POST statements without
problems from the user's point of view and easily from the programmer's
point of view, 3) What coding time and difficulty is like in Python
compared to, most specifically, Java and Perl, 4) Is it easy for me to
interface Java and Python classes seamlessly, and 5) (I realize only I can
answer this for sure, but opinions and experience of others would be a
help!) Is Python easy enough and fast enough to code in that it'd be worth
me taking time to learn it and doing the project Python instead of Java?
1) You'll need advice about "applet" from someone more versed in Jython
than I.

2) Definitely no problems in the networking department

3) Not as terse as Perl, somewhat faster than Java would be my opinion,
but I'm only one data point. I found the verbiage of common Java idioms
irritating, there's nothing like that with Python.

4) Yes.

5) You should learn a new language now and then just to stay in practice
and get in touch with newer ideas. Python isn't that hard for a Java
programmer to learn, though naturally there are differences. The two
languages in combination should give everyone what they want (though of
course there are always some people who just want to complain about he
way things are).
Any help, thoughts, comments, and such are appreciated!

Thank you!

Hal


Some of each to get you going. I hope this has helped.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.pycon.org

Sep 29 '05 #2
> What I'm trying to determine is 1) if it's relatively easy to write a
program to work as an application AND an applet (depending on how it's
called)
No. There is no such thing as "Python applets", unless the end user's
browser has third-party plug-ins that enable browsers to do so (A Python
equivalent to the Java Plug-In) ... I think those exist anyways :)

Or, if possible you could make your applet include Jython, and write
everything in Python, and have the client's JRE run the whole thing.
Seems like a big detour if you're already proficient in Java to be
honest. Not to mention a big download, and potential security problems?
2) If it'll handle the networking to read what amounts to web
pages full of setting info and write that back in POST statements without
problems from the user's point of view and easily from the programmer's
point of view
Not a problem, Python can do all that quite easily. Look here:

http://python.org/doc/2.4.2/lib/internet.html
3) What coding time and difficulty is like in Python
compared to, most specifically, Java and Perl,
Well, presumably you'd have a learning curve ... Ignoring that coding
time in Python is pretty much always fastest (I used to love Perl ...
until I found Python). One of my big points when promoting Python is
exectly this: less time coding, less time debugging, more time making
good code that works right the first time, and importantly, much easier
to maintain over time.
4) Is it easy for me to
interface Java and Python classes seamlessly,
I've never used it, but Jython supposedly gives you the ability to do
this quite well. It's a Python interpreter written in Java :)

http://www.jython.org/
and 5) (I realize only I can
answer this for sure, but opinions and experience of others would be a
help!) Is Python easy enough and fast enough to code in that it'd be worth
me taking time to learn it and doing the project Python instead of Java?
For this one project, it's hard to say. Overall I would say that
learning a whole language for writing one GUI app might be excessive. I
would suggest you look over Python as thoroughly as you can, and see if
maybe it's a language you would want to use not only for this project,
but others in the future as well.

Being self-taught myself, I expect you will switch to Python :) Only
masochists or hardcore purists that think statically typed languages are
"better" stick to Java. Well or because it's mandated by their
organisations and so on ...

Do note that in this case you would also need a GUI framework ...
wxPython would be my reocmmendation:

http://www.wxpython.org/

(This is another reason the whole "applet" thing might be problematic).

Python does not have a single GUI framework, but many. The Standard
Library support Tcl/Tk, which isn't very nice. wxPython is very nice
API, and well supported. There are bindings to GTK and QT as well.

Hope this helps!

J.F.

Any help, thoughts, comments, and such are appreciated!

Thank you!

Hal

Sep 30 '05 #3

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

Similar topics

11
13060
by: henry | last post by:
Hi, Just wondering if there's a good GUI builder for Python. Something like Visual Tcl, where you just drag and drop objects. Not too good with creating user interfaces from code along. Thanks
37
10462
by: Ubaidullah Nubar | last post by:
Hi, How well is Python suited for developing database based applications? I am new to Python so please bear with me if some of the questions are too simple. I specifically have the following questions: 1. Is there an example of a simple data-entry application written in Python using a GUI interface? Something like a simple address book app with a listbox displaying all addresses with the ability to add/modify/delete.
36
6435
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but something I'll need in this case is some experience-based set of rules about how to use python in this context. For example... is defining readonly attributes in classes worth the hassle ? Does duck-typing scale well in complex
63
5218
by: Davor | last post by:
Is it possible to write purely procedural code in Python, or the OO constructs in both language and supporting libraries have got so embedded that it's impossible to avoid them? Also, is anyone aware of any scripting language that could be considered as "Python minus OO stuff"? (As you can see I'm completely new to Python and initially believed it's a nice&simple scripting language before seeing all this OO stuff that was added in over...
53
3590
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 working on the app during the day, possibly in mutiple offices, and then a large number of batch...
48
4983
by: meyer | last post by:
Hi everyone, which compiler will Python 2.5 on Windows (Intel) be built with? I notice that Python 2.4 apparently has been built with the VS2003 toolkit compiler, and I read a post from Scott David Daniels where he said that probably the VS2003 toolkit will be used for Python 2.5 again. However, even before the release of Python 2.5, I cannot seem to find many retailers around here that still carry Visual Studio 2003, and some were a...
0
1107
by: Gabriel Genellina | last post by:
QOTW: "edundant/useless/misleading/poor code is worse than wrong." - Michele Simionato http://groups.google.com/group/comp.lang.python/msg/74adbb471826a245 "Unit tests are not a magic wand that discover every problem that a program could possibly have." - Paul Rubin http://groups.google.com/group/comp.lang.python/msg/6e683105172b2ca7 Some tricks to automatically enter the debugger when
0
1094
by: Gabriel Genellina | last post by:
QOTW: ""Given that C++ has pointers and typecasts, it's really hard to have a serious conversation about type safety with a C++ programmer and keep a straight face. It's kind of like having a guy who juggles chainsaws wearing body armor arguing with a guy who juggles rubber chickens wearing a T-shirt about who's in more danger." - Roy Smith, c.l.py, 2004.05.23 "esumable functions are a honking great idea." - Alan Kennedy Making all...
162
10389
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you prefix them with 2 underscores, but I hate prefixing my vars, I'd rather add a keyword before it. Python advertises himself as a full OOP language, but why does it miss one of the basic principles of OOP? Will it ever be added to python?
0
10007
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
9854
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
10882
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
10990
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
10504
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
7215
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5899
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
4734
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
3
3329
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.