Thanks everyone. <span></span><br><br>On Wednesday, February 27, 2013, Femi Banjo  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr">coursera, udacity & edx all have decent Python  courses for beginners and very good support on forums etc and they're all free<br><br><div><div></div>> Date: Wed, 27 Feb 2013 01:10:07 -0800<br>
> From: <a href="javascript:_e({}, 'cvml', 'fomcl@yahoo.com');" target="_blank">fomcl@yahoo.com</a><br>> To: <a href="javascript:_e({}, 'cvml', 'eryksun@gmail.com');" target="_blank">eryksun@gmail.com</a><br>
> CC: <a href="javascript:_e({}, 'cvml', 'tutor@python.org');" target="_blank">tutor@python.org</a><br>> Subject: Re: [Tutor] There's a Programmer in Me<br>> <br>> <br>> <br>> > On Tue, Feb 26, 2013 at 4:00 PM, Albert-Jan Roskam <<a href="javascript:_e({}, 'cvml', 'fomcl@yahoo.com');" target="_blank">fomcl@yahoo.com</a>> <br>
> > wrote:<br>> >> <br>> >> What I like about R: if I do 'print(func)' (or fix(func)), it <br>> > prints the<br>> >> source code of the function. It would be cool if Python had something<br>
> >> similar. Instead Python prints the not-so-informative<br>> >> <function func at 0xa82fae4><br>> > <br>> > You can use inspect.getsource(obj) if obj is a module, class, method,<br>> > function, traceback, frame, or code that has a source file (e.g.<br>
> > __file__, co_filename) and is defined normally (e.g. class, def):<br>> > <br>> >     >>> import inspect<br>> >     >>> def printsrc(obj): print inspect.getsource(obj)<br>> > <br>
> >     >>> import antigravity<br>> >     >>> printsrc(antigravity)<br>> > <br>> >     import webbrowser<br>> > <br>> >     webbrowser.open(<a href="http://xkcd.com/353/" target="_blank">http://xkcd.com/353/</a>)<br>
> <br>> Ahh, thank you! I like the %psource magic word, but until I get IPython installed in the office I'll use inspect.getsource. <br>> import inspect, soul<br>> print inspect.getsource(soul.getsoul)<br>
> import webbrowser<br>> webbrowser.open(<a href="http://xkcd.com/413/" target="_blank">http://xkcd.com/413/</a>)  ;-))<br>> <br>> _______________________________________________<br>> Tutor maillist  -  <a href="javascript:_e({}, 'cvml', 'Tutor@python.org');" target="_blank">Tutor@python.org</a><br>
> To unsubscribe or change subscription options:<br>> <a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br></div>                                         </div></div>
</blockquote>