Wednesday, February 21, 2007

Python


Python homepage/download
Python Learning Foundation
wxPython
Useless Python

GUI

Install for python version:

Import system objects

import glob
import os

Import MS Windows and Excel objects

from win32com.client import Dispatch ## Import win32 objects
xl = Dispatch('Excel.Application') ## define Excel file type

Using Dispatch

xl.Workbooks.Open(workbook) ## Open workbook
xlSheet = xl.Sheets(sheet) ## Open sheet
celldata = xlSheet.Cells(rowNum, colNum).Value ## Read value from a cell
xlSheet.Cells(rowNum, colNum).Value = newvalue ## Write a value to a cell
sleep(10) ## Give it a chance before closing the workbook
xl.Workbooks.Close()

XML

XML for Py tutorial

import xml.sax
import xml.parsers.expat
From ArcGIS page:
An ArcXML DTD. An XML Data Type Definition (DTD) is available for use with ArcXML 1.1. This DTD defines the structure rules for the elements and attributes in ArcXML and checks for document validity. The DTD can be used with many XML editors, but since ArcIMS requires UTF-8 encoding, editors that support UTF-8 encoding are recommended. The following two editors support UTF-8 encoding:

XML Spy: http://www.xmlspy.com
Xeena: http://alphaworks.ibm.com/tech/xeena

Basic guide to arcXML

Wrappers for other languages/API's

Try SWIG or Sip to make wrappers for C

No comments: