Hola,<br><br>He creado tu ejemplo en my base de datos de test. Prueba esto a ver:<br><br>import MySQLdb<br>conn = MySQLdb.connect (host=&quot;localhost&quot;, user=XXXXXXXXXX, passwd=YYYYYYYYYYYYYY, db=&quot;test&quot;)<br>
cursor = conn.cursor()<br>cursor.execute(&quot;select id, Nombre from cotizaciones_valores where id=1&quot;)<br>resultado=cursor.fetchone()<br>&gt;&gt;&gt; print(resultado)<br>(&#39;1&#39;, &#39;telef\xc3\xb3nica Espa\xc3\xb1a&#39;)<br>
id_Valor= resultado[0]<br>Nombre_Valor= resultado[1]<br>print(Nombre_Valor)<br>&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; telefónica España<br>archivo_configuracion= open( &#39;gnuplot.dem&#39;, &#39;w&#39;)<br>
archivo_configuracion.write(&quot;set title &#39;%s (%s)&#39;\n&quot; % ( Nombre_Valor, id_Valor,))<br>archivo_configuracion.close()<br>archivo_configuracion = open(&#39;gnuplot.dem&#39;, &#39;r&#39;)<br>linea = archivo_configuracion.readline()<br>
print(linea)<br>&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;set title &#39;telefónica España (&lt;built-in function id&gt;)&#39;<br>archivo_configuracion.close()<br><br>Yo también estoy aprendiendo, eh! Así que si alguien ve algo que esté muy mal que avise, xD!<br>
<br>Saludos,<br><br>Raúl<br><br><div class="gmail_quote">2011/2/28 Dr. Bobus <span dir="ltr">&lt;<a href="mailto:drbobus@gulic.org">drbobus@gulic.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
El Mon, 28 Feb 2011 20:08:15 +0100<br>
Jesús Genicio &lt;<a href="mailto:jgenicio@gmail.com">jgenicio@gmail.com</a>&gt; dijo:<br>
<div class="im"><br>
&gt;<br>
&gt; He intentado utilizar tu código pero me da errores igualmente.<br>
&gt;<br>
&gt; He adjuntado a pastebin el código completo, si alguien me puede<br>
&gt; ayudar...<br>
&gt;<br>
&gt; <a href="http://pastebin.com/x3DFTkjD" target="_blank">http://pastebin.com/x3DFTkjD</a><br>
&gt;<br>
<br>
<br>
</div>Hola Jesus:<br>
<br>
¿En la linea 25 de tu código type(resultado[ 1]) que devuelve ??<br>
<br>
<br>
Saludos<br>
<br>
<br>
Dr. Bobus<br>
<br>
- --<br>
[In &#39;Doctor&#39; mode], I spent a good ten minutes telling Emacs what I<br>
thought of it.  (The response was, &#39;Perhaps you could try to be less<br>
abusive.&#39;)<br>
(Matt Welsh)<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.10 (GNU/Linux)<br>
<br>
iEYEARECAAYFAk1sFm8ACgkQVO2xr8e6gc5EtQCcCvB5TeeQUekZBFFSiBet2sfY<br>
FmcAniMSpzChi92K2MKR7Vi40pcoToP/<br>
=fs0E<br>
-----END PGP SIGNATURE-----<br>
<div><div></div><div class="h5">_______________________________________________<br>
Python-es mailing list<br>
<a href="mailto:Python-es@python.org">Python-es@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-es" target="_blank">http://mail.python.org/mailman/listinfo/python-es</a><br>
FAQ: <a href="http://python-es-faq.wikidot.com/" target="_blank">http://python-es-faq.wikidot.com/</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Raúl Cumplido<br>