I'm trying to use Python's easygui module to select a file and then insert it's name into a program I wrote (see code below). So I want to insert filename 1 and 2 where it says insert filename1, etc.. Any help would be greatly appreciated. Thanks!
import easygui
import csv
msg='none'
title='select a 90m distance csv file'
filetypes=['*.csv']
default='*'
filename1= easygui.fileopenbox()
filename2= easygui.fileopenbox()
dist90m_GIS_filename=(open('**insert filename1'**,'rb'))
datafile_filename=(open(**insert filename2'**,'rb'))
GIS_FH=csv.reader(dist90m_GIS_filename)
DF_FH=csv.reader(datafile_filename)
dist90m=[]
for line in GIS_FH:
dist90m.append(line[3])
data1=[]
data2=[]
for line in DF_FH:
data1.append(','.join(line[0:57]))
data2.append(','.join(line[58:63]))
outfile=(open('X:\\herring_schools\\python_tests\\excel_test_out.csv','w'))
i=0
for row in data1:
row=row+','+dist90m[i]+','+data2[i]+'\n'
outfile.write(row)
i=i+1
outfile.close()