Re: Calculating very large exponents in python

2010-03-07 Thread Taskinoor Hasan
hey can be applied in your situation, since they are faster. And another implementation issue. Try to avoid many recursive calls. It's always possible to convert a recursive function to a non-recursive one and that will be faster if your recursion is too long. Hope it helps. Regards Taskinoor Ha

Re: How to get memory and CPU status of a particular process

2010-02-22 Thread Taskinoor Hasan
;s WMI module for Python. And in case of Linux, you need to dig the details of /proc. Regards Taskinoor Hasan (Sajid) > > -- > Regards, > R. P. Janaka > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I correctly download Wikipedia pages?

2009-11-25 Thread Taskinoor Hasan
I fetched a different problem. Whenever I tried to fetch any page from wikipedia, I received 403. Then I found that wikipedia don't accept the default user-agent (might be python-urllib2.x or something like this). After setting my own user-agent, it worked fine. You can try this if you receive 403.

Re: Import without executing module

2009-02-02 Thread Taskinoor Hasan
On Mon, Feb 2, 2009 at 1:58 PM, Stephen Hansen wrote: > On Sun, Feb 1, 2009 at 11:43 PM, Taskinoor Hasan > wrote: > > Can anyone explain what is the necessity of executing whole script when > > importing. Isn't it enough to just put the module name in the namespace >

Re: Import without executing module

2009-02-01 Thread Taskinoor Hasan
Can anyone explain what is the necessity of executing whole script when importing. Isn't it enough to just put the module name in the namespace and execute when some function is called? On Mon, Feb 2, 2009 at 1:36 PM, Stephen Hansen wrote: > > Maybe he can wrap the things he dont need inside > >

Re: How can I return a non-zero status result from a python script?

2008-12-15 Thread Taskinoor Hasan
sys.exit() raise SystemExit() exception which could be caught and if not caught, terminate only the current thread. If your program is multi-threaded and you want to terminate the process, i.e all threads, immediately then use os._exit(1) On Tue, Dec 16, 2008 at 7:52 AM, Miki wrote: > Hello, > >

Re: Do more imported objects affect performance

2008-12-01 Thread Taskinoor Hasan
On Mon, Dec 1, 2008 at 8:21 PM, Filip GruszczyƄski <[EMAIL PROTECTED]>wrote: > I see. Thanks for a really good explanation, I like to know, how to do > things in the proper way :) I always prefer to use import module and then use module.function. The reason is simple. It makes the code more read