Can I learn Python on this forum

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Methos
    New Member
    • Mar 2007
    • 2

    #1

    Can I learn Python on this forum

    Originally posted by bartonc
    Is it really your intention to zip the entire I drive contents????
    You should really start smaller like we have already discussed.

    This script calls your system cmd.exe so you are already complicating things.

    You need two things on you system for this to work. 1) an "I" drive, and 2) zip installed on the system PATH. If you don't know how to run zip from the command line, you are starting of with too many unknowns. If you can run zip from the command line, try to do the zip by hand. That will tell you if that part is working. If it is, then we can work on your script.
    Think "baby steps". You tend to jump into the deep end a lot.
    The proplem is actualy quite simple

    In the line below you have 2 apostropies around the first %s that you dont need. Remove them and the script will work fine.

    Before
    zip_command = "zip -qr '%s' %s" % (target, ' '.join(source))

    After
    zip_command = "zip -qr %s %s" % (target, ' '.join(source))
    Last edited by bartonc; Mar 7 '07, 10:40 AM. Reason: removed html tags
  • Methos
    New Member
    • Mar 2007
    • 2

    #2
    Sorry thats still wrong.

    heres the correct implementation

    zip_command = "zip -qr %s %s" % (target, ''.join(source) )

    the space between the apostropies ahead of the .join statement what creating spaces between the characters in your source string.

    Comment

    • bartonc
      Recognized Expert Expert
      • Sep 2006
      • 6478

      #3
      Originally posted by Methos
      Sorry thats still wrong.

      heres the correct implementation

      zip_command = "zip -qr %s %s" % (target, ''.join(source) )

      the space between the apostropies ahead of the .join statement what creating spaces between the characters in your source string.
      Sorry. I thought that this was a question and split it out from the thread that you had posted in. It's late now but I can re-merge the two in the morning, if you like.
      Welcome to the Python Forum and TSDN. I hope you stick around with answers for other members or questions of your own.
      Kind regards,
      Barton
      Python Forum Moderator

      Comment

      Working...