O PSL-PI tem por objetivo incentivar o uso e a produção de software livre no Piauí como política de combate à exclusão digital. Acreditamos que a distribuição de conhecimentos proporcionada pelo Open Source/Software Livre tornará nossa sociedade mais justa e próspera, exatamente por dar a todos as mesmas condições de conhecimento e desenvolvimento.
Software Livre é uma grande oportunidade de construirmos uma sociedade produtora de ciência, independente e efetivamente competitiva. Estamos reconstruindo as bases da nossa sociedade, não mais calcados nos braços do Estado, mas sim, amparados pela iniciativa própria, pela auto-determinação. Nós somos capazes de nos auto-governar. Somos capazes de construir uma sociedade efetivamente Livre. Esta é a essência do PSL-PI.
O PSL-PI é formado pela articulação de indivíduos que atuam em instituições publicas e privadas, grupos de usuários e desenvolvedores de software livre, empresas, governos ou ONGs, e demais setores da sociedade. O importante é a consciência e disposição para propagar o uso de software livre e a cultura colaborativa nas diferentes esferas da sociedade.
Python Backend for Cantor: Append Plot Images in Cantor Workspace
16 de Setembro de 2013, 11:57 - sem comentários aindaOther feature implemented in python backend for Cantor in last weeks was “append plot image to Cantor Workspace”.
In other backends you can, optionally, generate a plot image and this image will be append in Cantor workspace, not generating a separated window to the picture.
Below we have a command to generate a plot image in python using matplotlib and pyplot:
Now we have the result appended in Cantor workspace:
In python, to save a picture using pyplot, we type the command pyplot.savefig(). But, if a picture was saved, it can not be shown in separated window. Otherwise, if a picture is shown in a separated window, it can not be saved to a file.
To solve this problem, the python backend change the show() command to savefig(), with a random name to the picture. The image is saved in a temporary file and loaded in Cantor workspace.
The option to load figure in Cantor workspace or to use a separated window is configured in python backend configuration screen. The default is to use separated window because matplotlib/pyplot have several additional features in image screen.
I would like to see some feedback from you, in special if you are a python developer. The code is hosted in python-backend branch from Cantor repository.
Side panels in Python Backend for Cantor: Help and Variable Management
15 de Setembro de 2013, 18:04 - sem comentários aindaIn last weeks I developed some new features to python backend for Cantor. In this post I will write about two of their: the help and the variable management, implemented as panels.
Help Panel on left; Variable Management Panel on right
Help panel
Help panel shows the help output in a separated panel, facilitating the consult of this information. To use it, simply use help command as in python interactive mode, as in example below:
Below a bigger help output, from a python module:
In previous picture, did you see some change in variable management panel?
Variable Management panel
Variable management panel is a great feature provide by Cantor, but until now just Octave backend had it. This feature show the variables defined in the session, their values, and allow some interesting functions to manipulate these variables.
You can define a lot of variables in python session and these variables will be shown in the panel. See:
In previous picture, I defined a integer variables x and y, a string a, and two modules: numpy and scipy, this last as sc. All this values are shown in panel.
Now I will change some values defined previously and will add some others:
See, now I defined a variable aa by the concatenation of two a‘s; the value of a is now aa; div is the division of y by x. I have a 2-dimensional matrix mtr defined by matrix function from numpy module; a python class HelloWorldClass and a object hello.
I can change the value of some these variable manipulating their values in the panel. For example, I can rewrite the x variable from 35 to 350, clicking in value column and typing 350.
But the more interesting features are provide by the buttons bellow this panel. These buttons load python scripts to run some feature. There are: add variable, load variables from a file, save variables to a file and clear all variables in the session.
Add variable is quite simple: a dialog is open and you type the variable and their value:
Save/Load use shelve module to save and load the variables of the session. But, it is important to say, this feature don’t save all the variables because shelve module have some limitations. For example, I saved this session to a file named “python_session.txt”. The python code loaded is:
After save, I will clear the session. The python code loaded is:
And, finally, I will load the variables. The python code loaded ans the variable panel is show below:
Conclusions
It is working now but I need some more tests, in special the save/load python objects defined by user and modules.
I would like to see some feedback from you. The code is hosted in python-backend branch from Cantor repository, so you can test it.