I am new to python but not to programming. I have a very simple problem that I can't seem to workout in python. With other programming languages it is simple but python INSISTS on making it complicated.

The first section of the code defines an empty array (or in python, a list) called timestep. The code then opens a comma delimited text file with input acceleration time histories (first column is time and the following columns are accelerations). The code then appends the values in the first column of the .csv file line-by-line to the list 'timestep'. NOTE: I AM VERY NEW TO PYTHON SO ANY HELP OR ADVISE ON WHAT I CURRENTLY HAVE WOULD BE SUPER, I LOVE TO LEARN .

Later in the code i need to use elements within the timestep list in a formula (complex fourier transform). In other programming languages this is SIMPLE (for example in VBA....... timestep(n)*1000 would give me the value of the nth timestep element multiplied by 1000. However......python does not seem to think like this.

Consider timestep(n) = 0.005. Instead of giving me the value of timestep(n) multiplied by 1000 which I would expect to give me 5, it gives me 0.0050.005

I suspect this is something to do with python reading the list as a script? I'm really really trying to enjoy python but so far it seems to throw convention out the window and is beginning to grind me down please can someone help and shed light on this.......and please don't mention the word 'tuple'.......seriously.....'TUPLE'....what were they thinking? Haha

Thank you stranac. Yes, yes i know, everyone that does programming seems to look upon VBA as inferior but it has its place . I'm a civil engineer and almost all the data manipulation is carried out in excel because its so widely used so creating macros is very easy to do. Plus I find excel reads like a flowing story, I can return to a code from last year and read it like a book.

I do agree with you though....I might have jumped the gun using the word convention haha.

I think Python might seem strange in terms of OOP in a few ways (duck typing, no nice way to specify interface without implementation) especially if you're used to Java (which encourages a "Main" object; wtf is a "Main"?) but otherwise I'm very curious what conventions you're referring to.

Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.