1

I was wondering how I would go about allowing and prompting the user with a dialog box that allows for them to choose any csv file from any directory and being able to read that csv file?

wellthen
  • 19
  • 1
  • 6
  • You'll need a GUI library, like Qt or Tkinter – ForceBru May 08 '20 at 14:23
  • Here the solution , kindly check it , [External Reference](https://stackoverflow.com/questions/40893894/opening-and-reading-a-csv-file-using-read-csv-from-tkinter-gui) – Uday May 08 '20 at 14:29

1 Answers1

2

Are you not using any GUI library? You'll need one for a "dialogue box" to prompt the user. Unless you just want them to enter filepaths in the command line as a string.

There's the Tkinter library, which has this function. https://pythonspot.com/tk-file-dialogs/

from tkinter import filedialog


filepath =  filedialog.askopenfilename()
Gavyn
  • 56
  • 6