introspection question
Hi Guys, What would be the simplest way of enumerating all methods and members (including inherited) of a given object? Thank you. Alex -- http://mail.python.org/mailman/listinfo/python-list
Re: introspection question
Nice thank you. But anyway to make it look pretty? On 07/01/2008, Peter Otten <[EMAIL PROTECTED]> wrote: > Alex K wrote: > > > What would be the simplest way of enumerating all methods and members > > (including inherited) of a given object? Thank you. > > inspect.getmembers() > > Peter > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list
PIL question
Hello, Would anyone know how to generate thumbnails with rounded corners using PIL? I'm also considering imagemagick if PIL turns out not to be appropriate for the task. Thank you so much, Alex -- http://mail.python.org/mailman/listinfo/python-list
paging in python shell
Hello, Does anyone know if the python shell supports paging or if I should look into iPython? Thank you so much. Alex -- http://mail.python.org/mailman/listinfo/python-list
Re: paging in python shell
Hi Tim, Yes I mean piping the output into "more" for example. Alex On 14/01/2008, Tim Roberts <[EMAIL PROTECTED]> wrote: > "Alex K" <[EMAIL PROTECTED]> wrote: > > > >Does anyone know if the python shell supports paging or if I should > >look into iPython? Thank you so much. > > "Paging" is an overloaded term. What do you mean, exactly? Do you mean > something like piping the output into "more"? The Python shell does that > for the "help" command, but maybe you could post a more precise example of > what you want. > -- > Tim Roberts, [EMAIL PROTECTED] > Providenza & Boekelheide, Inc. > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list
Re: paging in python shell
Thanks John, but would it be possible to remain in the python interpreter? On 14/01/2008, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 15, 7:35 am, "Alex K" <[EMAIL PROTECTED]> wrote: > > Hi Tim, > > > > Yes I mean piping the output into "more" for example. > > > > Why don't you "suck it and see"??? > > E.g. > > C:\junk>copy con demomore.py > for i in range(100): > print 'line', i > ^Z > 1 file(s) copied. > > C:\junk>python demomore.py | more > line 0 > line 1 > line 2 > line 3 > line 4 > [snip] > line 50 > line 51 > line 52 > line 53 > line 54 > line 55 > line 56 > -- More -- > > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list
Re: paging in python shell
Thanks it's good to know. iPyton looks really neat. On 15/01/2008, Ben Finney <[EMAIL PROTECTED]> wrote: > John Machin <[EMAIL PROTECTED]> writes: > > > C:\junk>python demomore.py | more > > Your example uses the OS shell to invoke a pager on the output of the > Python process. The OP was asking about paging *within* the Python > shell. > > To my knowledge there's nothing in the default Python shell that > enables what the OP is asking for. There are other Python shells, e.g. > Idle, ipython, or a Python window inside Emacs, that may be better > suited. > > -- > \ "Compulsory unification of opinion achieves only the unanimity | > `\ of the graveyard." -- Justice Roberts in 319 U.S. 624 (1943) | > _o__) | > Ben Finney > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list
Re: paging in python shell
That seems interesting but it's not quite what I want to do. To take an example I would like to be able to do something similar to the mysql shell when its pager is set to less. Displayhook is called whenever an expression is being evaluated. I'd like to call 'less' on the ouput of a statement. Alex On 26/01/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > --- Alex K <[EMAIL PROTECTED]> escribió: > > > Thank you for this interesting tip. However I'm not > > sure to know how > > to use it. It seems pydoc.pager('text') just pages > > the text passed in. > > How do I actually make the python shell use a > > different pager? > > I'm unsure of what you want. Do you want the print > statement, inside the Python interpreter, to page its > output? Write a function to page the output the way > you like, and assign it to sys.displayhook (see > http://docs.python.org/lib/module-sys.html#l2h-5124 ) > > -- > Gabriel Genellina > > > Tarjeta de crédito Yahoo! de Banco Supervielle. > Solicitá tu nueva Tarjeta de crédito. De tu PC directo a tu casa. > www.tuprimeratarjeta.com.ar > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list
template inheritance
While building a website using template inheritance one usually does the following: fetch from database fetch from some more data from database ... << more required computations then at the end render the template with the fetched data Without template inheritance one usually does the following: fetch from database render this part of the site with this fetched data fetch some more data from the database render this other part of the site with the fetched data ... etc The first approach is much more elegant and leads to easier to maintain code. However the user will have to wait till the end of the fetching (long computations) before any rendering can take place. In the second approach however the site loads as we are fetching the data which is more convenient to the user. Am I correct to assume this? Is there a way to get the best of both worlds? Thank you. -- http://mail.python.org/mailman/listinfo/python-list