[Tutor] miniwiki 1.3.0 beta now available

2007-03-02 Thread Kirk Bailey
May The Gods have mercy on my soul. MiniWiki is now offered for downloading. 1.3.0 is not in presentable condition for them what would like to kick it around some. http://www.tinylist.org/MiniWIKI130.zip Included in it is the zip archive for the server I settled on which is a very nice little

Re: [Tutor] forth

2007-03-02 Thread Alan Gauld
"Bob Gailer" <[EMAIL PROTECTED]> wrote > although is says 'resulting in a [sic] executable". Not sure what > that > means, unless the obvious - an .exe file which when run displays > "Hello > World!". In that case 263 bytes is remarkable. It does and it is. That is Forth's strong point, it is

Re: [Tutor] Yet another list comprehension question

2007-03-02 Thread Alan Gauld
"Andrei" <[EMAIL PROTECTED]> wrote > Alternatively, you could put the results as keys in a dictionary, > then request > mydict.keys() to get a list of unique outcomes. I thought of that too, but couldn't think how to do it in a list comprehension. It seemed like it should be possible but I coul

Re: [Tutor] howto call DOM with python

2007-03-02 Thread Alan Gauld
"Ismael Farfán Estrada" <[EMAIL PROTECTED]> wrote > By any chance is this your tutorial? > http://www.freenetpages.co.uk/hp/alan.gauld Yes that's it. > I entered there but the parts "Writing web clients" and "Writing > Web Applications" are dissabled I'm writing them at the moment. :-) But the

Re: [Tutor] forth

2007-03-02 Thread Carroll, Barry
> -Original Message- > Date: Fri, 02 Mar 2007 14:54:04 -0800 > From: Bob Gailer <[EMAIL PROTECTED]> > Subject: Re: [Tutor] forth > To: Hilton Garcia Fernandes <[EMAIL PROTECTED]> > Cc: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1; format=

Re: [Tutor] Can you tell me if this C or python please

2007-03-02 Thread Lance Haig
Bob, Thanks a million I will start talking to the other guys Thanks Lance ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Can you tell me if this C or python please

2007-03-02 Thread Bob Gailer
Lance Haig wrote: > Bob Gailer wrote: >> Lance Haig wrote: >>> Hi, >>> >>> I am helping on an OS project called bongo-project and I am trying >>> to debug a script that is used for migration. When I run the file I >>> get an error. I have traced it down to a file called libs.c. >>> >>> I know tha

Re: [Tutor] forth

2007-03-02 Thread Bob Gailer
Hilton Garcia Fernandes wrote: > in python: > > print "Hello world!" > > 21 bytes. > True, but the forth program is (as I read it) more equivalent to: def helloWorld(): print "Hello World!" although is says 'resulting in a [sic] executable". Not sure what that means, unless the obvious -

Re: [Tutor] howto call DOM with python

2007-03-02 Thread Ismael Farfán Estrada
> >I don't think you can make it work under Linux. The Jython applet >is your nearest option. You will be better learing the ninimum of >JavaScript IMHO. Try my tutorial as a quickl way in, especially >if you know Python... > >Finally, you may be able to do what you want using the urllib >module to

Re: [Tutor] Can you tell me if this C or python please

2007-03-02 Thread Lance Haig
Bob Gailer wrote: > Lance Haig wrote: >> Hi, >> >> I am helping on an OS project called bongo-project and I am trying to >> debug a script that is used for migration. When I run the file I get >> an error. I have traced it down to a file called libs.c. >> >> I know that the file looks like a c fi

Re: [Tutor] Can you tell me if this C or python please

2007-03-02 Thread Bob Gailer
Lance Haig wrote: > Hi, > > I am helping on an OS project called bongo-project and I am trying to > debug a script that is used for migration. When I run the file I get an > error. I have traced it down to a file called libs.c. > > I know that the file looks like a c file but I am confused by som

[Tutor] Can you tell me if this C or python please

2007-03-02 Thread Lance Haig
Hi, I am helping on an OS project called bongo-project and I am trying to debug a script that is used for migration. When I run the file I get an error. I have traced it down to a file called libs.c. I know that the file looks like a c file but I am confused by some of the code in it. I would

Re: [Tutor] CGI request handler bug?

2007-03-02 Thread Steve N
> I was playing with some simple HTTP CGI server code > and discovered what I think may be a bug in > CGIHTTPServer.CGIHTTPRequestHandler. A "GET" request > without a leading '/' from a telnet session displays > the CGI script rather than the script's output. If > the > request includes the leading

Re: [Tutor] forth

2007-03-02 Thread Hilton Garcia Fernandes
in python: print "Hello world!" 21 bytes. all the best, hilton Em Sexta 02 Março 2007 16:48, Kirk Bailey escreveu: > Hello world > > : helloWorld ."Hello World!; > > that's it. > > HelloWorld is now part of the language. Now if your language instance > lets you compile it down, it will includ

[Tutor] forth

2007-03-02 Thread Kirk Bailey
Hello world : helloWorld ."Hello World!; that's it. HelloWorld is now part of the language. Now if your language instance lets you compile it down, it will include all functions to create that function, and leave all others out, resulting in a executable. Mine came in at 263 bytes. Microsoft

Re: [Tutor] httpd in your laptop?!? serve web pages and wikis in your notebook?

2007-03-02 Thread Kirk Bailey
Yeppers, prolog is about as normal as a chocolate glazed neon donut. Alan Gauld wrote: > "Luke Paireepinart" <[EMAIL PROTECTED]> wrote >>> forth ... while very good for small programs >>> to imbed into controller cpu's to bury inside some machine, > > It's a relatively little known fact that Sun

Re: [Tutor] Regular expressions - Ignoring linefeeds

2007-03-02 Thread Kent Johnson
Luke Paireepinart wrote: > Kent Johnson wrote: >> Luke Paireepinart wrote: >>> Your RE is wrong. >>> Refer to http://docs.python.org/lib/re-syntax.html >>> * Causes the resulting RE to match 0 or more repetitions of the >>> preceding RE, as many repetitions as are possible. ab* will match >>> 'a'

Re: [Tutor] Regular expressions - Ignoring linefeeds

2007-03-02 Thread Luke Paireepinart
Kent Johnson wrote: > Luke Paireepinart wrote: > >> doug shawhan wrote: >> >>> I've been looking through various sites, but cannot find the magic >>> button that allows me to match a string with linefeeds >>> I'd rather not strip out the linefeeds, then stick them back in. :-) >>> >>> I'm

Re: [Tutor] Regular expressions - Ignoring linefeeds

2007-03-02 Thread Kent Johnson
Luke Paireepinart wrote: > doug shawhan wrote: >> I've been looking through various sites, but cannot find the magic >> button that allows me to match a string with linefeeds >> I'd rather not strip out the linefeeds, then stick them back in. :-) >> >> I'm attempting something that should be fairl

Re: [Tutor] Regular expressions - Ignoring linefeeds

2007-03-02 Thread Kent Johnson
doug shawhan wrote: > I've been looking through various sites, but cannot find the magic > button that allows me to match a string with linefeeds > I'd rather not strip out the linefeeds, then stick them back in. :-) > > I'm attempting something that should be fairly simple: > > snippy = re.comp

Re: [Tutor] Regular expressions - Ignoring linefeeds

2007-03-02 Thread Luke Paireepinart
doug shawhan wrote: > I've been looking through various sites, but cannot find the magic > button that allows me to match a string with linefeeds > I'd rather not strip out the linefeeds, then stick them back in. :-) > > I'm attempting something that should be fairly simple: > > snippy = re.compil

Re: [Tutor] Regular expressions - Ignoring linefeeds

2007-03-02 Thread Jerry Hill
On 3/2/07, doug shawhan <[EMAIL PROTECTED]> wrote: > I've been looking through various sites, but cannot find the magic button > that allows me to match a string with linefeeds > I'd rather not strip out the linefeeds, then stick them back in. :-) Try this: >>> s = '''Good gravy! Hi there. I'm so

[Tutor] Regular expressions - Ignoring linefeeds

2007-03-02 Thread doug shawhan
I've been looking through various sites, but cannot find the magic button that allows me to match a string with linefeeds I'd rather not strip out the linefeeds, then stick them back in. :-) I'm attempting something that should be fairly simple: snippy = re.compile('Hi there.*Bye there.') s = '

Re: [Tutor] Yet another list comprehension question

2007-03-02 Thread Tim Golden
Andrei wrote: >> "Smith, Jeff" medplus.com> wrote >> >>> In other words, applying somefun to the results of the iterator >>> return >>> duplicates but I want the constructed list to contain none. >>> l = [somefun(i) for i some-iterator if somefun(i) not in l] >>> >>> doesn't work (not that I expe

Re: [Tutor] Yet another list comprehension question

2007-03-02 Thread David Perlman
On Mar 2, 2007, at 9:56 AM, Alan Gauld wrote: > Why not use a Set? > > s = Set([somefun(i) for i in some-iterator]) > > Might be slow for big lists though... I'm curious why using a Set would be slower than doing it in a loop? In either case, the processor has to scan through all the data l

Re: [Tutor] httpd in your laptop?!? serve web pages and wikis in your notebook?

2007-03-02 Thread Alan Gauld
"Luke Paireepinart" <[EMAIL PROTECTED]> wrote > >> forth ... while very good for small programs >> to imbed into controller cpu's to bury inside some machine, It's a relatively little known fact that Sun use Forth as the monitor/bootloader in their servers. When you do a shutdown on a Sun box it

Re: [Tutor] Yet another list comprehension question

2007-03-02 Thread Andrei
> "Smith, Jeff" medplus.com> wrote > > > In other words, applying somefun to the results of the iterator > > return > > duplicates but I want the constructed list to contain none. > > > l = [somefun(i) for i some-iterator if somefun(i) not in l] > > > > doesn't work (not that I expected it to).

Re: [Tutor] Yet another list comprehension question

2007-03-02 Thread Jordan Greenberg
Smith, Jeff wrote: > I find a common thing to do is > > l = list() > for i in some-iterator: > if somefum(i) != list: > l.append(somefun(i)) How about using the same condition you do in the if? Like: l=[somefun(i) for i in some-iterator if not type(somefun(i)) is list] HTH Jordan _

Re: [Tutor] using tarfile on strings or filelike objects

2007-03-02 Thread Luke Paireepinart
Barton David wrote: > I like that I can access the contents of a zip archive that's stored > in memory (rather than on disk) by packing the archive contents into a > StringIO or cStringIO object and feeding that to ZipFile... > > i.e. > > filelike=cStringIO.StringIO(archive_as_string) > zf=zi

Re: [Tutor] httpd in your laptop?!? serve web pages and wikis in your notebook?

2007-03-02 Thread Luke Paireepinart
> forth uses a dictionary to locate and execute all its functions and > subfunctions. it is a threaded language. so it spends much of it's > time looking up functions in the dictionary. in large programs this > results in the majority of it's excecutiojn time being spent in the > dictionary, a

[Tutor] CGI request handler bug?

2007-03-02 Thread Steve N
Hi all, I was playing with some simple HTTP CGI server code and discovered what I think may be a bug in CGIHTTPServer.CGIHTTPRequestHandler. A "GET" request without a leading '/' from a telnet session displays the CGI script rather than the script's output. If the request includes the leading '/',

Re: [Tutor] Yet another list comprehension question

2007-03-02 Thread Alan Gauld
"Smith, Jeff" <[EMAIL PROTECTED]> wrote > In other words, applying somefun to the results of the iterator > return > duplicates but I want the constructed list to contain none. > l = [somefun(i) for i some-iterator if somefun(i) not in l] > > doesn't work (not that I expected it to). Why not u

[Tutor] Problem with Import

2007-03-02 Thread Nagendra Singh
Hi Alan, I had installed Python through cygwin and then installed Gdal from source. I have tried everything but it does not work, my guess is I am missing something trivial, I am planning to uninstall everything (Cygwin and Gdal) and then reinstall all of it again over the weekend, this is my last

[Tutor] Yet another list comprehension question

2007-03-02 Thread Smith, Jeff
I find a common thing to do is l = list() for i in some-iterator: if somefum(i) != list: l.append(somefun(i)) In other words, applying somefun to the results of the iterator return duplicates but I want the constructed list to contain none. l = [somefun(i) for i some-iterator] will

[Tutor] executing a string representing python code

2007-03-02 Thread Cecilia Alm
I know that there are several ways to execute a string which represents a piece of python code. Out of curiosity, is it only eval which returns a value? (as below, where the string corresponds to a defined function). def addone(val): ... return val + 1 ... res = eval('addone(10)') Thanks

[Tutor] using tarfile on strings or filelike objects

2007-03-02 Thread Barton David
I like that I can access the contents of a zip archive that's stored in memory (rather than on disk) by packing the archive contents into a StringIO or cStringIO object and feeding that to ZipFile... i.e. filelike=cStringIO.StringIO(archive_as_string) zf=zipfile.ZipFile(filelike) content=zf.re

Re: [Tutor] howto call DOM with python

2007-03-02 Thread ALAN GAULD
Thanks for the update Tim. I haven't downloaded the package in a while since I've been using ActiveStates version on my Windows box which includes the extensions in the bundle. Alan g. - Original Message From: Tim Golden <[EMAIL PROTECTED]> To: Alan Gauld <[EMAIL PROTECTED]> Cc: tutor

Re: [Tutor] howto call DOM with python

2007-03-02 Thread Tim Golden
Alan Gauld wrote: > You can do that in Internet Explorer provided you > a) Have the winall package installed and Just an aid to newcomers: the "winall" package referred to here are the windows-oriented extension modules by Mark Hammond which used to be known as win32all and are now known as pywin

Re: [Tutor] Difficulty with the subprocess module

2007-03-02 Thread Alan Gauld
"Dhiraj Sharma" <[EMAIL PROTECTED]> wrote > > p = subprocess.Popen("cat", buffer=0, stdin=subprocess.PIPE, > stdout=subprocess.PIPE, stderr=subprocess.STDOUT) > > fdata = open('input'); > for l in fdata: > p.stdin.write(l) > m = p.stdout.readline() >