> 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
> All code below is pseudo-code.
>
> Is this an acceptable design for doing this?
>
> # in Node class
>
> def _parse(self, list_of_lines):
>
> # some parsing based on whole list_of_lines
>
> for line in list_of_lines:
> _subclass_preparse(line)
> # Do line parsing stuff
Liam:
I agree with Kent. It depends. Not only on the database, but also on the interface (API) used to connect to the database. For example, if you use ODBC to connect to all of your databases, you should be able to use the
SQLTables()
routine. For more details, see the following:
ht
/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
Kent Johnson said unto the world upon 2005-02-21 16:40:
Brian van den Broek wrote:
I am exploring ways of having the methods of a sub-class insert
additional logic into their version of a class's methods, while still
running the original class's method logic.
All code below is pseudo-code.
My N
On Windows it looks like msvcrt will give you a non-blocking terminal
read -- on mac / *nix systems it looks a little trickier:
http://mail.python.org/pipermail/pythonmac-sig/2004-February/010140.html
The os module in windows doesn't even have O_NONBLOCK. That seems like trouble.
m
On Sun, 20
. Sm0kin'_Bull wrote:
With your helps i managed to program Advanced Calculator.
But, I want to change(or add) some to it.
1. How can i /n/n result bit? I tired.. but, I can't
You can use the print command to print your results. You can give print a list of values and it will
print them separated w
Brian van den Broek wrote:
Hi all,
I am still building my toolset for working with treepad files. (This is
the one all my recent posts concerning Node classes have been about.)
I am exploring ways of having the methods of a sub-class insert
additional logic into their version of a class's method
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
With your helps i managed to program Advanced Calculator.
But, I want to change(or add) some to it.
1. How can i /n/n result bit? I tired.. but, I can't
2. How can i enable it to calculate float-pointing numbers? (Which will make
it complicated)
It should looks like this...
Please input data
Numb
Hi all,
I am still building my toolset for working with treepad files. (This
is the one all my recent posts concerning Node classes have been about.)
I am exploring ways of having the methods of a sub-class insert
additional logic into their version of a class's methods, while still
running the
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
Mark Kels wrote:
Hi list !
Here is a small port scanner I made to practice sockets and GUI
programming ( WARNING: the program crash when scan button is clicked):
How far does it get? How do you know?
I would put some debug print statements in. Also you should call sk.close() in the else clause of
Hi list !
Here is a small port scanner I made to practice sockets and GUI
programming ( WARNING: the program crash when scan button is clicked):
#--Imports--
from Tkinter import *
import socket
#--The result GUI window function-
def result():
global result_t #I
You could make the __init__ take the filename:
def __init__(self, filename=None):
#do whatever
And then instantiate the object like:
>>>x = someClass(filename="someFile")
Alternatively, you could make the Open function a module level function,
defined in someClass.py, but not in the actual c
I really don't think you can have a common way to do this on both
systems. First, the way to kill a process is quite different on both
systems (the os.kill function works only on UNIX systems, and I don't
know is there is such a function available in Python for MS Windows).
Then, I really doubt
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
Chris:
How about "Jython"? Here's an article that I just wrote:
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0502gibson/index.html
Bob
Christian Meesters wrote:
Hi
My cryptic subject is perhaps not sufficient - I'll try to make it a little better:
Assume you'd like to write something like:
import someClass
x = someClass.open("someFile")
Here '.open' should read in the data and initialize the instance - with or without calling __
Dear All,
Just a quick follow up for those of you who are interested. The batching script
is now working and is attached below.
The intermediate step of saving the xy layer to a folder was unecessary and has
been removed. The 'MakeXYEventLayer' command only creates "in memory" layers
and not
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
Hi
My cryptic subject is perhaps not sufficient - I'll try to make it a little
better:
Assume you'd like to write something like:
import someClass
x = someClass.open("someFile")
Here '.open' should read in the data and initialize the instance - with or
without calling __init__.
How is this
23 matches
Mail list logo