Re: Ensure a variable is divisible by 4

2006-12-05 Thread geskerrett
Nick Craig-Wood wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I am sure this is a basic math issue, but is there a better way to > > ensure an int variable is divisible by 4 than by doing the following; > > > > x = 111 > > x = (x /4) * 4 > > You should use // for future compatibilit

Ensure a variable is divisible by 4

2006-12-04 Thread geskerrett
I am sure this is a basic math issue, but is there a better way to ensure an int variable is divisible by 4 than by doing the following; x = 111 x = (x /4) * 4 Just seems a bit clunky to me. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using win32gui.SendMessage and SysListView32 control

2006-12-04 Thread geskerrett
Thanks for your help. I will check them out. -- http://mail.python.org/mailman/listinfo/python-list

Using win32gui.SendMessage and SysListView32 control

2006-12-03 Thread geskerrett
Hope someone can steer me in the right direction. I am trying to use python to collect the values from a Win32 application's control. I can successfull query an retreive the values ListBox, Edit and Buttons, however, the application uses a control called a 'SysListView32' Control. MSDN says that

Reading text labels from a Win32 window

2006-11-28 Thread geskerrett
Does anyone know of a way to read text labels from a Win32 application. I am familiar with using pywin32 and the SendMessage function to capture text from Buttons,text boxex, comboboxes, etc, however, the text I am would like to capture doesn't appear to be in a control. -- http://mail.python.org

Re: struggling with memory release using ctypes wrapper

2006-11-08 Thread geskerrett
Oops, found the problem in my code. Sorry for wasting peoples time if you're viewing. -- http://mail.python.org/mailman/listinfo/python-list

struggling with memory release using ctypes wrapper

2006-11-07 Thread geskerrett
I was wondering if a ctypes expert could point me in the right direction. I am using the wrapper for the "freeimage" library to create multipage TIFF files from a group of png images. The images load and save fine, the problem seems to be that the memory used during the bitmap creation isn't bein

FreeImagePy creating thumbnails from TIFF

2006-10-23 Thread geskerrett
I a trying to create a series of thumbnail images from a multpage TIFF file. The sample code is below. When it executes, we get the following error; FreeImagePy.constants.FreeImagePy_ColorWrong: 'Wrong color 1 in function: FreeImage_MakeThumbnail. I can use: (8, 24, 32)' Any suggestions? fname

Re: ADO with Python

2006-10-17 Thread geskerrett
Ralf wrote: > Is their anybody with xperience in using the both and can provide me with > some xamples. > > Thx a lot > Ralf I found the tutorial on this site helpful. http://www.mayukhbose.com/python/ado/index.php -- http://mail.python.org/mailman/listinfo/python-list

Event notification system - where to start ?

2006-06-29 Thread geskerrett
We have been asked to develop and application for a client that is a 'notification" system. We would like to use python, but are struggling to find the right starting point. Any suggestions, tips or sample code would be appreciated. Application outline; Machine A is running a "listener" applica

Re: "groupby" is brilliant!

2006-06-13 Thread geskerrett
Frank; I would just like to thank-you for this timely post. I am working on a reporting project that needed "groupby" functionality and I was going to sit down this morning to rework some "very ugly code" into some "not quite so ugly code". Your post got me pointed to in the "right" direction and

Re: Inserting Records into SQL Server - is there a faster interface than ADO

2005-11-14 Thread geskerrett
The utility is designed to run in the background and maintain/update a parallel copy of a production system database. We are using the stored procedure to do a If Exist, update, else Insert processing for each record. The originating database is a series of keyed ISAM files. So we need to read

Inserting Records into SQL Server - is there a faster interface than ADO

2005-11-11 Thread geskerrett
I have a program that reads records from a binary file and loads them into an MS-SQL Server database. It is using a stored proc, passing the parameters. I am using pywin32 to create a connection object. Once the connection is open I simple pass the SQL formatted commands using cnx.Execute(sqlstr

Re: Converting from Microsoft Binary Format floats to Python Float

2005-08-28 Thread geskerrett
Well, thank-you again. It's a bit embarassing, but you are correct ... It was a typo on in the sample data. A bit frustrated with myself as I checked, and double checked, but I guess became a bit blinded to the problem. Sorry to waste your time, and appreciate your assistance and patience. Geoff

Converting from Microsoft Binary Format floats to Python Float

2005-08-26 Thread geskerrett
In the '80's, Microsoft had a proprietary binary structure to handle floating point numbers, In a previous thread, Bengt Richter posted some example code in how to convert these to python floats; http://groups.google.com/group/comp.lang.python/browse_thread/thread/42150ccc20a1d8d5/4aadc71be8aeddb

Re: Anyone recognize this numeric storage format - similar to "float", but not quite

2005-08-25 Thread geskerrett
I am not sure if you are still watching this thread, but I seem to have a bit of a problem with the code sample you so graciously provided. It seems to work in all instances, except the original example I provided (namely, 1234567890). On my system, the number 1234567890, gets converted to 12345678

Re: Anyone recognize this numeric storage format - similar to "float", but not quite

2005-08-24 Thread geskerrett
Thanks Bengt for directing me to your previous post. I think I agree with you on the "reversing bit" and the constant MSB. In reworking my examples I was always changing the 0 to 1. -- http://mail.python.org/mailman/listinfo/python-list

Anyone recognize this numeric storage format - similar to "float", but not quite

2005-08-23 Thread geskerrett
We are working on a project to decipher a record structure of an old accounting system that originates from the late80's mid-90's. We have come across a number format that appears to be a "float" but doesn't match any of the more standard implementations. so we are hoping this is a recognizable num

Re: Does any one recognize this binary data storage format

2005-08-10 Thread geskerrett
Thanks again. Sort of thru me off, but is working perfectly now. -- http://mail.python.org/mailman/listinfo/python-list

Re: Does any one recognize this binary data storage format

2005-08-10 Thread geskerrett
Thanks so much for this. It is exactly what I was looking for. If I am simply reading the bytes from disk, would I still need to convert the these values HEX characters first with Hexlify, or is there a more direct route ? ie. convert them to the double float directly from the byte values ? --

Re: Does any one recognize this binary data storage format

2005-08-09 Thread geskerrett
Yes I double checked as I appreciate any help, but that is what is stored on disk. If it helps, we modified Ex#3. to be 777-777- On disk this is now 00 00 10 87 77 F9 Fc 41 All the input fields are filled in this new example. -- http://mail.python.org/mailman/listinfo/python-list

Re: Does any one recognize this binary data storage format

2005-08-09 Thread geskerrett
You are correct, that was a typo. the second example should end in F441. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Does any one recognize this binary data storage format

2005-08-09 Thread geskerrett
the extension on the files is *.mas but I a pretty sure it is not relevant. I beleive it used by the application. I can posted records as it will take up to much space. But all three phone numbers are stored in 8 bytes with null bytes (ie. 00) stored in the leading positions (ie. the left hand si

Does any one recognize this binary data storage format

2005-08-09 Thread geskerrett
I am hoping someone can help me solve a bit of a puzzle. We are working on a data file reader and extraction tool for an old MS-DOS accounting system dating back to the mid 80's. In the data files, the text information is stored in clearly readable ASCII text, so I am comfortable that this file i

Recommendations for CVS systems

2005-08-09 Thread geskerrett
I was wondering if anyone could make recomendations/comments about CVS systems, their experiences and what perhaps the strengths of each. Currently we have 2 developers but expect to grow to perhaps 5. Most of the developement is Python, but some C, Javascript, HTML, etc. The IDE what have been

Re: Python for embedded linux?

2005-08-03 Thread geskerrett
I think this is what you are looking for. http://www.voidspace.org.uk/python/movpy/ -- http://mail.python.org/mailman/listinfo/python-list