<div class="gmail_quote">On Tue, Sep 20, 2011 at 12:13 AM, Jordan Evans <span dir="ltr"><<a href="mailto:mindwalkernine@gmail.com">mindwalkernine@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I want dynamically place the 'return' statement in a function via user input or achieve the same through some other means. If some other means, the user must be able initiate this at runtime during a raw_input(). This is what I have so far, this would be an awesome command line debugging tool if I can get it to work.<br>
<br>def b(label="", *args):<br> """Used to create breaks for debugging. Will break the function or continue the function it is place within based on user input. Has as a input loop for querying variables and executing code before a break or a continue."""<br>
print label+":",<br> for arg in args:<br> print str(arg),<br> if len(args):<br> print<br> x = ""<br> while x != ".":<br> command = raw_input()<br> try:<br>
exec command<br> except:<br> pass<br></blockquote><div><br>It is also possible to create the function in your loop.<br><br>for arg in args:<br>
def f(args):<br>
return args # You can make this a callback function if you want<br></div></div><br clear="all"><br>-- <br>Odeyemi 'Kayode O.<br><a href="http://www.sinati.com" target="_blank">http://www.sinati.com</a>. t: @charyorde<br>
<br>