I don't think that's actually what you want to do. Yes arguments are
not to be used directly as option arguments (otherwise why have option
arguments anyways ;-) but each option argument is usually evaluated
under the evaluation of the actual option and optparse will error on
invalid use of the opt
Michael Goettsche wrote:
> Hi there,
>
> I'm trying to write a simple server/client example. The client should be able
> to send text to the server and the server should distribute the text to all
> connected clients. However, it seems that only the first entered text is sent
> and received. When
of course the later snipplet should be:
---
def get_options(opts):
"""Return True or False if an option is set or not"""
vals = opts.__dict__.values()
if vals == [None * len(vals)]:
return False
return True
---
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Is it possible to generate a list of `None' ?
opts.__dict__.values() below could be represented by [None, None, None]
---
def get_options(opts):
"""Return True or False if an option is set or not"""
vals = opts.__dict__.values()
for val in vals:
if val is not None: