0

My working directory is different from the directory in which my target files are present. The goal is to compress the files and store the compressed file (zip or tar.gz or anything) in the same location as the target files. How to do the same?

1 Answers1

0

Set the current working directory. See How to set the current working directory in Python? .

If you don't want your program to change the working directory, you can store the cwd, change it, and then change it back. You can also just use absolute addresses.

Bennett Brown
  • 5,234
  • 1
  • 27
  • 35