I have a script running to rename files, I want to upgrade/update it to looking at a certain file name.
The complete part
import pathlib
import shutil
import logging
def main(src, dest):
logger = logging.getLogger("CopyFiles")
logger.setLevel(logging.WARNING)
handler = logging.FileHandler(filename = "CopyErrors.log",
encoding = "utf-8",
mode = "w")
handler.setFormatter(logging.Formatter(
"%(asctime)s - [%(levelname)s] %(name)s: %(message)s"))
logger.addHandler(handler)
pathSrc = pathlib.Path(src).rglob("lb_panoramic.csv")
for file in pathSrc:
try:
shutil.copy(str(file), f"{dest}/{file.parent.name}.csv")
except Exception as e:
logger.warning(f"{file} could not be copied.\n"
f"{type(e).__name__}: {e}")
if __name__ == '__main__':
main("C:/code/convert/renamefiles/source", "C:/code/convert/renamefiles/target")
Here still with
pathSrc = pathlib.Path(src).rglob("lb_panoramic.csv")
It does not take the file lb_panoramic.csv at all.??
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I am new to using Tkinter in pythyon 27 and am not able to read environment variables I defined on a raspberry pi
Im trying to make a script that post data on REST service together with Bearer token
I am trying to write a brute-force solution to a sum of subsets problem in python but don't get any output
I have two python dictionaries that are structured as defaultdicts that follow the format {string:set(string)}They are as follows: