You are currently viewing the Python section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
Need some hints in speeding up the Python scripts!!!
(1)Except partial objects module importing, i need to find out how to
improve performance in spatial and time consumption!
example[u]</u>:
%instead of importing a whole gzip module
import gzip
%I use partial import of methods I am going to use, from the gzip module
import compress from gzip
import decompress from gzip
The example is rudimentary, but it explains the problem in hand. Because even the simplest gui aplication extracts 8MB of memory space, and that is absolutely to much...
Please, if any hints come across your mind, feel free to post your code...
I'm not sure I understand the question, but I think it's a syntax error.
You are meant to do: from MODULE import something
for example: from gzip import compress
you can also use import gzip.compress
You say that you want to optimise your code by avoiding the import of redundant modules, that's great, I'm not sure how much optimisation you'll get (it depends on how much redundancies you had before) but it sure can't heart. if you want to do some more hardcore optimisation checkout psyco.sourceforge.net