Quantcast
Channel: SaltyCrane: python
Browsing all 169 articles
Browse latest View live

QTableWidget Example using Python 2.4, QT 4.1.4, and PyQt

QTableWidget Example using Python 2.4, QT 4.1.4, and PyQt import sys from Qt import * lista = ['aa', 'ab', 'ac'] listb = ['ba', 'bb', 'bc'] listc = ['ca', 'cb', 'cc'] mystruct = {'A':lista, 'B':listb,...

View Article



Larger python qt pyqt example

This script is used to parse Windows Event Viewer logs. It uses dumpel.exe. It colors significant events and presents results in a QT GUI. """windows_audit.py """ __author__ = "So Feng" __version__ =...

View Article

Image may be NSFW.
Clik here to view.

Example pie charts using python and matplotlib

I needed to make some pie charts and didn't like the results I got from Excel. It was too hard to customize the plots exactly the way I wanted them. I have used Matlab before and I preferred Matlab to...

View Article

How to draw an arrow with matplotlib and python

Here is an example of how to draw an arrow with matplotlib. It should bevery easy, but I had to change the width setting so the arrow head wouldnot be too small. Further documentation is...

View Article

How to create some derived arrow classes with matplotlib and python

Here is an example of how to create some derived arrow classes with matplotlib and python. The arrow() function in matplotlib accepts origin and delta x and delta y inputs. I changed this to polor...

View Article


How to use the pylab API vs. the matplotlib API

This article has a good description of the 2 API's in matplotlib: the pylab API and the matplotlib API. I've been using the pylab interface because it is easier, especially coming from a matlab...

View Article

How to draw a simple line using python and the matplotlib API -

I'm continuing to learn the low level object oriented matplotlib API. My goal is to create very customizable, perfect plots. Here is how to draw a simple line. First create a figure that is 4 inches by...

View Article

How to install Easy Install for Python

Update 2009-03-31:For current installation instructions on Windows and Cygwin, seehttp://pypi.python.org/pypi/setuptools.For a better alternative to Easy Install, see pip by Ian BickingHow to install...

View Article


How to install PyQt 4.3 and Python 2.5 on Windows

Update 1/10/2008: PyQt has made the install process a lot simpler because it has bundled everything you need in one installer including QT 4.3 open source edition. Now all you need to do is install...

View Article


PyQt4 Examples

PyQt is the best GUI toolkit for Python. Here are some examples and notes I am in the process of collecting.There is a good collection of tutorials and examples included with the PyQt 4 installation....

View Article

Eclipse/Pydev "Execption occurred executing command line" error

Eclipse 3.2, PyDev 1.2.5 error:Execption occurred executing command line.There is a problem with your Python interpreter. To fix, go to "Window", "Preferences", "Pydev", "Interpreter - Python", and...

View Article

How to use python and popen4 to capture stdout and stderr from a command

You can use popen to capture stdout from a command:import osstdout = os.popen("dir asdkfhqweiory")print stdout.read()And your output will be something like:>>> ================================...

View Article

Python os.walk example

Here is a simple os.walk() example which walks your directory tree and returns the path, a list of directories, and a list of files:import os path = "c:\\python25" i = 0 for (path, dirs, files) in...

View Article


PyQt 4.2 QAbstractTableModel/QTableView Example

from PyQt4.QtCore import * from PyQt4.QtGui import * import sys my_array = [['00','01','02'], ['10','11','12'], ['20','21','22']] def main(): app = QApplication(sys.argv) w = MyWindow() w.show()...

View Article

More example code for PyQt 4.2

Here is some more example code for PyQt 4.2.################################################################ ################################################################ def main(): app =...

View Article


"Pydev code completion: rebuilding modules" error

This error took me a while to find a solution. I got the following error message when I tried to change the python interpreter in pydev: "An internal error occurred during: "Pydev code completion:...

View Article

How to get code completion for PyQt using Pydev

Because PyQt doesn't come with the .py source files which Pydev needs for code completion, you need to add the PyQt modules as a "forced builtin lib". See the following FAQs at the pydev website:...

View Article


More PyQt example code

Here is some more PyQt example code.################################################################ def main(): app = QApplication(sys.argv) mw = MainWindow() sys.exit(app.exec_())...

View Article

My software tools list

td { vertical-align: top; }Inspired by Mark Pilgrim's 2006 Essentials list, below is a list of my current software tools. If you notice a lot of "I switched from ..." statements, keep in mind that I...

View Article

backing up with rsync

Here is a python script using rsync to backup my Users directory in Vista to an external hard drive.import os cmd = "rsync -avz --exclude '/AppData/'" + \ "/cygdrive/c/Users/saltycrane" + \...

View Article
Browsing all 169 articles
Browse latest View live




Latest Images