A little disappointed so far

Graham Nicholls graham at rockcons.co.uk
Sun May 18 21:36:53 EDT 2003


Jay O'Connor wrote:

> On Mon, 19 May 2003 02:11:54 +0100, Graham Nicholls
> <graham at rockcons.co.uk> wrote:
> 
>>> What things seem very hard?
>>Regular expressions.
> 
> Import the re module (refulare expression).  I don't use it a lot so I
> can't type a little example from memory, but it's served me well in
> the past.
> 
> http://www.python.org/doc/current/lib/module-re.html
> 
>>Running external programs.
> 
>  Can be done a number of ways, either using the exec family (like the
> C equivalents) or the popen family (includes support for using stdin,
> stdout between the two programs)  Give me an example of what you'd
> like to do and I'll give you a short example of how to do it.  It's
> pretty easy 
> http://www.python.org/doc/current/lib/os-process.html
> http://www.python.org/doc/current/lib/module-popen2.html
> 
> 
>>Opening sockets.
> 
> Again, pretty easy.  The socket module supports basic low level socket
> client and server capabilites.
> 
> http://www.python.org/doc/current/lib/module-socket.html
> 
> example:
> http://www.python.org/doc/current/lib/socket-example.html
> 
> Specific proptocals suchs as POP, HTTP and FTP are supported in other
> modules
> 
> See Internet Protocols and Support
> http://www.python.org/doc/current/lib/internet.html
> 
>>No case statement - or is it simply that my documentation is out of date?
>>I _know_ I can do if elif else constructs, but in a language which prides
>>itself in its readability, this is laughable.
> 
> Actually, from a Smalltalk pure OO background I find that case
> statements are superflous in OO languages and had been programming
> Python for about 8 months before I even wondered if the language had
> them :)
>
How do you handle, say 
if arg == 'd':
        switch on debug
if arg == 'v':
        switch on verbose
        
etc ? 
> Take care,
> Jay
Thanks again.  I'll be browsing for a while :-)
-- 
Graham Nicholls
All round good guy.




More information about the Python-list mailing list