Python Forum
Hard time trying to have clean MySQL to CSV program
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hard time trying to have clean MySQL to CSV program
#1
Hello,

I want to know how to get 'clean' results on the MySQL querry using python.

Here is the program:

 cur.execute('select nom_region from data where dept_epci like %s and nom_commune like %s ', [test, x[5]])
 region = cur.fetchall()    
 print (region)
And here is the result
(('Occitanie',),)
I just want that program to print (or return) only Occitanie.

Do you have any idea how i could manage to do so?

Thank you
Reply


Messages In This Thread
Hard time trying to have clean MySQL to CSV program - by PierreSoulier - Jul-20-2018, 07:22 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can i clean this code ? BSDevo 8 940 Oct-28-2023, 05:50 PM
Last Post: BSDevo
  Mysql and mysql.connector error lostintime 2 664 Oct-03-2023, 10:25 PM
Last Post: lostintime
  Hard time trying to figure out the difference between two strings carecavoador 2 675 Aug-16-2023, 04:53 PM
Last Post: carecavoador
  Clean Up Script rotw121 2 1,006 May-25-2022, 03:24 PM
Last Post: rotw121
  Mysql error message: Lost connection to MySQL server during query tomtom 6 15,993 Feb-09-2022, 09:55 AM
Last Post: ibreeden
  How to clean UART string Joni_Engr 4 2,476 Dec-03-2021, 05:58 PM
Last Post: deanhystad
  First time with mysql pascal111 5 3,541 Sep-25-2021, 07:45 AM
Last Post: Pedroski55
  Program stuck at mysql.connector.connect zazas321 1 2,075 Jul-29-2021, 10:49 AM
Last Post: zazas321
  Having a hard time conceptualizing how to print something MysticLord 6 3,100 Sep-19-2020, 10:43 PM
Last Post: MysticLord
  Having hard time understanding the function self-returning itself twice jagasrik 2 2,483 Aug-15-2020, 08:50 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020