草庐IT

Python:将元组转换为逗号分隔的字符串

importMySQLdbdb=MySQLdb.connect("localhost","root","password","database")cursor=db.cursor()cursor.execute("SELECTidFROMsome_table")u_data=cursor.fetchall()>>>printu_data((1320088L,),)我在互联网上找到的东西让我走到了这里:string=((1320088L,),)string=','.join(map(str,string))>>>printstring(1320088L,)我期望的输出是这样的:#Sing