Converting a string (with scientific notation) to an int in Python
<p>I'm trying to convert a set of strings from a txt file into int's within a list. I was able to find a nice snippet of code that returns each line and then I proceeded to try and convert it to an int. The problem is that the numbers are in scientific notation and I get this error: ValueError: invalid literal for int() with base 10: '3.404788e-001'.</p>

<p>This is the code I've been messing around with</p>

<pre><code>data = []
rawText = open ("data.txt","r")

for line in rawText.readlines():
    for i in line.split():
        data.append(int(i))

print data[1]
rawText.close()
</code></pre>
