[Tutor] Short Version, New guy looking for some tips, Revisited.
nick at javacat.f2s.com
Sat Feb 7 18:46:16 EST 2004
I'm also a beginner at python, but I know what your saying.
Also I'm working on a small compression/archive program and the list helped me out with that.
However, in a bid to help you understand a little of the linux/python crossover here's a prog I wrote to give me a list off my currently installed gentoo apps. But do read the comments in it as it's not perfect and the way it does things could be better. Also, I no longer run gentoo so I am unable to test it at the moment although it did run fine last time I ran it on gentoo.
The prog is attached as Im not sure how my formatting will turn out if I cut n paste it here.
Also, I recently bought 2 python books, 'python text processing' and 'learning python 2nd edition'. The learning python book is excellent, and seen as how you already know shell scripts you will have no problems working your way through that book and understanding it. The text processing book Im not keen on, altho it is a recent book.
Anyway, hope my little prog helps you out.
On Sat, 7 Feb 2004 13:26:53 -0800
Joshua Banks <syn_ack at comcast.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Ok. Long story short.
> > Specifically, I would like to accomplish the following with a Python
> > script.
> > 1) Compress all files located in "/var/log/portage directory
> > 2) Have the Python script create a subdirectory located within the
> >Parnet "portage" directory called (example) "LogArchive", and place
> >the compressed files from the "portage" directory into newly created
> >subdirectory "LogArchive".
> > #My Mental note: I would preferably like to compress all files
> > together if possible instead of individually. Not sure how that is
> > best done though. Maybe thats directory compression... Hmmmm.. never
> > done that before. (Again any example will suffice)
> What am I REALLY asking for?????????
> What I'm really asking for is for someone to provide a simple script
> that accomplishes the goal above. """But Why"""" To Study....really
> """"Important part of this email""""
> The important part of my email isn't to have a Python script compress a
> directory for me..NO...NO....NO I can do that with Tar or Bzip from the
> command line very easy.
> The important part is to look at """"How"""" a Python script could be
> written so that I can """"reference"""" the steps taken and research
> the Python documentation at each step of the way through the script.
> Im sure there are probably more than a few ways to accomplish my
> compression goal with a Python script. All I'm looking for is an
> example that I can reference. Again, the important part isn't file or
> directory compression with Python...... but the """steps""" taken. An
> example of """"""How"""""".
> Am I asking for a simple example. Nothing more than that.
> Joshua Banks
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
> -----END PGP SIGNATURE-----
> Tutor maillist - Tutor at python.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1475 bytes
Desc: not available
Url : http://mail.python.org/pipermail/tutor/attachments/20040207/629a24e3/list_emerged-0001.obj
More information about the Tutor