Newsgroups: comp.lang.python
Date: Fri, 22 Aug 2008 07:28:21 -0700 (PDT)
Local: Fri, Aug 22 2008 10:28 am
Subject: Re: need help using enumerate ??
On Aug 22, 7:56 am, Chris <cwi...@gmail.com> wrote:
> On Aug 22, 1:14 pm, "Eric_Dex...@msn.com" <Eric_Dex...@msn.com> wrote: There is a number to be added to the text in that column... That is a > > I am trying to take some data in file that looks like this > > command colnum_1 columnum_2 > > and look for the command and then cange the value in the collum(word) > > import sys > > parse1filerows = [] > > filename = sys.argv[0] > > infile = open(filename, 'r') > Rather confusing code there and non-functional. > You never close your file handles, when finished with a file use the > but rather > if ... in row: > Now, this is how I intepretted your question. > from sys import argv, exit > if len(argv) != 3: > try: > if not argv[2].isdigit(): slight edit though it still needs to be a number > idx = int(argv[2]) > """Assuming your data in the parse file was a set of key, value pairs > """Iterate over your input file, split the line into it's component > inFile.close() > - Show quoted text - to the n'th word (a number) and add another number to it. I may need to do that for up to 5 values in the line (maybe more for cound commands that haven't been thought up yet). I then convert the data back to text. These all point to ftable's when I renumber them i.e. f1 to f3 I have to renumber them in the program file as well. .orc and .sco. If I load in a 5 from the file it means I have to load the data from this is the easy command list I will try to do lists with var number You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||