Tarfile module error
Hello, I'm using Python to automate admin tasks on my job. We use Windoze 2000 as desktop platform. When executing this daily backup scripts I get the following error: Traceback (most recent call last): File "C:\UTILS\backup.py", line 8, in ? TarFileBackup = tarfile.open(NewBackupFilename, 'w:bz2') File "C:\Python23\lib\tarfile.py", line 875, in open return func(name, filemode, fileobj) File "C:\Python23\lib\tarfile.py", line 980, in bz2open raise ReadError, "not a bzip2 file" tarfile.ReadError: not a bzip2 file Here's the code: import tarfile from datetime import datetime DirBackup = r'\\skpdc01\Backups' DirOrig = r'C:\WUTemp' NewBackupFilename = DirBackup + '\\' + '%s' % (datetime.today()) + '.tar.bz2' TarFileBackup = tarfile.open(NewBackupFilename, 'w:bz2') TarFileBackup.add(DirOrig) TarFileBackup.close() What am I doing wrong? From the error message I gues the library is expecting the bzip file to exists, but I am explicitly open it whit 'w:bz2' Any ideas? Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python programming
Once you master one language it is easy to understand other. I mastered C in my younger years, writing signal handlers and thread on Solaris and AIX. It it not the syntax, that comes easy, it is building the correct algorithm that matters. The best way to learn is make some thing useful that you need. I would suggest project with Raspberry Pi to learn python. On Tuesday, February 11, 2014 4:21:29 PM UTC-8, ngangsia akumbo wrote: > Please i have a silly question to ask. > > > > How long did it take you to learn how to write programs? > > > > What is the best way i can master thinker? > > I know the syntax but using it to write a program is a problem -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring outlook contents
Subir wrote: > Hi, > > I am trying to build an application to explore the contents of an > outlook .pst files. All the reference that I have seen uses the > registry to do so. Does any one know any other way of doing this. Also, > is anyone has any code which does something related to this, please let > me know. > > -Subir Check this out: http://www.boddie.org.uk/python/COM.html HTH -- http://mail.python.org/mailman/listinfo/python-list