Suppressing Warnings

Suppressing Warnings

am 24.08.2009 16:18:33 von Victor Subervi

--001636417d5f9c12c60471e3e4e0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi,
I have the following python code:

cursor.execute('create database if not exists spreadsheets;')
cursor.execute('use spreadsheets;')

but it generates this warning:

Warning (from warnings module):
File "C:\Python25\mysqlConverter.py", line 140
cursor.execute('use spreadsheets;')
Warning: Can't create database 'spreadsheets'; database exists

What do?
TIA,
Victor

--001636417d5f9c12c60471e3e4e0--

Re: Suppressing Warnings

am 25.08.2009 06:42:02 von pengyao

--000e0cd2e276ab539d0471eff4a6
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Warning: Can't create database 'spreadsheets'; database exists

This is the answer.

2009/8/24 Victor Subervi

> Hi,
> I have the following python code:
>
> cursor.execute('create database if not exists spreadsheets;')
> cursor.execute('use spreadsheets;')
>
> but it generates this warning:
>
> Warning (from warnings module):
> File "C:\Python25\mysqlConverter.py", line 140
> cursor.execute('use spreadsheets;')
> Warning: Can't create database 'spreadsheets'; database exists
>
> What do?
> TIA,
> Victor
>

--000e0cd2e276ab539d0471eff4a6--

Re: Suppressing Warnings

am 31.08.2009 19:43:13 von Victor Subervi

--001636426d3b67582904727391ca
Content-Type: text/plain; charset=ISO-8859-1

Right. Perhaps you could enlighten me as to what I should code to prevent
that warning? It repeats 2,400 times and makes finding the real errors a
pain in the behind.
Victor

On Tue, Aug 25, 2009 at 12:42 AM, peng yao wrote:

> Warning: Can't create database 'spreadsheets'; database exists
>
> This is the answer.
>
> 2009/8/24 Victor Subervi
>
> Hi,
>> I have the following python code:
>>
>> cursor.execute('create database if not exists spreadsheets;')
>> cursor.execute('use spreadsheets;')
>>
>> but it generates this warning:
>>
>> Warning (from warnings module):
>> File "C:\Python25\mysqlConverter.py", line 140
>> cursor.execute('use spreadsheets;')
>> Warning: Can't create database 'spreadsheets'; database exists
>>
>> What do?
>> TIA,
>> Victor
>>
>
>

--001636426d3b67582904727391ca--