I've inherited a BASIC script, and I'm trying to rewrite it into Python. I don't know BASIC, or even which version of BASIC this is. Is it Visual Basic? Please help me translate this block of code.
'County Number, District Number, District Name
j = 0
OPEN "" + year.base$ + "dist.csv" FOR INPUT AS #1
INPUT #1, a0$, a1$, a2$, a3$, a4$, a5$, a6$, a7$
DO WHILE NOT EOF(1)
j = j + 1
INPUT #1, a0$, a1$, a2$, a3$, a4$, a5$, a6$, a7$
conumbind(j) = VAL(a0$)
distnumbind(j) = VAL(a1$)
distnameind$(j) = a2$
rate2(j) = VAL(a3$)
rate34(j) = rate2(j) * 2
LOOP
CLOSE #1
iTotal2 = j
Hello this is QBASIC a DOS based language. QBasic on Wikipedia What this code does is to open a text file, in this case a comma separated values files. Each INPUT #1 sentence will fetch one line of the file and assign the values to the string variables (the ones that end in $ character are string variables). Then it will fill some unidimensional arrays with those values. iTotal2 will be the number of records in the file. The code does practically nothing, since once the arrays are filled, they are not used.