Re: Simple Text Processing

2009-09-10 Thread AJAskey
= "this is a line" print line a = line.split() print a print a[0] print a[1] print a[2] print a[3] -- OUTPUT: this is a line ['this', 'is', 'a', 'line'] this is a line On Sep 10, 11:36 am, AJAskey wrote: > New to Python.  I can solve

Simple Text Processing

2009-09-10 Thread AJAskey
New to Python. I can solve the problem in perl by using "split()" to an array. Can't figure it out in Python. I'm reading variable lines of text. I want to use the first number I find. The problem is the lines are variable. Input example: this is a number: 1 here are some numbers 1 2 3 4