Looks like all of those packages use Microsoft's COM and are then not under the jurisdiction of the ever so efficient Python memory manager. In other words, you are running an external program from Python.
So is there any way to free the resources / library used in the script ? even though it is an external library, imported into the script there will be a way to dispose once it has been used. Any ideas ?
A solution is not to import your library xlwt but to start a child process which will import the library. You can then communicate with the child process through pipes, or using a module like pyro. When you are done with the xlwt, you terminate the child process and the memory is freed. I used this solution in the past for other reasons than memory, and it works well.
Creating a child process is just starting another program from your python program. This is done with the subprocess module. This blog page http://blog.doughellmann.com/2007/07/pymotw-subprocess.html shows good examples. The main problem when you create a subprocess is: do you have to communicate with the subprocess, wich means do you have to send data to the subprocess from your program, and do you have to receive data from the subprocess ? Depending on the answer, the structure of your code may vary a lot.
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...