Ramakrishnan, Shashikanth wrote: > > Hi, > Hi. > > I have just started using Python and would appreciate if somebody > could help me out on zip commands. > > I am using C H Swaroop’s book “A byte of python” as my beginners guide. > > One example states to use >>>zip_command = "zip -qr '%s' %s" % > (target, ' '.join(source)) > > for zipping the target and source. > > However, “zip_command” as I understand is for Linux. > You're right. I assume later in the example he uses a method from the 'os' module to run this command? > > What would be the quivalent command for windows( I am using IDLE > 1.1.3, Python version 2.4.3) > Well, the example you gave would work on Windows if you had a zipping program in your PATH environment variable called 'zip' that took the same arguments as the 'zip' command on Linux. This is probably not likely, however, so you have three routes as I see it. 1. look into zipping files with the 'zlib' library. 2. find a port of the linux 'zip' program and put it in the same directory as your program (or add it to PATH). 3. find a different command-line zipping program and change zip_command to add the correct arguments to it.
HTH, -Luke > > Really appreciate your help. > > Thanks, > > Shashi. > > ------------------------------------------------------------------------ > > _______________________________________________ > Tutor maillist - [email protected] > http://mail.python.org/mailman/listinfo/tutor > _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
