Running Sum script

2009-09-04 Thread Jul
hello, I have a .txt file that is in this format -- 12625 17000 12000 14500 17000 12000 17000 14500 14500 12000 ...and so on... i need to create a python script that will open this file and have a running sum until the end of file. it sounds really simple its just for some reason i am having

Re: Running Sum script

2009-09-04 Thread David Smith
Jul wrote: hello, I have a .txt file that is in this format -- 12625 17000 12000 14500 17000 12000 17000 14500 14500 12000 ...and so on... i need to create a python script that will open this file and have a running sum until the end of file. it sounds really simple its

Re: Running Sum script

2009-09-04 Thread Stephen Fairchild
Jul wrote: hello, I have a .txt file that is in this format -- 12625 17000 12000 14500 17000 12000 17000 14500 14500 12000 ...and so on... i need to create a python script that will open this file and have a running sum until the end of file. Untested: with

Re: Running Sum script

2009-09-04 Thread Jul
On Sep 4, 2:21 pm, Stephen Fairchild someb...@somewhere.com wrote: Jul wrote: hello, I have a .txt file that is in this format -- 12625 17000 12000 14500 17000 12000 17000 14500 14500 12000 ...and so on... i need to create a python script that will open this file

Re: Running Sum script

2009-09-04 Thread David Smith
Jul wrote: On Sep 4, 2:21 pm, Stephen Fairchild someb...@somewhere.com wrote: Jul wrote: hello, I have a .txt file that is in this format -- 12625 17000 12000 14500 17000 12000 17000 14500 14500 12000 ...and so on... i need to create a python script that will open this file and

Re: Running Sum script

2009-09-04 Thread Rami Chowdhury
Could you let us know what kind of error you are getting? I don't know if this is your error, but this line won't run: readData = formisanoOpen.readLines() Since Python is case-sensitive, you would need a lower-case 'l' in 'readlines()' -- perhaps that would solve your problem? On Fri,

Re: Running Sum script

2009-09-04 Thread Juli Dolzhenko
On Sep 4, 2:52 pm, Rami Chowdhury rami.chowdh...@gmail.com wrote: Could you let us know what kind of error you are getting? I don't know if this is your error, but this line won't run: readData = formisanoOpen.readLines() Since Python is case-sensitive, you would need a lower-case 'l' in

Re: Running Sum script

2009-09-04 Thread Tobiah
in the terminal i get a very strange permission denied error that might not have anything to do with the code. I checked permissions for the file and they are set to read and write so, again, I am really not sure what going wrong. Try: python myfile Or chmod +x myfile

Re: Running Sum script

2009-09-04 Thread Maggie
On Sep 4, 4:37 pm, Tobiah t...@tobiah.org wrote: in the terminal i get a very strange permission denied error that might not have anything to do with the code. I checked permissions for the file and they are set to read and write so, again, I am really not sure what going wrong. Try:

Re: Running Sum script

2009-09-04 Thread Rami Chowdhury
try it where? code or terminal? Please try these in the terminal -- the permission denied error may be due to your shell not being able to execute the Python script, instead of your Python script not being able to open the data file. On Fri, 04 Sep 2009 13:37:10 -0700, Maggie

Re: Running Sum script

2009-09-04 Thread
On Sep 4, 4:37 pm, Maggie la.f...@gmail.com wrote: On Sep 4, 4:37 pm, Tobiah t...@tobiah.org wrote: in the terminal i get a very strange permission denied error that might not have anything to do with the code. I checked permissions for the file and they are set to read and write so,

Re: Running Sum script

2009-09-04 Thread Chris Rebert
On Fri, Sep 4, 2009 at 1:49 PM, juli.dolzhe...@gmail.com wrote: On Sep 4, 4:37 pm, Maggie la.f...@gmail.com wrote: On Sep 4, 4:37 pm, Tobiah t...@tobiah.org wrote: in the terminal i get a very strange permission denied error that might not have anything to do with the code. I checked