Re: Init style output with python?

2007-05-06 Thread Maxim Veksler
On 5/6/07, Tina I <[EMAIL PROTECTED]> wrote: > Maxim Veksler wrote: > > > Is there are frame work or something in python that would allow me to > > do this (quickly) ? > > If not, ideas how I should I be getting this boring task of: > > 1. get screen width >

Init style output with python?

2007-05-05 Thread Maxim Veksler
WHITE_FG + msg + self.BLACK_FG cc = ColorTerm() print cc.red('Cool!') + cc.yellow('?'), cc.green('Sure is!!!') print "Now setting your terminal text color to blue" + cc.BLUE_FG print "well don't be blue about this, here let me set it back for you" print cc.BLACK_FG + "see, nothing to worry about" """ -- Cheers, Maxim Veksler "Free as in Freedom" - Do u GNU ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Non blocking sockets with select.poll() ?

2007-05-05 Thread Maxim Veksler
Echo > from twisted.internet.protocol import ServerFactory > > f = ServerFactory() > f.protocol = Echo > for i in range(1, 19169): > reactor.listenTCP(i, f) > reactor.run() > > This will handle traffic from an arbitrary number of clients at the same > time and do so more efficiently than the loop in your version. You can > also try epollreactor instead of pollreactor, if the version of Linux you > are using supports epoll, for even better performance. > Thanks! > Jean-Paul > -- Cheers, Maxim Veksler "Free as in Freedom" - Do u GNU ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Non blocking sockets with select.poll() ?

2007-05-04 Thread Maxim Veksler
On 5/4/07, Maxim Veksler <[EMAIL PROTECTED]> wrote: > On 5/4/07, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > On Fri, 4 May 2007 13:04:41 +0300, Maxim Veksler <[EMAIL PROTECTED]> wrote: > > >Hi, > > > > > >I'm trying to write a non

Re: Non blocking sockets with select.poll() ?

2007-05-04 Thread Maxim Veksler
On 5/4/07, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Fri, 4 May 2007 13:04:41 +0300, Maxim Veksler <[EMAIL PROTECTED]> wrote: > >Hi, > > > >I'm trying to write a non blocking socket port listener based on > >poll() because select is limited t

Non blocking sockets with select.poll() ?

2007-05-04 Thread Maxim Veksler
port select s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setblocking(0) s.bind(('0.0.0.0', 1)) s.listen(5) __poll = select.poll() __poll.register(s) __poll.poll() print "I did not block" """ -- Cheers, Maxim Veksler "Free as in Freedom" - Do u GNU ? -- http://mail.python.org/mailman/listinfo/python-list

Re: I can't inherit from "compiled" classes ?

2007-04-29 Thread Maxim Veksler
On 4/29/07, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, Maxim Veksler > wrote: > > > Hello list, > > > > I'm trying to subclass socket and select, for both I get: > > """ TypeError: Error

I can't inherit from "compiled" classes ?

2007-04-29 Thread Maxim Veksler
module.__init__() takes at most 2 arguments (3 given) """ What am I breaking wrong? Thank you, Maxim. -- Cheers, Maxim Veksler "Free as in Freedom" - Do u GNU ? -- http://mail.python.org/mailman/listinfo/python-list

Re: ulimit on open sockets ?

2007-04-14 Thread Maxim Veksler
On 4/13/07, Alex Martelli <[EMAIL PROTECTED]> wrote: > > On Apr 12, 2007, at 1:17 PM, Maxim Veksler wrote: > ... > > Now, someone I work with suggested a simple work around "Pass the list > > objects in groups of 1024 each time to the select.select structure&q

Re: ulimit on open sockets ?

2007-04-12 Thread Maxim Veksler
On 4/10/07, Alex Martelli <[EMAIL PROTECTED]> wrote: > Maxim Veksler <[EMAIL PROTECTED]> wrote: > > > ValueError: filedescriptor out of range in select() > > """ > > > > Should I be using a different version of select or something? Or >

Re: ulimit on open sockets ?

2007-04-12 Thread Maxim Veksler
On 4/10/07, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > Maxim Veksler wrote: > > > I've written this code, the general idea was to listen on all > > 65535 port of tcp for connection. > > Please excuse the question: Why would anyone want to do such a manic &g

ulimit on open sockets ?

2007-04-09 Thread Maxim Veksler
rent version of select or something? Or should I implement this the other way around, if so please suggest how. Thank you very much, (enthusiastically learning python) Maxim. -- Cheers, Maxim Veksler "Free as in Freedom" - Do u GNU ? -- http://mail.python.org/mailman/listinfo/python-list

Re: low level networking in python

2007-04-06 Thread Maxim Veksler
On 4/4/07, Irmen de Jong <[EMAIL PROTECTED]> wrote: > Maxim Veksler wrote: > > > I'm trying to bind a non-blocking socket, here is my code: > > """ > > #!/usr/bin/env python > > > > import socket, select > > fro

Re: low level networking in python

2007-04-03 Thread Maxim Veksler
On 3 Apr 2007 08:43:57 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Apr 3, 10:29 am, "Maxim Veksler" <[EMAIL PROTECTED]> wrote: > > Hello, > > > > I wish to do some low level network stuff using python. > > > > -- > > Chee

low level networking in python

2007-04-03 Thread Maxim Veksler
ow.py", line 30, in ? raise 'source file doesn\'t look like swigged shadow class code' source file doesn't look like swigged shadow class code error: command '/usr/bin/python' failed with exit status 1 """ [1] http://pylibpcap.sourceforge.net/

Re: programmatically manipulation environment variables of the calling shell

2007-03-12 Thread Maxim Veksler
On 3/12/07, Tommy Nordgren <[EMAIL PROTECTED]> wrote: > > On 12 mar 2007, at 11.33, Maxim Veksler wrote: > > > Hello list, > > > > I'm trying to write a python script that would allow me to manipulate > > shell variables of the calling shell. I'm

programmatically manipulation environment variables of the calling shell

2007-03-12 Thread Maxim Veksler
h python? (If at all possible because python is actually a sub process of bash). Thank you, Maxim. -- Cheers, Maxim Veksler "Free as in Freedom" - Do u GNU ? -- http://mail.python.org/mailman/listinfo/python-list

Re: lambda functions ?

2007-02-05 Thread Maxim Veksler
Wow, Thank you everyone for the help. I am amazed by the motivation people have on this list to help new comers. I hope that I will be able to contribute equally some day. On 05 Feb 2007 14:22:05 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Maxim Ve

lambda functions ?

2007-02-05 Thread Maxim Veksler
quot;x: 0 + 42" And what is the "f" object? An integer? a pointer? an Object? I'm coming from the C world... Could some please try (if even possible) to implement the above code without using "lambda" I believe it would help me grasp this a bit faster then. Thank you, Maxim. -- Cheers, Maxim Veksler "Free as in Freedom" - Do u GNU ? -- http://mail.python.org/mailman/listinfo/python-list