advice for perl expert wanting to learn python

Discussion in 'Python' started by Zeljko Vrba, Aug 3, 2004.

  1. Zeljko Vrba

    Zeljko Vrba Guest

    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)
     
    Zeljko Vrba, Aug 3, 2004
    #1
    1. Advertising

  2. Zeljko Vrba

    Stano Paska Guest

    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.
     
    Stano Paska, Aug 3, 2004
    #2
    1. Advertising

  3. Zeljko Vrba

    richard Guest

    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
     
    richard, Aug 3, 2004
    #3
  4. On Tue, 3 Aug 2004 07:39:46 +0000 (UTC),
    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?


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

    --amk
     
    A.M. Kuchling, Aug 3, 2004
    #4
  5. Zeljko Vrba

    marco Guest

    marco, Aug 5, 2004
    #5
  6. Zeljko Vrba

    David Fraser Guest

    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
     
    David Fraser, Aug 6, 2004
    #6
  7. Zeljko Vrba

    Harry George Guest

    David Fraser <> 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/

    --

    6-6M21 BCA CompArch Design Engineering
    Phone: (425) 342-0007
     
    Harry George, Aug 6, 2004
    #7
  8. Zeljko Vrba

    David Fraser Guest

    Harry George wrote:
    > David Fraser <> 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
     
    David Fraser, Aug 6, 2004
    #8
  9. Zeljko Vrba <> wrote in message news:<>...
    > 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
     
    Marcel van den Dungen, Aug 6, 2004
    #9
  10. Zeljko Vrba

    Keith Farmer Guest

    David Fraser <> wrote in message news:<cevpef$bku$>...
    > 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.
     
    Keith Farmer, Aug 23, 2004
    #10
  11. Zeljko Vrba

    David Fraser Guest

    Keith Farmer wrote:
    > David Fraser <> wrote in message news:<cevpef$bku$>...
    >
    >>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
     
    David Fraser, Aug 24, 2004
    #11
  12. Zeljko Vrba

    Beeyah Guest

    Harry George <> wrote in message news:<>...
    > 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
     
    Beeyah, Aug 24, 2004
    #12
  13. Zeljko Vrba

    Stephen Ferg Guest

    Stephen Ferg, Aug 24, 2004
    #13
  14. Zeljko Vrba

    Aahz Guest

    In article <>,
    Stephen Ferg <> 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 () <*> 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."
     
    Aahz, Aug 24, 2004
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lucia
    Replies:
    5
    Views:
    324
    Roedy Green
    Nov 3, 2003
  2. Tim Apple

    Wanting to Learn

    Tim Apple, Feb 4, 2004, in forum: C Programming
    Replies:
    25
    Views:
    776
    Dik T. Winter
    Feb 7, 2004
  3. arsl89

    wanting

    arsl89, Jul 18, 2006, in forum: Python
    Replies:
    7
    Views:
    464
    Patrick Bothe
    Jul 18, 2006
  4. Joe
    Replies:
    3
    Views:
    105
  5. Pseudonyme
    Replies:
    4
    Views:
    206
    J├╝rgen Exner
    Mar 24, 2010
Loading...

Share This Page