list reversal error

2016-03-03 Thread vlyamtsev
i have list of strings "data" and i am trying to build reverse list data1 data1 = [] for i in range(len(data)): j = len(data) - i data1.append(data[j]) but i have the following error: data1.append(data[j]) IndexError: list index out of range am i doing it wrong? Thanks -- https://mail.pyt

function inclusion problem

2015-02-10 Thread vlyamtsev
I defined function Fatalln in "mydef.py" and it works fine if i call it from "mydef.py", but when i try to call it from "test.py" in the same folder: import mydef ... Fatalln "my test" i have NameError: name 'Fatalln' is not defined I also tried include('mydef.py') with the same result... What is