Hello! Sorry to bother you folks with something that probably isn't very exciting, but it would really help me if anyone had a quick solution to my problem. I am working Byte of Python 1.92, and its his problem solving exercise in creating a zip backup of a directory. It looks like this:
Code:
import time
import os
source=['C:\\gs']
target_dir='C:\\backup' target=target_dir + os.sep +time.strftime('%Y%m%d%H%M%S')+'.zip'
zip_command="zip -qr {0} {1}".format(target,''.join(source))
if os.system(zip_command) == 0:
print('Successful backup to', target)
else:
print('Backup FAILED')
So, I understand that the directory that zip.exe is in has to be in the list, sys.path. I have already appended it, and have checked multiple times to make sure it is correct. I have also checked to make sure all proper directories exist. Finally, I have used "zip_command" string in command prompt and it worked perfectly. I am running out of ideas; essentially it seems that even though I have the directory zip.exe is in, I am unable to use it. Also, I have done previous things involving modules and I was able to make use of ones in the default directories (the current directory, ' ', mainly). Is there any other problem it could be?
The message in command prompt when I run in my python interpreter (a little window flashes and leaves, that I captured with a screenshot) says " ' zip' is not recognized as an internal or external command, operable program, or batch file. " Which I have understood to essentially mean that it is not seeing that directory (I have seen this same message when trying to run the command in command prompt in any other directory than the one zip.exe is in). So that leads me to believe that even though it is in sys.path, it is acting as if it isn't.
This is my sys.path:
Code:
['',
'C:\\Windows\\system32\\python32.zip',
'C:\\Python32\\Lib',
'C:\\Python32\\DLLs',
'C:\\Python32',
'C:\\Python32\\lib\\site-packages',
'C:\\Program Files (x86)\\GnuWin32\\bin']
I appreciate any help, even if its just shared befuddlement. Thanks!