(Download the version that corresponds with your python version.)
Learn with me, on my journey of discovery about ... everything, but mainly computers and programming.
Oct 6, 2009
How to package the PyQt with VTK application
(Download the version that corresponds with your python version.)
Sep 24, 2009
Navigate Faster with your Keyboard
Moving Cursor
Home................ = to the beginning of line
End................... = to the end of line
Ctrl + Home..... = to the beginning of page
Ctrl + End........ = to the end of page
Deleting
Ctrl + Backspace......= word to the left
Ctrl + Delete.............= word to the right
Selecting
Shift + left arrow...........................= one character to the left
Ctrl + Shift + left/right arrow......= word to the left/right
Shift + Home/End.........................= Select all till Start/Finish
Internet Browser
Ctrl + Enter..................= when entering URLs automatically adds www & .com
Ctrl + w.........................= close window/tab
Alt + Tab.......................= next tab
Alt + Shift + Tab...........= previous tab
Alt + d.........................= Go to url box
Alt + g..........................=Go to search box
Sep 15, 2009
Python loop and modify list
Sep 10, 2009
Picking actors
Sep 5, 2009
Sep 3, 2009
-1 is true (if loops)
myString = 'Hello World'
QStrings and Strings
My problem was that I wanted to find a certain string in the filename, but it was a QString, and not a string. I found that...
to convert a qstring to string, use the str function.
stringB = str(stringA)
In this situation, stringB will be the string version of stringA, which is of type QString. By the way, str works on integers as well.
PyQt Documentation on Qfiledialog
Sep 2, 2009
Backslashes and Forward slashes
Sep 1, 2009
Embedding vtk into a pyqt GUI
import vtk
Aug 26, 2009
VTK displaying finite element mesh using vtkunstructuredgrid from data file of coordinates
Aug 4, 2009
Actor Color / Colour Change
The colour in the actor’s property only takes effect if there is no scalar data available to the actor’s mapper. By default, the mapper’s input scalar data colours the actor, and the actor’s colour is ignored. To ignore the scalar data, use the method ScalarVisibilityOff().
(Taken from the book: The VTK User's Guide; updated for VTK Version 5)
Jul 29, 2009
How to keep your laptop kinda cool (at no cost)
Jul 27, 2009
How to call (or execute) a python file from another
Jul 26, 2009
How to Install VTK for use with Python
I am installing VTK, which I will need to incorporate 3D visualisation in my GUI. I am designing my GUI in Qt, and programming with Python. (Hence, PyQt). To make VTK work with Python, you need to install from binaries, instead of downloading with the windows installer. Feel free to make comments, or ask questions. (I'm not an expert. I am actually a beginner, but I want to document my problems and solutions so that others can be benefited. So feel free to talk here, as it might help others too.)
Download and install:
Cmake(http://www.cmake.org/cmake/resources/software.html)
Python(http://www.python.org/download/releases/)
Download and unzip into a file (we will call this the source file):
VTK(http://www.vtk.org/VTK/resources/software.html): Source: vtk-5.4.2.zip (Don't use the windows installer, because then you can't use Python.)
Then follow these steps:
1. Open the Cmake 2.6 GUI, and type in the path for the source file, and also where you would like to store the binary files.
Source: C:/Qt/vtk-5.4.2 (I have unzipped the source file into this directory called vtk-5.4.2, which is in my 'Qt' folder. Type in the path for your source file.)
Binary: C:/Qt/VTKbin7 (This is an empty folder, into which Cmake will put binaries.)
>Configure
>Choose Visual Studio 8 2005 as generator
>Configure
>Generate
2. Open Visual Studio;
Open File;
Find the folder where Cmake has put your binaries. E.g. C:/Qt/VTKbin7
Open VTK.sln
3. >Build >Configuration Manager >Active solution configuration
>Choose ‘Release’
>Ok
4. >Build
>Build Solution
This will take more than an hour.
5. Now you should be able to find ‘vtkpython.exe’ in your bin/release file. E.g. C:/Qt/VTKbin7/bin/release
Now go to Embedding VTK into a PyQt GUI
Jun 3, 2009
Python (PyQt)
Situation: I wanted to open a file for reading, then write at a certain place in the file.
Problem: Couldn't read and write even with
Solution: After reading, can't simply do f.write.
Instead,
f.seek(
then,
f.write('My writing')
Feb 5, 2009
Page_Load
Page_Load was not working.
Solution:
http://www.codeverge.net/ng.asp-net-forum.visual_studio_2005/page_load-is-not-called
Make sure that AutoEventWireup="true" in the page directive. This means that I do not have to add handles to my sub. More info in the link.
<%@ Page Language="VB" AutoEventWireup="true"
%>