0

I have sublime text 3 but whilst my simple test code (below) is working in PowerShell it does not in sublime.

Is there a reason for this / how do I fix this? (I have updated the path files)

import csv

with open('example.csv') as f:
    r = csv.reader(f, delimiter=',')

    dates = []
    colors = []

    for row in r:
        color = row[3]
        date = row[0]

        dates.append(date)
        colors.append(color)

    print (dates)
    print (colors)

    whatColor = input('What color do you wish to know the date of?')
    coldex = colors.index(whatColor)

    theDate = dates[coldex]

    print('The date of',whatColor,'is the date')        

In PowerShell I get:

['01/02/2014', '01/03/2014', '01/04/2014']

['red', 'green', 'blue']

What color do you wish to know the date of?green

The date of green is the date

but in the sublime console I get:

['01/02/2014', '01/03/2014', '01/04/2014']
['red', 'green', 'blue']
What color do you wish to know the date of?Traceback (most recent call last):
  File "C:\Users\ben\five\pl_pl.py", line 19, in <module>
    whatColor = input('What color do you wish to know the date of?')
EOFError: EOF when reading a line
[Finished in 0.3s]
Jaqueline Vanek
  • 1,100
  • 10
  • 20
beng986
  • 71
  • 1
  • 1
  • 8

0 Answers0