I'm writing a software and I want to save what I have done so that I can re-open the software and restart from where I stopped. How can I do it?Surfing on the net I find some doc about objects serialization, so they can be converted in bytes...What it means? I can't understand very well.Python is very powerful because it does almost everything by itself, but it is even very difficult.There is a package, named Pickles, which takes tho objects and sves them to a file. Pay attention because it does not save everything. For other information here is the link.So there are different possibilities:
You can save the list of the operation you did, quite easy to code, but it has a low efficiency on opening.
You can use the pickles and you don't save everything, it's a little bit more difficult, but it is even more efficient.
You can optimize the code so that the opening is simple, it's hard to code, but very efficient.
Is there any other consideration? Am I writing wrong? Can you help me?I'm waiting your comment.
Here is a function, which can be called somewhere to resize images. It works resizing the image to user defined width and height, or setting width (or height) to -1, resize the new dimensions maintaining the same aspect ratio.
It is possible to set even the quality of the image.
Starting by these instructions instructions, I created a guide to build VTK libraries for Python under Windows (Vista)
1) Download and install:
Cmake
Visual C++ Express (2008)
Python
2) Download source for vtk and extract them to a folder (ie. VTK_SOURCE).
3) Make a new folder where the compiler can put builded files (ie. BUILD).
4) Start Cmake.
5) Setup fields:
Where is the source code = VTK_SOURCE.
Where to build the binaries = BUILD.
6) Clic on Configure and select as compiler "Visual C 9 (2008)".
7) Setup fields:
VTK_WRAP_PYTHON=ON.
BUILD_SHARED_LIBS=ON.
8) Clic on Configure.
9) If there are any problem solve them and then clic on Configure each time. Here are problems I found and the solutions:
CMake Error at CMake/vtkWrapTcl.cmake:180 (MESSAGE): Tk was not found. Install the Tk development package (see http://tcl.tk or ActiveState Tcl) and set the appropriate variables (TK_INCLUDE_PATH, TK_LIBRARY, TK_WISH) or disable VTK_USE_TK. Call Stack (most recent call first): CMakeLists.txt:831 (INCLUDE).
Show Advanced Values.
SetVTK_USE_TK to OFF.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.Please set them or make sure they are set and tested correctly in the CMake files: PYTHON_INCLUDE_PATH (ADVANCED). used as include directory in directory C:/Users/Giuseppe/Desktop/Nuova cartella/vtk-5.2.1.
Show Advanced Values.
Setup PYTHON_INCLUDE_PATH to the python include directory (ie. C:/Python26/include).
CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: PYTHON_LIBRARY (ADVANCED).
Show Advanced Values.
Setup PYTHON_LIBRARY to the file pythonXX.lib in the folder libs in Python (es.: C:/Python26/libs/python26.lib).
10) Clic on Ok when everything goes well.
11) Start the file INSTALL.vcproj in thefolder BUILD with Visual C++.
12) From Menu Project select Properties then Configuratione Manager and setup the active configuration on Release.
13) From menu Debug select Start Debug or F5.
14) Wait until the end of the build (it may require some time).
At the end the build has been succesfull using python 2.5, while with pyhon 2.6 for 64bit OS Visual Basic gave me linker error because it was impossible to find definition of python calls.