467,868 Members | 1,405 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,868 developers. It's quick & easy.

advice for perl expert wanting to learn python

Now, why would I like to learn Python: because of IronPython port to CLR.
Perl port to CLR doesn't seem to be coming soon. First Perl6 for Parrot has
to be written, and then other backends..

What's the easiest way of learning python knowing perl? Is there somewhere
a 'how-to' cookbook with parallel examples of frequent idioms in perl and
python?

And most important thing, how does Python deal with database connectivity?
Is there a single API (akin to DBI) for connecting to databases?

How does Python support the following databases:
- Oracle
- Postgres
- MySQL
- SQLServer (maybe using freetds?)
- ODBC connectivity (connecting to MS Access)

Jul 18 '05 #1
  • viewed: 1697
Share:
13 Replies
Zeljko Vrba wrote:
Now, why would I like to learn Python: because of IronPython port to CLR.
Perl port to CLR doesn't seem to be coming soon. First Perl6 for Parrot has
to be written, and then other backends..

What's the easiest way of learning python knowing perl? Is there somewhere
a 'how-to' cookbook with parallel examples of frequent idioms in perl and
python?
http://pleac.sourceforge.net/

And most important thing, how does Python deal with database connectivity?
Is there a single API (akin to DBI) for connecting to databases?
Yes, python has defined single API

How does Python support the following databases:
- Oracle
- Postgres
- MySQL
- SQLServer (maybe using freetds?)
- ODBC connectivity (connecting to MS Access)


I have tried MySQLdb package and mdb connectivity through
win32com.client package.
I read about Postgres and Oracle connectivity...

Stano Paska.

Jul 18 '05 #2
Zeljko Vrba wrote:
What's the easiest way of learning python knowing perl? Is there somewhere
a 'how-to' cookbook with parallel examples of frequent idioms in perl and
python?
A good start might be:

http://www.python.org/doc/Intros.html

under the "Introductions for programmers" heading.

Then there's http://www.python.org/doc/Comparisons.html#perl which has
direct comparisons.

And most important thing, how does Python deal with database connectivity?
Is there a single API (akin to DBI) for connecting to databases?
There is a DB-API standard, which is implemented by the various connectors.

How does Python support the following databases:
- Oracle
- Postgres
- MySQL
- SQLServer (maybe using freetds?)
- ODBC connectivity (connecting to MS Access)


Well.
Richard

Jul 18 '05 #3
On Tue, 3 Aug 2004 07:39:46 +0000 (UTC),
Zeljko Vrba <mo****@fly.srk.fer.hr> wrote:
What's the easiest way of learning python knowing perl? Is there somewhere
a 'how-to' cookbook with parallel examples of frequent idioms in perl and
python?


Jak Kirman wrote one around 1996. I've just put a copy in the Python wiki at
http://www.python.org/moin/PerlPhrasebook .

--amk
Jul 18 '05 #4
Zeljko Vrba <mo****@fly.srk.fer.hr> writes:

What's the easiest way of learning python knowing perl? Is there somewhere
a 'how-to' cookbook with parallel examples of frequent idioms in perl and
python?


There's this one:

http://makeashorterlink.com/?P6C226BF8

but it's a bit dated (probably good for simple stuff, though)...

Cheers,

--
ma***@reimeika.ca
Gunnm: Broken Angel http://amv.reimeika.ca
http://reimeika.ca/ http://photo.reimeika.ca
Jul 18 '05 #5
Zeljko Vrba wrote:
Now, why would I like to learn Python: because of IronPython port to CLR.
Perl port to CLR doesn't seem to be coming soon. First Perl6 for Parrot has
to be written, and then other backends..

What's the easiest way of learning python knowing perl? Is there somewhere
a 'how-to' cookbook with parallel examples of frequent idioms in perl and
python?

And most important thing, how does Python deal with database connectivity?
Is there a single API (akin to DBI) for connecting to databases?

How does Python support the following databases:
- Oracle
- Postgres
- MySQL
- SQLServer (maybe using freetds?)
- ODBC connectivity (connecting to MS Access)


I have used Oracle, SQLServer and Access via ADO - try adodpapi.sf.net
which is a wrapper for ADO to the Python DB-API.
But note that you may well not be able to use any of this database stuff
from IronPython

David
Jul 18 '05 #6
David Fraser <da****@sjsoft.com> writes:
Zeljko Vrba wrote:
Now, why would I like to learn Python: because of IronPython port to CLR.
Perl port to CLR doesn't seem to be coming soon. First Perl6 for Parrot has
to be written, and then other backends..
What's the easiest way of learning python knowing perl?
For experienced scripters, I find Beazley's "Python Essential
Reference" is excellent. You already know what you want, just need to
see how Python does it, and don't need a lot of handholding. Get a
copy of "Python Cookbook" too, and scan that. Then rewrite one of
your exsiting perl scripts.
Is there
somewhere
a 'how-to' cookbook with parallel examples of frequent idioms in perl and
python?
An interesting variant on that is my pyperlish module, at
http://www.seanet.com/~hgg9140/comp/index.html

You can either use it as-is, or read the code to see how to emulate
perl in python. NOTE: I do not recommend using pyperlish once you get
the hang of python.

And most important thing, how does Python deal with database
connectivity?
Is there a single API (akin to DBI) for connecting to databases?
How does Python support the following databases:
- Oracle
- Postgres
- MySQL
- SQLServer (maybe using freetds?)
- ODBC connectivity (connecting to MS Access)


I have used Oracle, SQLServer and Access via ADO - try adodpapi.sf.net
which is a wrapper for ADO to the Python DB-API.
But note that you may well not be able to use any of this database
stuff from IronPython

David


More cross-platform and cross-DBMS is to code to the DB-API 2.0:
http://www.python.org/topics/database/

--
ha************@boeing.com
6-6M21 BCA CompArch Design Engineering
Phone: (425) 342-0007
Jul 18 '05 #7
Harry George wrote:
David Fraser <da****@sjsoft.com> writes:
Zeljko Vrba wrote:
And most important thing, how does Python deal with database
connectivity?
Is there a single API (akin to DBI) for connecting to databases?
How does Python support the following databases:
- Oracle
- Postgres
- MySQL
- SQLServer (maybe using freetds?)
- ODBC connectivity (connecting to MS Access)


I have used Oracle, SQLServer and Access via ADO - try adodpapi.sf.net
which is a wrapper for ADO to the Python DB-API.
But note that you may well not be able to use any of this database
stuff from IronPython

David

More cross-platform and cross-DBMS is to code to the DB-API 2.0:
http://www.python.org/topics/database/


Thats why I said to look at adodbapi.sourceforge.net although I misspelt
it - it is DB-API 2.0 compliant.

David
Jul 18 '05 #8
Zeljko Vrba <mo****@fly.srk.fer.hr> wrote in message news:<sl*******************@fly.srk.fer.hr>...
Now, why would I like to learn Python: because of IronPython port to CLR.
Perl port to CLR doesn't seem to be coming soon. First Perl6 for Parrot has
to be written, and then other backends..

What's the easiest way of learning python knowing perl? Is there somewhere
a 'how-to' cookbook with parallel examples of frequent idioms in perl and
python?

See the Perl/Python phrasebook:
http://www.python.org/moin/PerlPhrasebook

-- Marcel
Jul 18 '05 #9
David Fraser <da****@sjsoft.com> wrote in message news:<ce**********@ctb-nnrp2.saix.net>...
Zeljko Vrba wrote:
And most important thing, how does Python deal with database connectivity?
Is there a single API (akin to DBI) for connecting to databases?

I have used Oracle, SQLServer and Access via ADO - try adodpapi.sf.net
which is a wrapper for ADO to the Python DB-API.
But note that you may well not be able to use any of this database stuff
from IronPython


Assuming you find yourself working with .NET -- as you would with
IronPython -- I would expect it to have access to the stock database
namespaces under whatever environment you're in: under MS's
implementation of .NET, System.Data.* (same under Mono?). This would
be the most likely line, since there's a lot of prior work in .NET
that targets that namespace, including UI controls.

For documentation, search for "ADO.NET". It's actually a pretty good
framework, and doesn't require a database connection to make use of it
(ie, you want an in-memory database, but don't need persistent
storage).

I don't know what Jim's planning to do with the Python db api, but
between the two, I'd personally use ADO.NET when available. I'd
suggest the IronPython email list (www.ironpython.org) for more
information.
Jul 18 '05 #10
Keith Farmer wrote:
David Fraser <da****@sjsoft.com> wrote in message news:<ce**********@ctb-nnrp2.saix.net>...
Zeljko Vrba wrote:


And most important thing, how does Python deal with database connectivity?
Is there a single API (akin to DBI) for connecting to databases?


I have used Oracle, SQLServer and Access via ADO - try adodpapi.sf.net
which is a wrapper for ADO to the Python DB-API.
But note that you may well not be able to use any of this database stuff
from IronPython

Assuming you find yourself working with .NET -- as you would with
IronPython -- I would expect it to have access to the stock database
namespaces under whatever environment you're in: under MS's
implementation of .NET, System.Data.* (same under Mono?). This would
be the most likely line, since there's a lot of prior work in .NET
that targets that namespace, including UI controls.

For documentation, search for "ADO.NET". It's actually a pretty good
framework, and doesn't require a database connection to make use of it
(ie, you want an in-memory database, but don't need persistent
storage).

I don't know what Jim's planning to do with the Python db api, but
between the two, I'd personally use ADO.NET when available. I'd
suggest the IronPython email list (www.ironpython.org) for more
information.


The disadvantage of using ADO.NET is that you'll lose the portability
advantages of the Python db API (i.e. you'll only be able to use the
code on IronPython).
The correct approach is to write a DB API-compatible wrapper for ADO.NET
:-) (as has been done for ADO)

David
Jul 18 '05 #11
Harry George <ha************@boeing.com> wrote in message news:<xq*************@cola2.ca.boeing.com>...
For experienced scripters, I find Beazley's "Python Essential
Reference" is excellent. You already know what you want, just need to
see how Python does it, and don't need a lot of handholding. Get a
copy of "Python Cookbook" too, and scan that. Then rewrite one of
your exsiting perl scripts.


OTOH, It should be a crime to purchase the Python Developer's Handbook
[1]. I'm glad I only paid six dollars for a used copy, because its a
load of crap.

[1] http://makeashorterlink.com/?H10123029
Jul 18 '05 #12
I'm surprised nobody mentioned Martin Brown's book "Perl to Python
Migration".

The reviews indicate that although it has a lot of typos it is useful.

Also, cheap. You can get a used copy for $2.50 (plus shipping) from
Amazon.

http://www.amazon.com/exec/obidos/tg...glance&s=books
Jul 18 '05 #13
In article <b1**************************@posting.google.com >,
Stephen Ferg <st***@ferg.org> wrote:

I'm surprised nobody mentioned Martin Brown's book "Perl to Python
Migration".

The reviews indicate that although it has a lot of typos it is useful.


Well, that is not a review I would make. I think it's just a couple of
notches better than "horrible" -- I believe any Perl programmer would be
much better off with a regular Python book.
--
Aahz (aa**@pythoncraft.com) <*> http://www.pythoncraft.com/

"To me vi is Zen. To use vi is to practice zen. Every command is a
koan. Profound to the user, unintelligible to the uninitiated. You
discover truth everytime you use it." --*****@lion.austin.ibm.com
Jul 18 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

75 posts views Thread by Howard Nease | last post: by
2 posts views Thread by Randall Smith | last post: by
7 posts views Thread by Alberto | last post: by
31 posts views Thread by surfunbear | last post: by
5 posts views Thread by Martin Piper | last post: by
3 posts views Thread by alpha | last post: by
8 posts views Thread by Xah Lee | last post: by
28 posts views Thread by Hussein B | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.