issue

Discussion in 'Python' started by amin, Jan 19, 2009.

  1. amin

    amin Guest

    Hi dears.
    I started programing with python and want to use a suitable
    database.But I Know nothing about them.please introduse one to me.
    thanks.
     
    amin, Jan 19, 2009
    #1
    1. Advertising

  2. amin

    Tim Chase Guest

    > I started programing with python and want to use a suitable
    > database.But I Know nothing about them.please introduse one to
    > me. thanks.


    Since you're just starting out, I'd just use the built-in (as of
    Python2.5) sqlite

    >>> import sqlite3
    >>> c = sqlite3.connect('tmp/test.db')
    >>> cur = c.cursor()
    >>> cur.execute('create table test(id int primary key)')

    <sqlite3.Cursor object at 0xb7d72a70>
    >>> cur.execute('insert into test values (42)')

    <sqlite3.Cursor object at 0xb7d72a70>
    >>> cur.execute('insert into test values (3141)')

    <sqlite3.Cursor object at 0xb7d72a70>
    >>> cur.execute('select * from test')

    <sqlite3.Cursor object at 0xb7d72a70>
    >>> cur.fetchall()

    [(42,), (3141,)]

    That will allow you to experiment. You can later scale up to
    something like a MySQL, PostgreSQL or some other DB connector.

    -tkc
     
    Tim Chase, Jan 19, 2009
    #2
    1. Advertising

  3. On Mon, 19 Jan 2009 03:01:53 -0800
    "Patrick Steiger" <> wrote:
    > MySQL and PostgreSQL are more complete databases that run as servers on the
    > machine, and you can use python bindings for both. (psycopg2 for postgres,
    > and i forgot what binds mysql to python at the moment.)


    There are more than one adapter for each. Check out the list at
    http://wiki.python.org/moin/DatabaseInterfaces for more information.

    --
    D'Arcy J.M. Cain <> | Democracy is three wolves
    http://www.druid.net/darcy/ | and a sheep voting on
    +1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
     
    D'Arcy J.M. Cain, Jan 19, 2009
    #3
    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. JohnFol
    Replies:
    0
    Views:
    1,339
    JohnFol
    Aug 6, 2003
  2. Satinderpal Singh

    AppDomain Issue...

    Satinderpal Singh, Oct 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    695
    Dan Ignatov
    Oct 27, 2003
  3. Catherine Jones

    rich text box issue

    Catherine Jones, Dec 11, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    735
    Robert Jacobson
    Dec 11, 2003
  4. AJ

    Datatype issue

    AJ, Jan 12, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    496
    Mattias Sjögren
    Jan 12, 2004
  5. Srini
    Replies:
    11
    Views:
    985
    Arne Vajhøj
    Jun 1, 2008
Loading...

Share This Page