0
je le code suivant:Convertir Mysql bool à python Vrai/Faux
new_file.write(("""
<cleared_for_hd_vod>%(enable_est_hd)s</cleared_for_hd_vod>
<cleared_for_hd_sale>%(enable_vod_hd)s</cleared_for_hd_sale>"""
% update_data).lower())
Cela me donne les éléments suivants:
<cleared_for_hd_vod>1</cleared_for_hd_vod>
<cleared_for_hd_sale>0</cleared_for_hd_sale>
Cependant, ce que je besoin est le suivant:
<cleared_for_hd_vod>true</cleared_for_hd_vod>
<cleared_for_hd_sale>false</cleared_for_hd_sale>
Existe-t-il un moyen d'y parvenir en modifiant la mise en forme de chaîne que j'utilise actuellement (en haut de cette question)?
est-ce que 'bool (% (enable_est_hd) s)' ne fonctionne pas? – karthikr
Comment cela serait-il écrit? – David542
quel est le type python de enable_vod_hd? quel connecteur mysql utilisez-vous? – soulcheck