Re: How to format a datetime MySQL database field to local using strftime()

2019-02-26 Thread vergos . nikolas
Actually i just found it has a directive: dictrows: Whether or not to support dict-like access to row objects (default: True). so i just did: plugin = bottle_pymysql.Plugin( dbuser='nikos', dbpass='*', dbname='counters', dictrows=False ) and now it works with indexes as integers not as st

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-26 Thread vergos . nikolas
Τη Τρίτη, 26 Φεβρουαρίου 2019 - 3:26:29 μ.μ. UTC+2, ο χρήστης vergos@gmail.com έγραψε: > Can you help me rewrite this function, which when iam using 'pymysql' > conncector works normally, it does not when iam using 'bottle_pymysql' > > def coalesce( data ): > newdata = [] > seen

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-26 Thread vergos . nikolas
Can you help me rewrite this function, which when iam using 'pymysql' conncector works normally, it does not when iam using 'bottle_pymysql' def coalesce( data ): newdata = [] seen = {} for host, ref, location, useros, browser, visits, hits, downloads, authuser in data:

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-25 Thread DL Neil
On 26/02/19 7:47 AM, Dennis Lee Bieber wrote: On Mon, 25 Feb 2019 13:00:03 -0500, Dennis Lee Bieber declaimed the following: My apologies for the mis-attribution -- due to spam, I tend to filter out @gmail.com posts (the one flaw with Forte Agent -- it only filters news groups on subje

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread DL Neil
Vergos, On 25/02/19 11:53 AM, vergos.niko...@gmail.com wrote: Τη Δευτέρα, 25 Φεβρουαρίου 2019 - 12:38:43 π.μ. UTC+2, ο χρήστης vergos@gmail.com έγραψε: Τη Κυριακή, 24 Φεβρουαρίου 2019 - 8:52:03 μ.μ. UTC+2, ο χρήστης DL Neil έγραψε: Vergos, Please provide more information and show how you

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread vergos . nikolas
Τη Δευτέρα, 25 Φεβρουαρίου 2019 - 12:38:43 π.μ. UTC+2, ο χρήστης vergos@gmail.com έγραψε: > Τη Κυριακή, 24 Φεβρουαρίου 2019 - 8:52:03 μ.μ. UTC+2, ο χρήστης DL Neil > έγραψε: > > Vergos, > > > > Please provide more information and show how you've debugged the code so > > far... > > > > > >

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread vergos . nikolas
Τη Κυριακή, 24 Φεβρουαρίου 2019 - 8:52:03 μ.μ. UTC+2, ο χρήστης DL Neil έγραψε: > Vergos, > > Please provide more information and show how you've debugged the code so > far... > > > On 25/02/19 7:03 AM, vergos.niko...@gmail.com wrote: > > pymydb.execute( '''SELECT host, ref, location, useros, b

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread DL Neil
Vergos, Please provide more information and show how you've debugged the code so far... On 25/02/19 7:03 AM, vergos.niko...@gmail.com wrote: pymydb.execute( '''SELECT host, ref, location, useros, browser, visits, hits, downloads, authuser FROM guests

How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread vergos . nikolas
pymydb.execute( '''SELECT host, ref, location, useros, browser, visits, hits, downloads, authuser FROM guests WHERE pagesID = (SELECT ID FROM pages WHERE url = %s) ORDER BY visits DESC''', page ) data = pymydb.fetchall() for visit in visits:

Re: How to connect the MYSQL database to Python program?

2015-12-11 Thread ICT Ezy
zy wrote: > >> > On Wednesday, December 9, 2015 at 9:58:02 AM UTC-8, Chris Angelico wrote: > >> >> On Thu, Dec 10, 2015 at 4:51 AM, ICT Ezy wrote: > >> >> > Pl explain me how to connect the MYSQL database to Python program? > >> >> > >>

Re: How to connect the MYSQL database to Python program?

2015-12-11 Thread ICT Ezy
; Pl explain me how to connect the MYSQL database to Python program? > >> > >> You start by looking for a module that lets you do that. You can use > >> your favourite web search engine, or go directly to PyPI. > >> > >> Then you learn how t

Re: How to connect the MYSQL database to Python program?

2015-12-11 Thread Igor Korot
> On Thu, Dec 10, 2015 at 4:51 AM, ICT Ezy wrote: >> >> > Pl explain me how to connect the MYSQL database to Python program? >> >> >> >> You start by looking for a module that lets you do that. You can use >> >> your favourite web search

Re: How to connect the MYSQL database to Python program?

2015-12-11 Thread ICT Ezy
; Pl explain me how to connect the MYSQL database to Python program? > >> > >> You start by looking for a module that lets you do that. You can use > >> your favourite web search engine, or go directly to PyPI. > >> > >> Then you learn how t

Re: How to connect the MYSQL database to Python program?

2015-12-11 Thread Larry Martell
On Fri, Dec 11, 2015 at 1:36 PM, ICT Ezy wrote: > On Wednesday, December 9, 2015 at 9:58:02 AM UTC-8, Chris Angelico wrote: >> On Thu, Dec 10, 2015 at 4:51 AM, ICT Ezy wrote: >> > Pl explain me how to connect the MYSQL database to Python program? >> >> You start by

Re: How to connect the MYSQL database to Python program?

2015-12-11 Thread ICT Ezy
On Wednesday, December 9, 2015 at 1:45:26 PM UTC-8, Mark Lawrence wrote: > On 09/12/2015 17:51, ICT Ezy wrote: > > Pl explain me how to connect the MYSQL database to Python program? > > > > Use a search engine. Then run up an editor, write some code, run said > code. I

Re: How to connect the MYSQL database to Python program?

2015-12-11 Thread ICT Ezy
On Friday, December 11, 2015 at 10:36:33 AM UTC-8, ICT Ezy wrote: > On Wednesday, December 9, 2015 at 9:58:02 AM UTC-8, Chris Angelico wrote: > > On Thu, Dec 10, 2015 at 4:51 AM, ICT Ezy wrote: > > > Pl explain me how to connect the MYSQL database to Python program? > >

Re: How to connect the MYSQL database to Python program?

2015-12-11 Thread ICT Ezy
On Wednesday, December 9, 2015 at 9:58:02 AM UTC-8, Chris Angelico wrote: > On Thu, Dec 10, 2015 at 4:51 AM, ICT Ezy wrote: > > Pl explain me how to connect the MYSQL database to Python program? > > You start by looking for a module that lets you do that. You can use > your fa

Re: How to connect the MYSQL database to Python program?

2015-12-11 Thread ICT Ezy
On Wednesday, December 9, 2015 at 1:45:26 PM UTC-8, Mark Lawrence wrote: > On 09/12/2015 17:51, ICT Ezy wrote: > > Pl explain me how to connect the MYSQL database to Python program? > > > > Use a search engine. Then run up an editor, write some code, run said > code. I

Re: How to connect the MYSQL database to Python program?

2015-12-09 Thread Mark Lawrence
On 09/12/2015 17:51, ICT Ezy wrote: Pl explain me how to connect the MYSQL database to Python program? Use a search engine. Then run up an editor, write some code, run said code. If you then have problems state your OS, Python version and provide us with the full traceback. An

Re: How to connect the MYSQL database to Python program?

2015-12-09 Thread Chris Angelico
On Thu, Dec 10, 2015 at 4:51 AM, ICT Ezy wrote: > Pl explain me how to connect the MYSQL database to Python program? You start by looking for a module that lets you do that. You can use your favourite web search engine, or go directly to PyPI. Then you learn how to use that module, includ

How to connect the MYSQL database to Python program?

2015-12-09 Thread ICT Ezy
Pl explain me how to connect the MYSQL database to Python program? -- https://mail.python.org/mailman/listinfo/python-list

Re: Cannot connect to Mysql database

2013-11-18 Thread Chris Angelico
On Tue, Nov 19, 2013 at 5:26 PM, Himanshu Garg wrote: > I did: > > import MySQLdb as mdb > from MySQLdb import * > from MySQLdb.constants import * > > and now it works. Thanks! again Looks good! Glad it works. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Cannot connect to Mysql database

2013-11-18 Thread Himanshu Garg
I did: import MySQLdb as mdb from MySQLdb import * from MySQLdb.constants import * and now it works. Thanks! again -- https://mail.python.org/mailman/listinfo/python-list

Re: Cannot connect to Mysql database

2013-11-18 Thread Chris Angelico
On Tue, Nov 19, 2013 at 5:10 PM, Chris Angelico wrote: > For a guess, I would try: > > import MySQLdb.connections > > above your chroot, and see if that helps. And possibly also converters, cursors, release, times, and maybe constants. I just peeked at the MySQLdb source code to see what's in the

Re: Cannot connect to Mysql database

2013-11-18 Thread Chris Angelico
On Tue, Nov 19, 2013 at 5:03 PM, Himanshu Garg wrote: > I have written the script as: > > import os > import MySQLdb as mdb > > os.chroot("/lxc/rootfs") > os.chdir("/") > con = mdb.connect(host="192.168.1.7", user="root", passwd="password") > print "opened" > con.close() > > But when I execute, I

Cannot connect to Mysql database

2013-11-18 Thread Himanshu Garg
I have written the script as: import os import MySQLdb as mdb os.chroot("/lxc/rootfs") os.chdir("/") con = mdb.connect(host="192.168.1.7", user="root", passwd="password") print "opened" con.close() But when I execute, I get the following error: "File "/usr/lib/python2.7/dist-packages/MySQLdb/__

Re: MySQL Database

2013-05-08 Thread Kevin Holleran
"Do today what others won't, do tomorrow what others can't" - SEALFit "We are what we repeatedly do. Excellence, then, is not an act, but a habit." - Aristotle On Wed, May 8, 2013 at 3:07 PM, MRAB wrote: > On 08/05/2013 19:52, Kevin Holleran wrote: > >>

Re: MySQL Database

2013-05-08 Thread MRAB
On 08/05/2013 19:52, Kevin Holleran wrote: Hello, I want to connect to a MySQL database, query for some records, manipulate some data, and then update the database. When I do something like this: db_c.execute("SELECT a, b FROM Users") for row in db_c.fetchall(): (r,

Re: MySQL Database

2013-05-08 Thread Kevin Holleran
On Wed, May 8, 2013 at 2:56 PM, Chris Angelico wrote: > On Thu, May 9, 2013 at 4:52 AM, Kevin Holleran wrote: > > Will using db_c to update the database mess up the loop that is cycling > > through db_c.fetchall()? > > Nope; fetchall() returns a list, which you're then iterating over. > Nothing

Re: MySQL Database

2013-05-08 Thread Chris Angelico
On Thu, May 9, 2013 at 4:52 AM, Kevin Holleran wrote: > Will using db_c to update the database mess up the loop that is cycling > through db_c.fetchall()? Nope; fetchall() returns a list, which you're then iterating over. Nothing the database does can disrupt that. ChrisA -- http://mail.python.

MySQL Database

2013-05-08 Thread Kevin Holleran
Hello, I want to connect to a MySQL database, query for some records, manipulate some data, and then update the database. When I do something like this: db_c.execute("SELECT a, b FROM Users") for row in db_c.fetchall(): (r,d) = row[0].split('|')

Re: MySQL database schema discovery

2013-03-22 Thread Tim Golden
On 22/03/2013 16:01, Roy Smith wrote: > What are my options for MySQL schema discovery? I want to be able to > find all the tables in a database, and discover the names and types of > each column (i.e. the standard schema discovery stuff). > > PEP 249 doesn't seem to have any discovery methods.

MySQL database schema discovery

2013-03-22 Thread Roy Smith
What are my options for MySQL schema discovery? I want to be able to find all the tables in a database, and discover the names and types of each column (i.e. the standard schema discovery stuff). PEP 249 doesn't seem to have any discovery methods. Nor does MySQLdb appear to have any non-standard

Re: Need to archive a MySQL database using a python script

2012-09-26 Thread Hans Mulder
On 26/09/12 01:17:24, bruceg113...@gmail.com wrote: > Python Users Group, > > I need to archive a MySQL database using a python script. > I found a good example at: https://gist.github.com/3175221 > > The following line executes however, the archive file is empty. > > o

Re: Need to archive a MySQL database using a python script

2012-09-25 Thread Oscar Benjamin
On 26 September 2012 00:17, wrote: > Python Users Group, > > I need to archive a MySQL database using a python script. > I found a good example at: https://gist.github.com/3175221 > > The following line executes however, the archive file is empty. > > os.popen("

Need to archive a MySQL database using a python script

2012-09-25 Thread bruceg113355
Python Users Group, I need to archive a MySQL database using a python script. I found a good example at: https://gist.github.com/3175221 The following line executes however, the archive file is empty. os.popen("mysqldump -u %s -p%s -h %s -e --opt -c %s | gzip -c > %s.gz" %

Re: SqlAlchemy: remote connection on problem on mysql database

2010-07-09 Thread Rebelo
from SQLAlchemy docs (http://www.sqlalchemy.org/docs/ dbengine.html#database-engine-options): " create_engine() URL Arguments SQLAlchemy indicates the source of an Engine strictly via RFC-1738 style URLs, combined with optional keyword arguments to specify options for the Engine. The form of the U

SqlAlchemy: remote connection on problem on mysql database

2010-07-09 Thread Massi
Hi everyone, in my script I'm trying to connect to a remote database using sqlalchemy. Since I'm pretty new to this library I'm not really sure of what I am doing :-). Up to now what I'm doing to connect to the database is this: engine = create_engine("mysql:// my_username:my_passw...@phpmyadmin.

(non-python) upgrading a MySQL database

2010-01-10 Thread Dikkie Dik
>> ... And I am interested in cleaning this up. I should probably >> start with the matter of databases, since that's something I won't be able >> to easily change once clients actually start entering data. Please share >> with me any further concepts or questions to get me thinking how to redesign

PyNutButter BETA 1.0.0 - Automates CSV data Importation into any website http/https and/or mysql database

2009-01-31 Thread alex goretoy
Introducing PynutButter BETA 1.0.0 Automates csv data importation into any website. Or your money back. Programs like this idea of a program I have here cost $2500. Pynutbutter is opensource. You can use the code anyway you want. As long as I get my credit where it is due. I've worked on this proj

cannot load index value from mysql database

2008-06-25 Thread [EMAIL PROTECTED]
Hi I am trying to right a script to keep a local copy of my mysql database in a local access file. I was able to do this in Access visual basic, but cannot get it to work in python. The procedure works by storing the last index value after each update. Then I do a quarry for all records with a

Re: Need help with first program to connect to mysql database via apache and python.

2008-02-06 Thread Steve Holden
pythonbrian wrote: > I am just learning python and I am trying to create a simple > connection to a mysql table via Python and Apache, using a Python > program > Unfortunately I keep getting an internal server error (50), when I > bring it up in my browser ... information attached. > Any help would

Need help with first program to connect to mysql database via apache and python.

2008-02-06 Thread pythonbrian
I am just learning python and I am trying to create a simple connection to a mysql table via Python and Apache, using a Python program Unfortunately I keep getting an internal server error (50), when I bring it up in my browser ... information attached. Any help would be appreciated ... Thx, [EMAIL

Re: Efficient: put Content of HTML file into mysql database

2007-11-19 Thread Fabian López
content of an html file > > into a mySQL database?Could it be this one?: > > 1.- I have the html document in my hard disk. > > 2.- Then I Open the file (maybe with fopen??) > > 3.- Read the content (fread or similar) > > 4.- Write all the content it in a SQL sentence. >

Re: Efficient: put Content of HTML file into mysql database

2007-11-19 Thread Jesse Jaggars
Fabian López wrote: > Hi colegues, > do you know the most efficient way to put the content of an html file > into a mySQL database?Could it be this one?: > 1.- I have the html document in my hard disk. > 2.- Then I Open the file (maybe with fopen??) > 3.- Read the content (fre

Efficient: put Content of HTML file into mysql database

2007-11-19 Thread Fabian López
Hi colegues, do you know the most efficient way to put the content of an html file into a mySQL database?Could it be this one?: 1.- I have the html document in my hard disk. 2.- Then I Open the file (maybe with fopen??) 3.- Read the content (fread or similar) 4.- Write all the content it in a SQL

Re: Read binary data from MySQL database

2007-05-10 Thread Stefan Sonnenberg-Carstens
On Do, 10.05.2007, 16:19, Christoph Krammer wrote: > Hello, > > I try to write a python application with wx that shows images from a > MySQL database. I use the following code to connect and get data when > some event was triggered: > > dbconn = MySQLdb.connect(host="loca

Re: Read binary data from MySQL database

2007-05-10 Thread Carsten Haese
On Thu, 2007-05-10 at 07:19 -0700, Christoph Krammer wrote: > Hello, > > I try to write a python application with wx that shows images from a > MySQL database. I use the following code to connect and get data when > some event was triggered: > > dbconn = MySQLdb.connect(h

Read binary data from MySQL database

2007-05-10 Thread Christoph Krammer
Hello, I try to write a python application with wx that shows images from a MySQL database. I use the following code to connect and get data when some event was triggered: dbconn = MySQLdb.connect(host="localhost", user="...", passwd="...", db="images")

Re: wxPython GUI update with data from a MySQL database

2006-09-06 Thread Alina Ghergu
I solved the problem by using a more recent version of MySQLdb, compatible with MySQL 5.0. -- http://mail.python.org/mailman/listinfo/python-list

Is there a python system to admin MySQL database online?

2006-08-20 Thread vincent
Just like the phpMySQLadmin? Thanks for reply! -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython GUI update with data from a MySQL database

2006-08-17 Thread Alina Ghergu
Krzysztof Stachlewski wrote: > "Alina Ghergu" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Hi, > > > I have to query the database periodically. I don't have enough > > experience in programming and I would need some advice about the best > > approach in this matter. > > > > I

Re: wxPython GUI update with data from a MySQL database

2006-08-17 Thread Krzysztof Stachlewski
"Alina Ghergu" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, > I have to query the database periodically. I don't have enough > experience in programming and I would need some advice about the best > approach in this matter. > > I tried to solve it using wx.Timer but from time

wxPython GUI update with data from a MySQL database

2006-08-17 Thread Alina Ghergu
Hi there, I'm currently developing a GUI for a network monitor. I have to plot data taken from a MySQL database. For GUI I use wxPython, for plotting Matplotlib. The plotting has to be realtime, so I have to query the database periodically. I don't have enough experience in program

Re: How do I open a mysql database with python

2006-04-25 Thread BartlebyScrivener
Or mxODBC http://www.egenix.com/files/python/mxODBC.html rpd -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I open a mysql database with python

2006-04-25 Thread sturlamolden
http://sourceforge.net/projects/mysql-python -- http://mail.python.org/mailman/listinfo/python-list

How do I open a mysql database with python

2006-04-25 Thread Moishy Gluck
How do I open a mysql database with python. I nead a module that is compatible with windows, and will be on any regular server I singup with. if you could give me some documentation on the module that would be good also. Thanks -- http://mail.python.org/mailman/listinfo/python-list

pulling data from html and putting it in mysql database

2006-04-04 Thread Kun
i have the following simple html that asks for a price: -- http://mail.python.org/mailman/listinfo/python-list

Re: update images inside a mysql database

2005-02-25 Thread Jonas Meurer
On 25/02/2005 Dennis Lee Bieber wrote: > On Thu, 24 Feb 2005 23:10:48 +0100, Jonas Meurer <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > version used placeholders as well. anyway, i changed my code to resemble > > "resemble" is the key... It is NOT the correct s

Re: update images inside a mysql database

2005-02-24 Thread Jonas Meurer
fer between binary and ascii, thus storing binary data should be no problem. i've no glue about how to solve this problem. even if i use quotation marks of any kind for the mysql values, what sometimes circumvents the problem above, at best some some 1000 byte big blob is stored in the mysql database, what is neither an image nor has the size of my uploaded image. any suggestions? bye jonas -- http://mail.python.org/mailman/listinfo/python-list

Re: update images inside a mysql database

2005-02-24 Thread Gabriel Cooper
Jonas Meurer wrote: def i_update(image, imgid): image = "%s" % (image) sql_exec = """UPDATE Images SET Image='%s' WHERE ImgID = '%s' """ % (image, imgid) o = open("/tmp/file.jpg", "w") o.write(image) o.close() db_connect.cursor.execute(sql_e

update images inside a mysql database

2005-02-24 Thread Jonas Meurer
hello, i develop a project with a mysql interface. one mysql table holds all the images for my project. everything works quite well so far, except i'm not able to upload images into the database. the following function does the mysql UPDATE, it requires the image and the image ID as arguments. a