Writing Error in program

2007-11-20 Thread koutoo
I have a code that writes to 2 seperate files. I keep getting a list index out of range error. The strange part is that when checking the files that I'm writing too, the script has already iterated through and finished writing, yet the error stated implies that it hasn't? So how can it be, that

display messages in python shell

2007-11-19 Thread koutoo
Is it possible to display messages in the python shell? I want to display error messages based on parameters in my scripts to the users. Is there another way to display messages other than log files? Thanks. Kou -- http://mail.python.org/mailman/listinfo/python-list

Delete spaces

2007-09-28 Thread koutoo
If I have a text file that is delimited by spaces, how do I import it and get to comma delimited? Here is a row of data from the text file: 1110:55:14 265 8.5 1.4+1.1 2.5 Class-2 0 I tried a few examples from the group and it didn't work, since the

True of False

2007-09-27 Thread koutoo
I tried writing a true and false If statement and didn't get anything? I read some previous posts, but I must be missing something. I just tried something easy: a = [a, b, c, d, e, f] if c in a == True: Print Yes When I run this, it runs, but nothing prints. What am I doing wrong?

Delete values from a string using the index

2007-09-26 Thread koutoo
How do I delete or remove values from a list or string using the index. If a = [1,2,3,4,5,6,7,8] and I want to get rid of 1 -5, how would I do that? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Nested For and While Statements

2007-09-24 Thread koutoo
I start my code with some constants then a while statement. But I have some For statements towards the end within the While statement where I start getting some errors. I'm hoping I won't have to post my code, but it looks something like this: Import os, string while this: All Code

Re: Nested For and While Statements

2007-09-24 Thread koutoo
On Sep 24, 3:01 pm, Paul McGuire [EMAIL PROTECTED] wrote: On Sep 24, 2:28 pm, [EMAIL PROTECTED] wrote: I start my code with some constants then a while statement. But I have some For statements towards the end within the While statement where I start getting some errors. I'm hoping I

Re: Nested For and While Statements

2007-09-24 Thread koutoo
On Sep 24, 3:44 pm, Roberto Bonvallet [EMAIL PROTECTED] wrote: On Sep 24, 3:28 pm, [EMAIL PROTECTED] wrote: [...] where I start getting some errors. I'm hoping I won't have to post my code Doctor, I'm feeling bad. I hope I won't have to tell you my symptoms. What do I have? Please

Lookup values from one table to another based on a value

2007-09-20 Thread koutoo
If I wanted to accomplish looking up values from one table based on a value from another table or file, how would I go about doing this in Python? Would I build a dictionary or an array? exp: Table1: Site = 103 Lane = 2 Dir = ? # Get this from Table2 Table2: Site, Lane, Direction, 103, 1, 1

Re: Lookup values from one table to another based on a value

2007-09-20 Thread koutoo
On Sep 20, 10:34 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : If I wanted to accomplish looking up values from one table based on a value from another table or file, how would I go about doing this in Python? Would I build a dictionary or an

Re: Lookup values from one table to another based on a value

2007-09-20 Thread koutoo
On Sep 20, 11:51 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : On Sep 20, 10:34 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : (snip) Normally in Access I would just use a Dlookup and be done with it, or use a

Newbie question

2007-09-18 Thread koutoo
If I have a file name: AVC1030708.14. How do I strip out certain characters from the file name? I am so used to using MID, LEFT, and RIGHT functions, that I have no idea how to do this in python? I have had trouble as well with most newbies on finding the help. But I have used the command line

Re: Newbie question

2007-09-18 Thread koutoo
On Sep 18, 1:31 pm, Shawn Milochik [EMAIL PROTECTED] wrote: On 9/18/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: If I have a file name: AVC1030708.14. How do I strip out certain characters from the file name? I am so used to using MID, LEFT, and RIGHT functions, that I have no idea how

Re: Newbie question

2007-09-18 Thread koutoo
On Sep 18, 1:42 pm, Shawn Milochik [EMAIL PROTECTED] wrote: On 9/18/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Sep 18, 1:31 pm, Shawn Milochik [EMAIL PROTECTED] wrote: On 9/18/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: If I have a file name: AVC1030708.14. How do I

How do you limit the # of lines Read?

2007-09-18 Thread koutoo
I am working on a loop for my code and was wondering if there is a way to limit the number of lines read through? I'd hate to cut the test file in order to run the code in the testing phase. Can you add a value in the parenthesis of the readline() function? t = string.readline() # Limit this

Use GUI for Python

2007-09-17 Thread koutoo
I am new to python as I have been a VB programmer. I am used to the GUI interface, and was wondering if I had to choose between a GUI for Python, which one should I go with? Thanks. Kou -- http://mail.python.org/mailman/listinfo/python-list