473,696 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why would I learn Python over other languages?

Okay, here's what I know so far about Python:
It's an object-oriented scripting language, supported on many platforms.

Now here are my questions:
It is easy to learn?
Does it support GUI programming?
Does it support server-side programming, say for web apps?
Does it have extensions and libraries, say for DB connectivity, serial com
or network programming...?
Can it be used for administrative tasks, say as perl...?
Also, can it be compiled to native code?

Also much appreciated would be simple comparisons with say JAVA (my other
candidate), and pointers to sites and docs where to start.

Thank you in advance.

--
charif
Jul 18 '05 #1
24 2524
On 2004-07-08, Charif Lakchiri <ch****@kuc.big lobe.ne.jp> wrote:
It is easy to learn?
Yes. Of all the languages I've looked at Python's been one of the
easiest.
Does it support GUI programming?
Yes; in several different flavors. TK, QT, GTK just to name 3.
Does it support server-side programming, say for web apps?
Yes. mod-python and zope come to mind.
Does it have extensions and libraries, say for DB connectivity, serial com
or network programming...?
Yes. Standard, in fact.
Can it be used for administrative tasks, say as perl...?
Yes. I Python has replaced Perl for my admin tasks since I find Python
far more maintainable than Perl in the long run.
Also, can it be compiled to native code?


No. However on i386 there is Psyco which provides some impressive speed
boosts.

--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
Jul 18 '05 #2
I was ready to write a long response, but then I realized that all you
probably need to know is speed. As in, how fast can I learn this?

Java will take you months to get good, years if you don't know any other
languages yet. It will take books, large time investments, lots of
busywork as you get comfortable with stuff, and lots of false starts as
you discover new parts of the API. You can be good at Python in weeks.

The Java API dwarfs anything else I know. There are literally thousands
of classes. I know the API well enough to make experienced programmers
go "Woah! I never knew Java could do that!" and I still sometimes find
it easier to write my own stuff than go looking for it in the docs. It's
intimidating to newcomers, and it should be. It's pretty clean, but it's
vast beyond any one person's ability to grasp.

Python can do everything Java can do, but you can eyeball the whole
module list every time you're trying to figure something out. It's
easier to try stuff as you go (interactive interpreter), and a lot of
the busywork and toil has been rolled into language features that make
it trivial. That ultimately makes everything less work and more fun.

To put it in perspective, I learned Java 3 years before Python. It was
my language of choice. It took me two weekends with Python before I was
more productive with it than with Java.
Jul 18 '05 #3
"Charif Lakchiri" <ch****@kuc.big lobe.ne.jp> writes:
Now here are my questions:
It is easy to learn?
For the most part I'd say yes.
Does it support GUI programming?
Hmm, yes, although the official GUI toolkit (tkinter) is cumbersome,
doesn't look so great on the screen, and is poorly documented.
Does it support server-side programming, say for web apps?
There's a cgi module. There's various third party packages for fancier
types of web apps.
Does it have extensions and libraries, say for DB connectivity,
serial com or network programming...?
There are reasonably good libraries included for various network protocols.
There are third party extensions for DB connectivity and serial com.
Can it be used for administrative tasks, say as perl...?
Sure, so can any language. I'd say it's generally simpler to toss off
a 5-line perl script for some admin task than a comparable Python
script. Python is better for somewhat more complex tasks, where Perl
programs start getting hopelessly disorganized.
Also, can it be compiled to native code?
There's a JIT compiler called psyco which isn't yet officially part of
Python but which is coming along nicely. There's no ahead-of-time
native code compiler and the language doesn't lend itself very well to
that.
Also much appreciated would be simple comparisons with say JAVA (my other
candidate), and pointers to sites and docs where to start.


www.python.org
Jul 18 '05 #4
Paul Rubin wrote:
"Charif Lakchiri" <ch****@kuc.big lobe.ne.jp> writes:[snip] [snip]
Does it support GUI programming?


Sorry: I couldn't resist:
Hmm, yes, although the official GUI toolkit (tkinter) is cumbersome,
Obviously depends on who's talking: I personnaly always found *other* GUI
toolkits cumbersome (I've tested wxPython and PyQT)
doesn't look so great on the screen,
It seems to be the general opinion, but there is some work to make it better on
the tcl/tk side; see http://tcl.projectforum.com/tk/Home
and is poorly documented.


No it isn't; there are a lot of Tkinter resources around, not to mention plain
tk ones. I do agree that they may be hard to find, but they exist. The docs for
the other toolkits I've tried were usually worse than the ones for Tkinter
(things may have improved for wxPython, since I tested it quite a while ago)
--
- Eric Brunel <eric (underscore) brunel (at) despammed (dot) com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com

Jul 18 '05 #5
On 08 Jul 2004 00:04:51 -0700, Paul Rubin
<http://ph****@NOSPAM.i nvalid> wrote:
Does it support GUI programming?


Hmm, yes, although the official GUI toolkit (tkinter) is cumbersome,
doesn't look so great on the screen, and is poorly documented.


I won't dispute the other points but Tkinter is better documented
than any other Python GUI toolkit IMHO. Not only does it have the
Pythonware web site, it also has a book by Grayson and all the
Tcl/Tk documentation(b ooks and web sites)

I'd argue that the amount of documentation for Tk (and thus
Tkinter) exceeds any GUI tookit other than X or Microsoft's
various efforts.

Picking nits,

Alan G.

Author of the Learn to Program website
http://www.freenetpages.co.uk/hp/alan.gauld
Jul 18 '05 #6
Charif Lakchiri wrote:
Does it support server-side programming, say for web apps?
Does it have extensions and libraries, say for DB connectivity, serial com
or network programming...?


Check out the twisted package (http://www.twistedmatrix.com/) for an
incredibly powerful answer to these two questions.

---
Ed Suominen * http://www.eepatents.com
Registered Patent Agent * Open-Source Software Author (yes, both...)

Jul 18 '05 #7
"Charif Lakchiri" <ch****@kuc.big lobe.ne.jp> wrote:
It is easy to learn?
Yes. Simplicity and ease of learning were major design criteria. There
is also a large and active user community who can provide help,
guidance, and the occasional group hug.
Does it support GUI programming?
Yes. There are several GUI libraries available. I don't do much GUI
programming, so I'll leave it to others to describe those.
Does it support server-side programming, say for web apps?
Yes. There are a variety of ways to do this. At the low-level, there's
CGI module. There's a mod-python for Apache. There's a sample HTTP
server that comes with the system which you can extend on your own. I
recently saw mention of a JSP container for writing servlets in Python.
Does it have extensions and libraries, say for DB connectivity, serial com
or network programming...?
Yes. There is a standard DB API, and adapters for all of the major
databases (Oracle, Sybase, MySql, etc).
Can it be used for administrative tasks, say as perl...?
Yes. There are modules for interacting with the file system and
operating system (process control, etc). If you want, you can execute
external commands and capture their output, just like popen in perl.
Also, can it be compiled to native code?
Yes. The compiler is called "psyco", and it's very easy to use.
Also much appreciated would be simple comparisons with say JAVA (my other
candidate), and pointers to sites and docs where to start.


A quick Java. vs. Python comparison:

Java uses a C-like syntax, Python uses it's own. The Python syntax is
very easy to learn.

Java uses static typing, Python uses dynamic typing That means Java
programs are full of typecasts and variable declarations and useless
drek like that. On the other hand, since you've pushed a lot of
checking off to run time, Python takes a performance penalty.

Java is very much into data hiding, with private/protected/public
keywords to declare classes and variables. In Python, everything is
public by default. There are some ways to do weak data hiding if you
want.

Both compile to byte-code which runs on a virtual machine. The
underlying VM's are similar enough that there is a version of Python
which compiles to java byte code and runs on a JVM! One big difference
is that the compile step is explicit in Java, but happens automatically
and behind the scenes in Python. This means you can just fire up an
interactive Python session and type code at it to try things out, which
turns out to be incredibly useful.

Both are object-oriented. Java is a bit more extreme in this philosophy
(i.e. everything is a class). In Python, you can write non-OO code if
you want, and that's often easier for quickie one-off scripts such as
are common in sysadmin work.

If you are just starting out, I would definately learn both.
Jul 18 '05 #8
On Thu, 8 Jul 2004, Eric Brunel wrote:
Paul Rubin wrote:
Hmm, yes, although the official GUI toolkit (tkinter) is cumbersome,


Obviously depends on who's talking: I personnaly always found *other* GUI
toolkits cumbersome (I've tested wxPython and PyQT)


Seconded. Only in Tkitner can you write a (legible) one-liner Hello World:

import Tkinter
Tkinter.Label(t ext='Hello, world!').pack()
doesn't look so great on the screen,


It seems to be the general opinion, but there is some work to make it better on
the tcl/tk side; see http://tcl.projectforum.com/tk/Home


On Win32, Tk uses the native widgets, so it looks just as pretty (?) as
any other Win32 app.
and is poorly documented.


No it isn't;


Also seconded. It's also a lot easier to follow Tk's Tcl documentation
than GTK or Qt's C documentation.

Jul 18 '05 #9
On Thu, 08 Jul 2004 06:10:32 GMT, Anthony Roberts <ac************ *************@u calgary.ca> wrote:
I was ready to write a long response, but then I realized that all you
probably need to know is speed. As in, how fast can I learn this?

Java will take you months to get good, years if you don't know any other
languages yet. It will take books, large time investments, lots of
busywork as you get comfortable with stuff, and lots of false starts as
you discover new parts of the API. You can be good at Python in weeks.

The Java API dwarfs anything else I know. There are literally thousands
of classes. I know the API well enough to make experienced programmers
go "Woah! I never knew Java could do that!" and I still sometimes find
it easier to write my own stuff than go looking for it in the docs. It's
intimidating to newcomers, and it should be. It's pretty clean, but it's
vast beyond any one person's ability to grasp.

Python can do everything Java can do, but you can eyeball the whole
module list every time you're trying to figure something out.


I find that Python's library does as much as Java's but with less
classes. python's libraryu focusses on gettinbg the job done,
whereas I find java's library to be pedantic and irritating.
--
"It's easier to find people online who openly support the KKK
than people who openly support the RIAA" -- comment on Wikipedia
(Email: zen19725 at zen dot co dot uk)
Jul 18 '05 #10

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

Similar topics

42
3697
by: Bicho Verde | last post by:
I have now free time and money to do what I want :-) I have some basic skills in programming (C, Pascal, Macromedia Actionscript) but don't know exactly what to do in the world of programming. And also I don't know exactly why would I learn Python rather than C#, C++ or Perl. Basicaly I don't know where to start, if there is much to do or if it is has it seems and there is software to everything nowadays and so doesn't make sense to spend...
8
1789
by: Aziz McTang | last post by:
Hi Group, I am not an experienced programmer at all. I've learned html and css well enough to hand-write simple websites. I'm now looking to move to the next step. Initially, I'd like to do 3 things: 1) Generate web pages This one's fairly obvious maybe. 2) Create a simplified translation package specific to my line of work:
5
2679
by: Charles | last post by:
Hi folks, I would like to create an email client and organizer like MS Outlook, and I would give myself a year to do this, in the evening & week-ends. I have been looking for information on how to do it, and I found out I can develop such a program using C, C++, or Delphi. I am new at programming, I just know some PHP, and JavaScript that I use for my job, I like it. I don't know other languages, such as object-oriented languages. What...
8
4045
by: Hermawih | last post by:
Hello , I want your opinion about this . In order to say it clearly , I think I have to describe it in long sentences . I could consider myself as Intermediate/Advance Access Developer ; Intermediate/Advanced Database designer . Because of the requirements , I must create Web Application . Access Pages is not suitable for that so I think about learning VB Net / ASP Net . I am
34
3139
by: pandit | last post by:
hai all, i want to become a good programmer. one of my friends ( named "arnuld", he posts here infrequently), taught me Lisp. so i am not a programming beginner. i have heard these 2 points. i want to know how : 1. C gives you a strong base of Procedural style of programming which forms the basis of learning other paradigms e.g OOP
5
2006
by: Brian Blais | last post by:
Hello, I was wondering what the approximate minimum age to learn python is. Has anyone had experience teaching middle school students, or elementary school students Python? What brought this up for me is thinking about starting a Lego robots group in a local middle school. I only teach college, and have little experience with middle school students, so I find it hard to guess what they could actually do. I started programming when I...
9
2666
by: Katie Tam | last post by:
I am new to this filed and begin to learn this langague. Can you tell me the good books to start with ? Katie Tam Network administrator http://www.linkwaves.com/main.asp http://www.linkwaves.com
65
5255
by: Chris Carlen | last post by:
Hi: From what I've read of OOP, I don't get it. I have also found some articles profoundly critical of OOP. I tend to relate to these articles. However, those articles were no more objective than the descriptions of OOP I've read in making a case. Ie., what objective data/studies/research indicates that a particular problem can be solved more quickly by the programmer, or that the solution is more efficient in execution time/memory...
16
1878
by: Raxit | last post by:
Hi, i was reading/learning some hello world program in python. I think its very simillar to Java/C++/C#. What's different (except syntax) ? what can i do easily with python which is not easy in c++/java !? Tnx, Raxit
0
8595
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
9142
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
8849
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...
1
6512
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4353
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...
0
4608
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3030
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
2313
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1989
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.