Skip to content

Instantly share code, notes, and snippets.

@mkowoods
Created October 19, 2014 01:17
Show Gist options
  • Save mkowoods/9e0fccf77df3c1161d2f to your computer and use it in GitHub Desktop.
Save mkowoods/9e0fccf77df3c1161d2f to your computer and use it in GitHub Desktop.
Tkinter File Dialog
from Tkinter import *
import tkFileDialog
root = Tk()
root.withdraw()
inputfile = tkFileDialog.askopenfilename(initialdir = 'C:\\', title = "Select Quote File", filetypes = [('csv files', '.csv')])
print inputfile
import csv
if inputfile:
with open(inputfile, 'rb') as f:
for line in csv.reader(f):
print line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment