Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9146293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:42:57+00:00 2026-06-17T10:42:57+00:00

I am new to programing python (5 days now) and have ran into a

  • 0

I am new to programing python (5 days now) and have ran into a problem that i can’t seem to find the answer to in this forum. i would appreciate any help and a detailed explaination would be very much appreciated.

To being. i’m using python 3 on a macbook pro. i’m using an editor called “komodo edit”
I’m using CH Swaroop’s “Byte of Python” as a guide.

the problem i’m having is with an example of creating a program that takes a file from one folder and backs it up to another as a zip file.

the example in the book is as follows:

Save as backup_ver1.py:
import os
import time
#  The files and directories to be backed up are specified in a list.
source = ['"C:\\My Documents"', 'C:\\Code']
# Notice we had to use double quotes inside the string for names with spaces in it.
#  The backup must be stored in a main backup directory
target_dir = 'E:\\Backup' # Remember to change this to what you will be using
#  The files are backed up into a zip file.
#  The name of the zip archive is the current date and time
target = target_dir + os.sep + time.strftime('%Y%m%d%H%M%S') + '.zip'
#  We use the zip command to put the files in a zip archive
zip_command = "zip -qr {0} {1}".format(target, ' '.join(source))
# Run the backup
if os.system(zip_command) == 0:
    print('Successful backup to', target)
else:
    print('Backup FAILED')

my code is as follows

import os
import time
source = ['C:\\learningPython','C:\\scan'] # can i use / instead of the \?
# why is square brackets used here? i'm under the assumption the square brackets are used for list. i'm also assuming one is the directory and the other is the file.
target_dir = 'C:/backup' # created a "backup" folder
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‚)

I get a

zip error: Nothing to do! (try: zip -qr C:/backup/20133201/15/13203219.zip . -i C:learningPythonC:scan)
backup failed

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:42:58+00:00Added an answer on June 17, 2026 at 10:42 am

    The example code you’re looking at is totally Windows specific, what with the C:\blah paths. An equivalent path on OS X would look something like:

    /Users/yourusername/Documents
    

    (You also seem to have somehow transformed a few 's into ,s when converting the code. Not sure what that’s all about.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pretty new to Python programming so I have this question: How can I
I'm new in Python programming but i have a big problem: how can i
I'm new to python programming. I have this problem: I have a list of
I am new to programming in python and need help doing this. I have
I'm new programing in Python, and what I need a little help with this
I'm new to programing, this is my first python-gtk applet and I'm trying to
Im very new to C programing, but have limited experience with Python, Java, and
I'm new to Python (relatively new to programing in general) and I have created
I am new to python programming..can someone suggest some way to do the following:
I am very new to python programming and have yet to buy a textbook

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.