[Tutor] ok, got a primitive but workable solution

Kirk Bailey deliberatus@my995internet.com
Fri, 28 Dec 2001 19:17:05 -0500


ok, got it working right- assuming my primitive understanding of cgi is
'right'.

Take a look.

outputted page:
http://www.howlermonkey.net/cgi-bin/TLwebmgr.py

Sourcecode:
http://sss.howlermonkey.net/TLwebmgr.shtml


This is the master page, the one listing all lists ( which have a info
file, nudge nudge, wink wink)
hosted on the service. It reads the first line of the (listname).info
file, which is to be a 1 line
description of the list. To read the FULL description (and access the
form to subscribe or unsubscribe) they
are to click a list name, and this sends in a command request to
TLcommander.py which reads the information
from the request using GET. IT's not a lot of info, so get is sufficent
for this.

This works, and it works in 1.5.2 python, so is downward compatible from
the latest version, which is cool, as there many still using, even STUCK
using, 1.5.foo!


Sean 'Shaleh' Perry wrote:
> 
> On 28-Dec-2001 Kirk Bailey wrote:
> > I wanted to trim a statement down to give me ONLY the name of the list.
> > I got it.
> >
> > Probably not the best solution, but it works, and works in python 1.5.2
> > which is what is in my server.
> >
> >  'list' is a string, such as: './lists/testlist3.info'
> >
> > I want to extract the pure list name so I can display ONLY that. This
> > works.
> >
> > def getname(list):
> >       a=string.split(list,'/')
> >       b=a[2]
> >       c=string.split(b,'.')
> >       return c[0]
> >
> 
> apparently you missed my mail.
> 
> def getname(thing): # list is A BAD NAME TO USE
>     import os.path
>     name = os.path.basename(thing)
>     name, ext = os.path.splitext(name)
>     return name
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

-- 
Respectfully,
             -Kirk D Bailey (C)2001
              Addme! icq #27840081
end


Within the sweep of his sword, Each man is an Ubar.

http://www.howlermonkey.net/
http://www.sacredelectron.org/