Litwos Litwos - 1 year ago 99
Python Question

Get specific file with glob

I am trying to locate a specific .xml file with glob. But the path comes from an object, and it doesn't seem to work.

I followed this example: Python: How can I find all files with a particular extension?

The code is this:

import glob
ren_folder = 'D:\Sentinel\D\S2A_OPER_PRD_MSIL1C_PDMC_20160710T162701'

I get invalid syntax...

SyntaxError: invalid syntax

Answer Source

You are closing the flie name string prematurely, it should be:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download