<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Vale, creo que ya lo tengo:<div class="">Creo la variable result como global.</div><div class=""><br class=""></div><div class="">Muchísimas gracias Miguel, te debo una caña :-)</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="color: rgb(248, 248, 242); background-color: rgb(14, 20, 25); font-family: Menlo, Monaco, "Courier New", monospace; line-height: 20px; white-space: pre;" class=""><div class=""><span style="color: #ff79c6;" class="">def</span> <span style="color: #50fa7b;" class="">foo</span>(<span style="color: #ffb86c;" class="">root</span>, <span style="color: #ffb86c;" class="">texto</span>)<span style="color: #ff79c6;" class="">:</span></div><div class=""> <span style="color: #6272a4;" class="">#print('con este texto "{}" hago lo que quiero'.format(texto))</span></div><div class=""> root<span style="color: #ff79c6;" class="">.</span><span style="color: #8be9fd;" class="">quit</span>()</div><div class=""> root<span style="color: #ff79c6;" class="">.</span><span style="color: #8be9fd;" class="">destroy</span>()</div><br class=""><div class="">root <span style="color: #ff79c6;" class="">=</span> tk<span style="color: #ff79c6;" class="">.</span><span style="color: #8be9fd;" class="">Tk</span>()</div><div class="">root<span style="color: #ff79c6;" class="">.</span><span style="color: #8be9fd;" class="">geometry</span>(<span style="color: #f1fa8c;" class="">"600x400"</span>)</div><br class=""><div class=""><span style="color: #ff79c6;" class="">def</span> <span style="color: #50fa7b;" class="">getTextInput</span>()<span style="color: #ff79c6;" class="">:</span></div><div class=""> <span style="color: #ff79c6;" class="">global</span> result</div><div class=""> result <span style="color: #ff79c6;" class="">=</span> textExample<span style="color: #ff79c6;" class="">.</span><span style="color: #8be9fd;" class="">get</span>(<span style="color: #f1fa8c;" class="">"1.0"</span>, tk<span style="color: #ff79c6;" class="">.</span><span style="color: #ffb86c;" class="">END</span><span style="color: #ff79c6;" class="">+</span><span style="color: #f1fa8c;" class="">"-1c"</span>)</div><div class=""> <span style="color: #8be9fd;" class="">foo</span>(root, result)</div><br class=""><div class="">textExample <span style="color: #ff79c6;" class="">=</span> tk<span style="color: #ff79c6;" class="">.</span><span style="color: #8be9fd;" class="">Text</span>(root, <span style="color: #ffb86c;" class="">height</span><span style="color: #ff79c6;" class="">=</span><span style="color: #ffb86c;" class="">10</span>)</div><div class="">textExample<span style="color: #ff79c6;" class="">.</span><span style="color: #8be9fd;" class="">pack</span>()</div><div class="">btnRead <span style="color: #ff79c6;" class="">=</span> tk<span style="color: #ff79c6;" class="">.</span><span style="color: #8be9fd;" class="">Button</span>(root, <span style="color: #ffb86c;" class="">height</span><span style="color: #ff79c6;" class="">=</span><span style="color: #ffb86c;" class="">2</span>, <span style="color: #ffb86c;" class="">width</span><span style="color: #ff79c6;" class="">=</span><span style="color: #ffb86c;" class="">50</span>, <span style="color: #ffb86c;" class="">text</span><span style="color: #ff79c6;" class="">=</span><span style="color: #f1fa8c;" class="">"Introducir en la bbdd"</span>, <span style="color: #ffb86c;" class="">command</span><span style="color: #ff79c6;" class="">=</span>getTextInput)</div><div class="">btnRead<span style="color: #ff79c6;" class="">.</span><span style="color: #8be9fd;" class="">pack</span>()</div><div class="">root<span style="color: #ff79c6;" class="">.</span><span style="color: #8be9fd;" class="">mainloop</span>()</div><br class=""><div class=""><span style="color: #8be9fd;" class="">print</span>(<span style="color: #f1fa8c;" class="">'mi programa sigue por aquí'</span>)</div><div class=""><span style="color: #8be9fd;" class="">print</span>(result)</div></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class=""><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Saludos,</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class="">--<br class="">Javier Pérez<br class=""><a href="http://es.linkedin.com/in/javierperez1" class="">http://es.linkedin.com/in/javierperez1</a><br class="">http://www.perasalvino.es/<br class=""><br class=""><br class=""><br class=""></div>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">El 19 nov 2020, a las 9:09, Javier Perez <<a href="mailto:javierperez@perasalvino.es" class="">javierperez@perasalvino.es</a>> escribió:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><span style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Muchas gracias Miguel,</span><div class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class=""></div><div class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">Si y no.</div><div class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class=""></div><div class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">O sea esta perfecta pero sigo con el mismo problema:</div><div class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class=""></div><div class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">Después de:</div><div class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><blockquote type="cite" class=""><span class="" style="font-family: LucidaGrande; float: none; display: inline !important;">print('mi programa sigue por aquí')</span><br class="" style="font-family: LucidaGrande;"></blockquote><div class=""><br class=""></div><div class="">quiero usar el texto del cuadro de dialogo para modificarlo.</div></div><div class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class=""></div><div class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class=""></div><div class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">un print(texto) no funciona.<br class=""><div class=""><div class="" style="font-family: "Lucida Grande"; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br class="Apple-interchange-newline"><br class=""></div><div class="" style="font-family: "Lucida Grande"; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Saludos,</div><div class="" style="font-family: "Lucida Grande"; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br class="">--<br class="">Javier Pérez<br class=""><a href="http://es.linkedin.com/in/javierperez1" class="">http://es.linkedin.com/in/javierperez1</a><br class=""><a href="http://www.perasalvino.es/" class="">http://www.perasalvino.es/</a><br class=""><br class=""><br class=""><br class=""></div></div><div class=""><br class=""><blockquote type="cite" class=""><div class="">El 18 nov 2020, a las 19:12, Miguel Sanchez <<a href="mailto:msanchez@uninet.edu" class="">msanchez@uninet.edu</a>> escribió:</div><br class="Apple-interchange-newline"><div class=""><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class=""><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Es esto lo que pretendes hacer?</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">import tkinter as tk</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">def foo(root, texto):</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"> print('con este texto "{}" hago lo que quiero'.format(texto))</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"> root.quit()</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"> root.destroy()</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">root = tk.Tk()</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">root.geometry("600x400")</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">def getTextInput():</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"> result = textExample.get("1.0", "end")</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"> foo(root, result)</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">textExample = tk.Text(root, height=10)</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">textExample.pack()</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">btnRead = tk.Button(root, height=2, width=50, text="Introducir en la bbdd", command=getTextInput)</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">btnRead.pack()</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">root.mainloop()</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">print('mi programa sigue por aquí')</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Saludos</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><blockquote type="cite" class="" style="font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class=""><br class=""><br class=""><br class="">Saludos,<br class=""><br class="">--<br class="">Javier Pérez<br class=""><a href="http://es.linkedin.com/in/javierperez1" class="">http://es.linkedin.com/in/javierperez1</a><br class=""><a href="http://www.perasalvino.es/" class="">http://www.perasalvino.es/</a><br class=""><br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">El 17 nov 2020, a las 18:19, Miguel Sanchez <msanchez@uninet.edu> escribió:<br class=""><br class="">Hola:<br class=""><br class=""><br class="">No veo claro lo que pretendes<br class=""><br class="">noticia = getTextInput()<br class="">print(noticia)<br class=""><br class="">Están fuera del bucle por lo que se ejecutarán cuando ya no exista textExample con lo que debería dar error<br class="">y por otro lado quién esperas que reciba el return de getTextInput()??<br class=""><br class=""><br class="">Saludos<br class=""><br class=""><br class="">El Tue, 17 Nov 2020 12:27:16 +0100<br class="">Javier Perez <javierperez@perasalvino.es> dijo:<br class=""><br class=""><blockquote type="cite" class="">Hola a todos,<br class=""><br class=""><br class="">Estoy empezando a usar tkinter. Tengo dos problemas:<br class="">1) no se como sacar la información del formulario. El caso es que tengo una funcion que si lo recoge pero no lo retorna. No llego a entender lo que pasa.<span class="Apple-converted-space"> </span><br class=""><br class="">2) Después, al cerrar la venta, me muestra este error la consola:<span class="Apple-converted-space"> </span><br class="">result = textExample.get("1.0", "end")<br class="">File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/tkinter/__init__.py", line 3706, in get<br class="">return self.tk.call(self._w, 'get', index1, index2)<br class="">_tkinter.TclError: invalid command name ".!text"<br class=""><br class=""><br class=""><br class="">El código es este:<br class="">import tkinter as tk<br class=""><br class="">root = tk.Tk()<br class="">root.geometry("600x400")<br class=""><br class=""><br class="">def getTextInput():<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>result = textExample.get("1.0", "end")<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>#print(result) # —> si le queto el comentario si me lo imprime<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-converted-space"> </span>return result<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span><br class="">textExample = tk.Text(root, height=10)<br class="">textExample.pack()<br class="">btnRead = tk.Button(root, height=2, width=50, text="Introducir en la bbdd", command=getTextInput)<br class=""><br class="">btnRead.pack()<br class=""><br class="">root.mainloop()<br class=""><br class="">noticia = getTextInput()<br class="">print(noticia)<br class=""><br class=""><br class="">Muchísimas gracias a todos,<br class=""><br class="">Saludos,<br class=""><br class="">--<br class="">Javier Pérez<br class="">http://es.linkedin.com/in/javierperez1<br class="">http://www.perasalvino.es/<br class=""><br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">Python-es mailing list<br class="">Python-es@python.org<br class="">https://mail.python.org/mailman/listinfo/python-es <br class=""></blockquote>_______________________________________________<br class="">Python-es mailing list<br class="">Python-es@python.org<br class="">https://mail.python.org/mailman/listinfo/python-es <br class=""></blockquote><br class=""></blockquote><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">_______________________________________________</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Python-es mailing list</span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><a href="mailto:Python-es@python.org" class="">Python-es@python.org</a></span><br class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="" style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><a href="https://mail.python.org/mailman/listinfo/python-es" class="">https://mail.python.org/mailman/listinfo/python-es</a></span></div></blockquote></div><br class=""></div><span style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Python-es mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="mailto:Python-es@python.org" style="font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Python-es@python.org</a><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="https://mail.python.org/mailman/listinfo/python-es" style="font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mail.python.org/mailman/listinfo/python-es</a></div></blockquote></div><br class=""></div></body></html>