Mysql-Connection in Python-Script
I would like to use a Mysql-Connection in a Zope-Python-Script. Could someone explain how that works? I have to import some CSV-data into a database thanks in advance lukas -- ============================== > lukas pitschl > web development > > peer internet solutions > http://www.peer.biz > pillhof 25 - 39010 frangart > tel. +39/0471 63 10 80 > fax +39/0471 63 17 24
import MySQLdb, _mysql db_con = MySQLdb.connect (host = Self.server, port = Self.port, user = Self.user, passwd = Self.password, db = Self.db_name) Unfortunately this is what I do in a python product. I dont know if PyScripts will allow you to import MySQLdb modules. You could of course always got he external scripts way and return the connection object ot the calling script. hth AM Lukas Pitschl wrote:
I would like to use a Mysql-Connection in a Zope-Python-Script. Could someone explain how that works?
I have to import some CSV-data into a database
thanks in advance
lukas
-- ================================================================== Aseem Mohanty Neurobehavioral Systems Inc, 828 San Pablo Ave, Albany, CA 94706 (R) 510 7696011 (M) 510 3014871 (O) 510 5279231 ================================================================== "I saw `cout' being shifted "Hello world" times to the left and stopped right there!!" -- Steve Gonedes ==================================================================
On 12/18/02 2:25 PM, "AM" <list_subscriber@neurobs.com> wrote:
import MySQLdb, _mysql db_con = MySQLdb.connect (host = Self.server, port = Self.port, user = Self.user, passwd = Self.password, db = Self.db_name)
Unfortunately this is what I do in a python product. I dont know if PyScripts will allow you to import MySQLdb modules. You could of course always got he external scripts way and return the connection object ot the calling script.
hth AM
Lukas Pitschl wrote:
I would like to use a Mysql-Connection in a Zope-Python-Script. Could someone explain how that works?
I have to import some CSV-data into a database
thanks in advance
lukas
If memory serves correctly, PythonScripts won't let you do those imports. I think you're stuck with calling ZSQL Methods in your PythonScript or using an external method to make the DB connection.
participants (4)
-
AM -
Chris Muldrow -
Dieter Maurer -
Lukas Pitschl