Re: [dabo-users] Writing Records to a File

2007-09-24 Thread Uwe Grauer
bsnipes wrote: > > > Jeff Johnson-8 wrote: >> f = open('text.txt', 'w') >> > > You might want to change the 'w' to 'wb'. My understanding is that Python > will add a line ending automatically to the output that it writes to the > file if not using 'write binary' and that might throw off what yo

Re: [dabo-users] Writing Records to a File

2007-09-24 Thread Ed Leafe
On Sep 23, 2007, at 5:15 PM, Jeff Johnson wrote: > The problem I am having is that when I convert the list back into a > string to write it to a file, I am trying to write a record of data > with > a new line at the end. My string looks sort of like this: > > "'field','field','\n','field','fiel

Re: [dabo-users] Writing Records to a File

2007-09-24 Thread Jeff Johnson
Ed: The list looks like: ['field', 'field', '\n', 'field', 'field'] There are a fixed number of fields per record. I am inserting the '\n' into the list at the end of records prior to converting the list back to a string for writing. Jeff Jeff Johnson [EMAIL PROTECTED] SanDC, Inc. 623-582-0

Re: [dabo-users] Writing Records to a File

2007-09-24 Thread Ed Leafe
On Sep 24, 2007, at 9:37 AM, Jeff Johnson wrote: > ['field', 'field', '\n', 'field', 'field'] > > There are a fixed number of fields per record. I am inserting the > '\n' > into the list at the end of records prior to converting the list > back to > a string for writing. OK, so at so

Re: [dabo-users] Writing Records to a File

2007-09-24 Thread bsnipes
Uwe Grauer-5 wrote: > > python doesn't add a line ending on it's own with f.write()! > If you use > print "something" > python adds a line ending but not with write. > That must have been what I was doing when I hit the issue of extra lines in my output. Sorry for the added confusion! Brian

Re: [dabo-users] Writing Records to a File

2007-09-24 Thread Jeff Johnson
Ed: You are correct. My list has only the data and I am trying to write it as a string to a file with a new line at the end of each record. Each record has the same number of fields. The list works great for me because I mentioned that the text file I start with is a mess. Data is delimited

Re: [dabo-users] Writing Records to a File

2007-09-24 Thread Ed Leafe
On Sep 24, 2007, at 10:33 AM, Jeff Johnson wrote: Ed: You are correct. My list has only the data and I am trying to write it as a string to a file with a new line at the end of each record. Each record has the same number of fields. OK, I'm going to take the Dive Into Python approach, a

Re: [dabo-users] TIF image viewing

2007-09-24 Thread bsnipes
Ed Leafe wrote: > > I wanted to add some preventative code that would prevent you from > setting PictureIndex to, say, 5, when there were only 2 images in the > file, but that only works for TIFF and ICO, not GIF. I'm still trying > to find a way to do this, but I've posted the chan

Re: [dabo-users] TIF image viewing

2007-09-24 Thread bsnipes
Ed Leafe wrote: > > I wanted to add some preventative code that would prevent you from > setting PictureIndex to, say, 5, when there were only 2 images in the > file, but that only works for TIFF and ICO, not GIF. I'm still trying > Is dImage based on wx.Image? If so, can the GetIm

Re: [dabo-users] Writing Records to a File

2007-09-24 Thread Uwe Grauer
Ed Leafe wrote: ... > There are probably several other ways to accomplish this task; I > chose this one because it's very flexible. Try changing the value of > 'flds' to any other value, and see how the output changes. > I did a quick test. --

Re: [dabo-users] Writing Records to a File

2007-09-24 Thread Jeff Johnson
Ed: I studied the code below until I understood it and then redid my data conversion and it worked perfectly. Thanks for taking the time to help me with this Jeff Jeff Johnson [EMAIL PROTECTED] SanDC, Inc. 623-582-0323 Fax 623-869-0675 Ed Leafe wrote: > On Sep 24, 2007, at 10:33 AM, Jeff

Re: [dabo-users] Writing Records to a File

2007-09-24 Thread Jeff Johnson
Uwe: Thanks for your help also! This process takes a messy flat file, cleans it up and eliminates garbage, then using the algorithm Ed provided, breaks the data into records. The file ends up being over a thousand records with 17 fields per record. Reading the file, processing it and writing

Re: [dabo-users] TIF image viewing

2007-09-24 Thread Ed Leafe
On Sep 24, 2007, at 2:18 PM, bsnipes wrote: > Is dImage based on wx.Image? No, but it does incorporate a wx.Image internally. > If so, can the GetImageCount() be made > available and just let us keep track of it when changing the > PictureIndex? But as I said, it doesn't work

Re: [dabo-users] Writing Records to a File

2007-09-24 Thread Ed Leafe
On Sep 24, 2007, at 2:24 PM, Uwe Grauer wrote: > Plain loops are a lot faster and do not consume such a lot of memory. There are much more efficient ways of writing it, but my goal wasn't to eke out every last bit of performance. This was an instructional reply, and the code was chose

Re: [dabo-users] Writing Records to a File

2007-09-24 Thread Jeff Johnson
Ed: Again I appreciate your taking the time to explain this. What Uwe may not be aware of is that you know very well I can figure out how to do this using algorithms I have learned using other languages - FoxPro comes to mind - but you also know that I am learning Python and your answers to m

[dabo-users] Selecting from bizobj

2007-09-24 Thread lalong1
I need to know the best way to do the following I have 2 biz obj's...Primarybizobj and a Childbizobj. I want a virtual field on the Primary which calcuates a value based on the Childbizobj. Something like Primarybizobj.lastvalue, where lastvalue='select sum(field) from ChildBizobj' I know how t

Re: [dabo-users] TIF image viewing

2007-09-24 Thread bsnipes
Ed Leafe wrote: > >> If so, can the GetImageCount() be made >> available and just let us keep track of it when changing the >> PictureIndex? > > But as I said, it doesn't work for GIF. If someone is using a GIF, > GetImageCount() always returns 1. > I didn't realize that the GetIma

Re: [dabo-users] Selecting from bizobj

2007-09-24 Thread lalong1
Pls disregard. I found a way to do what I need. Thx -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, September 24, 2007 3:47 PM To: 'Dabo Users list' Subject: [dabo-users] Selecting from bizobj I need to know the best way

[dabo-users] Hello

2007-09-24 Thread Paul McNett
Happy Monday! (this was a test) -- pkm ~ http://paulmcnett.com ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This mes

Re: [dabo-users] Hello

2007-09-24 Thread Paul McNett
Paul McNett wrote: > Happy Monday! > > (this was a test) (and the test succeeded). -- pkm ~ http://paulmcnett.com ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: