cherrypy sub-process

2007-03-11 Thread Bart Van Loon
Hi all, I have written a small program in Python which acts as a wrapper around mpd and natd on a FreeBSD system. It gets the status, restarts the processes, etc... Then, I created a tiny cherrypy webapp which provides a webinterface to this program. All works fine, but for the following problem:

Re: looking for Java final/Ruby freeze functionality in Python

2007-03-04 Thread Bart Van Loon
It was Sun, 04 Mar 2007 20:38:16 +0100, when Antoine De Groote wrote: > Hello, > > I've been googling for quite a while now but can't find anything about a > function/keyword to make a list (or something else) immutable. Could > anybody point me to docs about this matter or give me a reason why t

Re: portable Python ifconfig

2007-03-04 Thread Bart Van Loon
It was Sun, 4 Mar 2007 14:09:20 +0500, when Bart Van Loon wrote: > It was Sun, 4 Mar 2007 02:38:58 +0500, when Bart Van Loon wrote: >> Hi all, >> >> I'm looking for a portable (FreeBSD and Linux) way of getting typical >> ifconfig information into Python. > &

Re: portable Python ifconfig

2007-03-04 Thread Bart Van Loon
It was Sun, 4 Mar 2007 02:38:58 +0500, when Bart Van Loon wrote: > Hi all, > > I'm looking for a portable (FreeBSD and Linux) way of getting typical > ifconfig information into Python. After lots of trial and error (I'm proficient in C at all), I puzzled togehter the followi

Re: portable Python ifconfig

2007-03-03 Thread Bart Van Loon
It was 3 Mar 2007 18:43:57 -0800, when MonkeeSage wrote: > Bart, > > Can you try this and let us know if it works for FreeBSD? thanks for you suggestions! > import socket, fcntl, struct > > def _ifinfo(sock, addr, ifname): > iface = struct.pack('256s', ifname[:15]) > info = fcntl.ioctl(s

portable Python ifconfig

2007-03-03 Thread Bart Van Loon
Hi all, I'm looking for a portable (FreeBSD and Linux) way of getting typical ifconfig information into Python. Some research on the web brought me to Linux only solutions http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/439094 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/43909

Re: in place-ness of list.append

2007-02-05 Thread Bart Van Loon
It was Mon, 5 Feb 2007 05:01:28 -0600, when [EMAIL PROTECTED] wrote: > > Bart> #-- > Bart> def addnumber(alist, num): > Bart> """ work around the inplace-ness of .append """ > Bart> mylist = alist[:] > Bart> mylist.app

Re: in place-ness of list.append

2007-02-05 Thread Bart Van Loon
It was Mon, 05 Feb 2007 11:00:50 GMT, when Kent Johnson wrote: > Bart Van Loon wrote: >> Hi all, >> >> I would like to find out of a good way to append an element to a list >> without chaing that list in place, like the builtin list.append() does. >> >> cur

in place-ness of list.append

2007-02-05 Thread Bart Van Loon
Hi all, I would like to find out of a good way to append an element to a list without chaing that list in place, like the builtin list.append() does. currently, I am using the following (for a list of integers, but it could be anything, really) #--

Re: How do I print out in the standard output coloured lines

2007-02-02 Thread Bart Van Loon
It was 2 Feb 2007 04:27:06 -0800, when [EMAIL PROTECTED] wrote: > print "Hello World!!" > > I want it in red colour. > > That's all. Use colour escape codes: print "\033[1;31mHello World\033[0m" That's all. :-) -- groetjes, BBBart Golly, I'd hate to have a kid like me!

Re: Why does this not work?

2007-02-02 Thread Bart Van Loon
It was 2 Feb 2007 04:41:48 -0800, when alain wrote: > I tried the following: > > myobj=object() > myobj.newattr=5 > > results in: > > > Traceback (most recent call last): > File "", line 1, in ? > AttributeError: 'object' object has no attribute 'newattr' > > Any idea? I think it's because... ob