0

I am creating a program in Python that requires the user to place images into an Input folder, and then take images out of an Output folder. As this will become an application, the Input and Output folders will be very difficult to navigate to, being buried in the app's contents.

I am looking for a way to open folders onscreen so that a user can add or remove their own files from these folders, without knowing the exact location of the folders they are interacting with.

I am thoroughly stumped on this problem, and I appreciate all of your time. Thank you very much.

*Edit: I am working on MacOS

Kiki-Jiki
  • 11
  • 6
  • 1
    I'd suggest that you don't make user upload anything to inner folder, but rather ask user to select files (filedialog in tkinter, QFileDialog in PyQT etc.), then copy that files to inner folder and expose 'download' button that will open another dialog to select desired location folder. When user selects location in dialog, you copy results from inner folder to that location and safely remove both input and output. – STerliakov Jan 05 '22 at 21:00
  • do you want this to work for one operating system (perhaps Microsoft Windows from your description?) or in a generic or per-OS way? – ti7 Jan 05 '22 at 21:04
  • Sorry for not specifying, but I am working on MacOS. It would be nice if it worked on any OS, but working on Mac is the important part. – Kiki-Jiki Jan 05 '22 at 21:49

1 Answers1

1

If the program is intended for use on windows, it seems like you could use the solution here, where you could open explorer as a sub process and then open the path to the file.

For example

import subprocess
subprocess.Popen(r'explorer /select, FilePath')

You could also use os, and os.startfile(FilePath).

Dude923
  • 51
  • 1
  • 4