0

It is possible to choose the exact file within a directory where there are several files? Basically, I want to see the inside of a directory and then import a file (* .stl)

Mike Kinghan
  • 55,740
  • 12
  • 153
  • 182

1 Answers1

0

You can use glob to get a list of files matching a pattern.

import glob
stl_files = glob.glob('*.stl')

If you can expect more than one stl file in a directory you can loop through the file list and import each file, similar to this answer.

sambler
  • 6,917
  • 1
  • 16
  • 23