Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy Does This Program Run on Linux Python Shell But Not on Windows?
    primarykey
    data
    text
    <p>I ran this program on Linux with Python 2.6.2 and it ran fine returning me with decimal values but when I run it on Python 2.7.2 on Windows it does not work and just gives a blank space for a while and then a memory error but I can't figure out why..I need it to run on Windows its a program to calculate stock equity (ROE). Thanks.</p> <p>The CSV file needed to run the program is <a href="http://www.cse.msu.edu/~cse231/Projects/proj05.dir/SBUX.csv" rel="nofollow">here</a>. .</p> <pre><code>import csv csvname = raw_input("Enter csv name: ") sbuxfile = csv.reader(open(csvname), delimiter=',', quotechar='|') # List of Data row5, row8, row3, row7, avgequity, roe1, roe2 = ([] for i in range(7)) count = 0 # Grab data and numerical values from CSV. for row in sbuxfile: count += 1 if count == 8: row8 = row elif count == 5: row5 = row elif count == 3: row3 = row elif count == 7: row7 = row a = 1 # Perform calculations for average equity and ROE. while a &lt; 8 : if a == 1: avgequity.append(round(float(row8[a]),2)) roe1.append(float(row5[a]) / float(row8[a])) roe2.append((float(row5[a]) / float(row3[a])) * (float(row3[a]) / float(row7[a])) * (float(row7[a]) / float(row8[a]))) else: avgequity.append(round(float((row8[a]),2) + float(row8[a-1]))/2) roe1.append(float(row5[a]) / float(row8[a])) roe2.append((float(row5[a]) / float(row3[a])) * (float(row3[a]) / float(row7[a])) * (float(row7[a]) / ((float(row8[a]) + float(row8[a-1]))/2))) a+=1 print "\nAverage equity is " + str(avgequity) + "\n" print "ROE method 1 is " + str(roe1) + "\n" print "ROE method 2 is " + str(roe2) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload