Training, Open Source computer languages

This is page http://www.wellho.net/forum/Programm ... -Ruby/fancy-code-reviewing-some-python.html

Our email: info@wellho.net • Phone: 01144 1225 708225

 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
fancy code reviewing some python ?

Posted by spuddy (Jon Johnson), 1 March 2005
I am developing a utility which will be put out under GPL to take an SPSS (a widely used stats package) data file and produce XML and some  other outputs There are a number of bits of software which do this already, but they all suffer from limitations and require all sorts of hacks and mucking about and none are as comprehensive as this is going to be (even if it kills me) So I thought I'd do it properly

The data file consists of
1. a header which contains a schema describing the data
2. the data itself

The file is in a rather odd format to me, although it may be familiar to FORTRAN programmers (SPSS is written in FORTRAN)

It also uses a variant of base 30 to encode all numbers,
0=0
1=1
..
9=9
A=10
B=11
..
S=28
T=29
10=30
1T=59
21=61

80 chars wide
it is sort of / delimited, except where there are strings which have the length of the string before the /
e.g.
21/Description of column7/another/99/abcdefghi/
becomes
Description of column
another
9
abcdefghi

I put the schema into a structure and then add data to each element of the structure

I am reasonably happy with the code, but being the lone (Python) coder here I lack feekback and would appreciate any comments

I have used Mertz' state machine pattern to drive the code
it is only 400 lines or so for the main code and you'll get properly credited when i release it.

If you're interested please get in touch at
jj@cls.ioe.ac.uk

cheers

Jon


Posted by admin (Graham Ellis), 2 March 2005
Jon,   I fancy reviewing the code but I don't have enough hours in the day to do everything I fancy.  You're welcome to get in touch further (by personal message on this board or by email) if you would like to send me a copy ... I can promise you up to half an hour within the next 2 weeks to look at it.

Posted by rob_cowie (rob_cowie), 13 April 2005
Hi,

I'm a Python newbie but I'd love to have a look at your code...more for my benefit really.

I want to create a quick script to parse an SPSS datafile, locate a field called PCODE and remove all spaces in it's string.

I assume this can be accomplished in SPSS but I can't find where... and the python script might take me less time than fumbling around SPSS in the dark.

Cheers,

Rob Cowie



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho