"Luke Jordan" <[EMAIL PROTECTED]> wrote
> I've created a database as a shelve, where each value in the shelve
> file is
> a record class instance that has attributes representing fields.
> Let's say I
> enter 300 records in the shelve, then I decide to add a field to
> future
> records, or rem
I've created a database as a shelve, where each value in the shelve file is
a record class instance that has attributes representing fields. Let's say I
enter 300 records in the shelve, then I decide to add a field to future
records, or remove a field from future records. How can I update the
exis
Tod Haren wrote:
>Using a DBAPI 2.0 module such as ADODBAPI, how can a I identify the
>primary key fields of a table. cursor.desctription doesn't hold this
>info, unless I'm missing something. I just don't see it in the
>documentation. Maybe there's an SQL statement I haven't found yet.
>
>Is t
Using a DBAPI 2.0 module such as ADODBAPI, how can a I identify the
primary key fields of a table. cursor.desctription doesn't hold this
info, unless I'm missing something. I just don't see it in the
documentation. Maybe there's an SQL statement I haven't found yet.
Is this even possible? I'm
> For example
> with "SELECT * FROM a", I use this code
>
> ... to know how many columns are in the result,
As a general rule its better to avoid "Select * From" in production
SQL.
If the table definition changes the data returned can change in
unexpected
ways and break your application. In addi
I'm learning to use python with the database mysql. I'm writing a
widget in pygtk that should show the results of a sql query. For example
with "SELECT * FROM a", I use this code
count = 0
a = db.cursor.description
for tuple in a:
print tuple[0][0]
count = count + 1
Hey Paulino,
I'm a Django fan but from your description, a simple CGI app might do
nicely. Heck, you've already got the code written, just wrap it in a
CGI script that formats your list of records in HTML and serve the
script from your (already setup?) apache or even from your workstation
wit
Paulino wrote:
Hi Paulino,
Tough question that. What is your existing web server? That'd be a good
starting point. Zope/Plone are great, but they have a steep learning
curve that doesn't seem essential to what you're doing. Django is
simpler, but once again, doesn't immediately fit to what you
Hi!
Im a very biginner in programming and I started with python, witch I
found much easier tahn i thought.
I want to build an intranet page in my organization that shows some data
from our financial aplication's database.
For the starting point I would like it to show invoices lists per
suppl
> What is the best way to handle the resutls to a fetchall() command?
> The result seems to be a list of tuples
> [(aaa,bbb,ccc0,(11,222,333,)].
Yes, thats usually the most convenient way to present groups of data.
> I'm new to programming but it seems that what ever I try to
> accomplish
> at
On Sun, 2006-06-25 at 20:14 -0400, Rene Bourgoin wrote:
> What is the best way to handle the resutls to a fetchall() command?
> The result seems to be a list of tuples [(aaa,bbb,ccc0,(11,222,333,)].
Correct
> I'm new to programming but it seems that what ever I try to accomplish
> at some point i
What is the best way to handle the resutls to a fetchall() command?
The result seems to be a list of tuples [(aaa,bbb,ccc0,(11,222,333,)]. I'm new
to programming but it seems that what ever I try to accomplish at some point i
need the results to end up as strings. Even if you loop through the li
>Does that mean you will soon fix the tutor.tgz :-)
> Thanks for all the hard work you put into this.
I updated the PDF. zip and tgz files at the same time I
uploaded the fixed database topic, but before I made the
additional fixes Bob suggested
Alan G.
Alan,
Does that mean you will soon fix the tutor.tgz :-)
Thanks for all the hard work you put into this.
Stan.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> Some observations:
These have now all been addressed as previously discussed.
I've also added a section at the end covering the use of execute() to
insert parameters rather than relying on format strings since the
latter can be a security risk.
Hopefully its now complete! :-)
Alan Gauld
Autho
Thanks Bob,
Feedback is always appreciated, its how the tutor improves.
> 1 - people familiar with other databases might be puzzled by the
> lack of column datatypes. I'd mention that sqlite allows but does
> not require types at the first introduction of CREATE TABLE,.
Fair point, although by
Alan Gauld wrote:
> The mistakes in my databae topic have now been rectified.
> I have no idea how I managed to post the file without testing
> that section of code. And unfortunately it's one of the areas
> where SqlLite SQL syntax varies from the Oracle syntax that
> I'm most familiar with. Bu
The mistakes in my databae topic have now been rectified.
I have no idea how I managed to post the file without testing
that section of code. And unfortunately it's one of the areas
where SqlLite SQL syntax varies from the Oracle syntax that
I'm most familiar with. But that's only a partial excu
> Kaushal Shriyan wrote:
> > Hi ALL
> >
> > How do i connect my python program to MySQL DB or Oracle DB
> or can you
> > please specify the URL which gives a detailed explanation on this.
>
> Basic connectivity is through modules that implement the
> DB-API standard. Read the spec and find
Kaushal Shriyan wrote:
> Hi ALL
>
> How do i connect my python program to MySQL DB or Oracle DB or can you
> please specify the URL which gives a detailed explanation on this.
Basic connectivity is through modules that implement the DB-API
standard. Read the spec and find implementations here:
h
On 11/04/06, Kaushal Shriyan <[EMAIL PROTECTED]> wrote:
> Hi ALL
>
> How do i connect my python program to MySQL DB or Oracle DB or can you
> please specify the URL which gives a detailed explanation on this.
SQLObject is your best bet:
http://www.sqlobject.org/
If you're using MySQL, you will ne
Hi ALL
How do i connect my python program to MySQL DB or Oracle DB or can you
please specify the URL which gives a detailed explanation on this.
Thanks in Advance
Regards
Kaushal
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/l
> -Original Message-
>
> Hey there,
Hi,
> i have used the cgi module and dig it.
> heres the deal,
> my employer wants me to build a dynamic website that will
> access a
> database and display customer
> information on web. ok, easy enough.
Looks like some others have
Alan G wrote:
>>>going on at a time I'd consider moving the database
>>>or using snapshot technology or similar, Access locks
>>>by pages (default 2K?) which can mean a lot of data
>>>rows being locked by a single update.
>>>
>>>
>>>
>>ok, another question about this, if i use a snapshot, co
> database and display customer information on web. ok, easy enough.
> heres the trick. the database is MS Access. - ick.
ick indeed, but maybe for different reasons...
There is an ODBC database driver that you can use to
access Access. But you will have to be careful about
locking if the
Exactly what i was looking for.
thanks gents, i didn't even know this module existed.
i guess this access project will not be as intimidating as i thought.
cheers
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Well when working with M$ db's you should use odbc.
http://www.egenix.com/files/python/mxODBC.html
nephish wrote:
>Hey there,
>
>i have used the cgi module and dig it.
>heres the deal,
>my employer wants me to build a dynamic website that will access
a
>database and display customer
On Sat, 18 Jun 2005 13:50:56 -0700
nephish <[EMAIL PROTECTED]> wrote:
> Hey there,
>
> i have used the cgi module and dig it.
> heres the deal,
> my employer wants me to build a dynamic website that will access a
> database and display customer
> information on web. ok, easy enou
Hey there,
i have used the cgi module and dig it.
heres the deal,
my employer wants me to build a dynamic website that will access a
database and display customer
information on web. ok, easy enough.
heres the trick.
the database is MS Access. - ick.
what could i do to
Hi there,
I have mainly used the psycopg module to connect. It seems to work quite
well.
quick example:
import psycopg
conn = psycopg.connect("dbname=mydatabase password= host=
user=")
cur = conn.cursor()
cur.execute('select * from transit;')
results = cur.fetchall()
Hope this
Olli Rajala wrote:
> Well, I asked about tutorials, but maybe this was not so good day,
> because it has been quite "silent". :)
>
> So, good tutorials are still welcome, though I know now how to connect
> to the Postgresql database. I just have some problems, though.
You might want to try aski
Well, I asked about tutorials, but maybe this was not so good day,
because it has been quite "silent". :)
So, good tutorials are still welcome, though I know now how to connect
to the Postgresql database. I just have some problems, though. With
MySQL I can do like this:
import MySQLdb
def connec
other month at least before its fully done!
I've got an awful lot in my diary just now!
- Original Message -
From: "Barnaby Scott" <[EMAIL PROTECTED]>
To:
Sent: Thursday, May 05, 2005 2:03 PM
Subject: [Tutor] database applications with Python - where to start
>
On Thu, May 05, 2005 at 02:03:30PM +0100, Barnaby Scott wrote:
>Hi, this is one of those difficult questions about where to start!
>
>I want to create a book-keeping/accounting application for my own use
>1. because I can't find any that suits me, and
>2. because I want to improve and extend my kno
Hi, this is one of those difficult questions about where to start!
I want to create a book-keeping/accounting application for my own use
1. because I can't find any that suits me, and
2. because I want to improve and extend my knowledge of Python.
Clearly this is going to be a database applicatio
Ryan Davis wrote:
Does anyone know of a decent way to access a SQL Server 2000 database?
I make heavy use of SQL Server from Jython using Microsoft's JDBC driver. This works great if it is
an option for you.
Otherwise if your client is on Windows take a look at adodbapi. I have just played around
Does anyone know of a decent way to access a SQL Server 2000 database?
I've gotten some versions working using dbi,odbc and defining a DSN on the
computer, but I'd like to be able to specify a server,
user, pass, and database in code. As far as I can tell, I'd have to define a
DSN for every dat
> Oh, and don't forget the c.commit() part! That had me running around
> in circles all night last night.
Yep, I got got with lack of commit syndrome when I started with SQL
too :-)
> PS Anyone know if there's a way to get a list of tables in a DB?
I've
> got the pragma to get a list of columns i
/me smacks head.
Thanks Kent. Exactly what I need.
Regards,
Liam Clarke
On Mon, 21 Feb 2005 16:21:23 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Liam Clarke wrote:
>
> > PS Anyone know if there's a way to get a list of tables in a DB? I've
> > got the pragma to get a list of columns in
Liam Clarke wrote:
PS Anyone know if there's a way to get a list of tables in a DB? I've
got the pragma to get a list of columns in a table, but just in the
off chance...
AFAIK there is no standard way to do this - it is different for each
database. For SQLite, see this FAQ:
http://www.sqlite.org/
>>>import sqlite
>>>x = sqlite.connect('mysqlitedb')
>>>cx = x.cursor()
>>>cx.execute( 'create table foo (columnA varchar(15), columnB number(3))' )
>>>cx.execute ('insert into foo (columnA, columnB) values ("Parrot", 90)')
>>>x.commit()
>>>cx.execute('select * from foo')
>>>cx.fetchall()
[('Parr
On Mon, 21 Feb 2005, Chris Mallari wrote:
> hi there! can u pls send me sample code in accessing a simple database
> using python.
Hi Chris,
You may want to look at the Database topic guide:
http://www.python.org/topics/database/
It has links to examples, tutorials, and other documentati
Hi Chris,
If you just want to learn about databases, then sqlite is a good way
to go. It's small, it's typeless (which means you don't have to define
ahead of time what sort of thing is going to go in which bit of the
database; python is typeless too), and it is not split into client and
server (m
hi there! can u pls send me sample code in accessing a simple database
using python.
Chris Mallari
thanks
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I would recommend KirbyBase as a quick starter - it's nice and simple,
and outputs text files, so you can always check things manually.
http://www.netpromi.com/kirbybase.html
Matt
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/
45 matches
Mail list logo