[Tutor] writing sample program that zips files and saves in a backup directory

David david at pythontoo.com
Wed Oct 14 10:43:52 CEST 2009


David Eric wrote:
> 
> 
> On Tue, Oct 13, 2009 at 5:17 PM, Kent Johnson <kent37 at tds.net 
> <mailto:kent37 at tds.net>> wrote:
> 
>     On Tue, Oct 13, 2009 at 4:38 PM, David Eric <ciik13 at gmail.com
>     <mailto:ciik13 at gmail.com>> wrote:
> 
>      > as far as print zip_command, i would add that to the program
>     however, doesnt
>      > just declaring it actually trigger it..thus it would executed and the
>      > command line would get printed as well?
> 
>     I'm not sure what you mean by "declaring", but assigning a value to
>     zip_command, as you do, and printing it, as I suggest, do just that -
>     assign and print. It is the call to os.system() that executes the
>     command.
> 
>  
> 
>     oh i see the if os.sytem() command in the program is what ran the
>     zip_command
> 
>  
> 
>      > the actual program i was looking to write would take:
>      >  file1,file2,and file3, in /Users/davidteboul/bin/python
>      > and condense them into individual files; file1.gz, file2.gz and
>     file3.gz and
>      > save them in a directory already made - (/Users/davidteboul/backups)
> 
>     I think that doing this with gzip, you have to first copy the files to
>     the backup directory, then run gzip on the backup.
> 
>  
> 
>      > ps..did i post and reply all corretly?
> 
>     You can intersperse your comments with the original email, as I have
>     done above, rather than putting your entire reply at the end. The
>     reply all is fine.
> 
>     Kent
> 
> 
> thanks for the help, ill try some stuff and see if i can get it to work
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
Has anyone mentioned the module zipfile;
http://www.doughellmann.com/PyMOTW/zipfile/index.html

-- 
Powered by Gentoo GNU/Linux
http://linuxcrazy.com


More information about the Tutor mailing list