ort, or if not, what is the way, using winreg, to
access the "(Default)" value of a key?
Regards,
Nicolas FORMICHELLA
--
https://mail.python.org/mailman/listinfo/python-list
On 2022-03-10 12:31, Dieter Maurer wrote:
Nicolas Haller wrote at 2022-3-9 10:53 -0500:
...
The documentation about "user-defined generic types"[1] says that I can
fix some types on a child class (class MyDict(Mapping[str, T]):) but
doesn't say much about the signature of the me
ate_method(self, an_arg: T) -> T: # I keep T
return 42
class Alternative2(Base[int]):
def _private_method(self, an_arg: int) -> int: # I replace T
return 42
Thanks,
--
Nicolas Haller
[1]:
https://docs.python.org/3/library/typing.html#user-defined-generic-types
--
https://mail.python.org/mailman/listinfo/python-list
sorry that the real piece of code
self.MplWidget.canvas.axes.set_xlim(left=max(0, self.i-40), right=
self.i+60)
self.MplWidget.canvas.axes.plot(x, y,'.k-')
self.MplWidget.canvas.axes.set_title('pull')
self.MplWidget.canvas.draw()
--
https://mail.python.org/mail
hi guys, i need help because my matplotlib realtime plot doesn't show the line
between the points.
even if i right '.k-'
thit plot is display in a qwidget in an other code
wirdely that if i put bar it actualy working.
the real time data come from an arduino sensor
that the shape of the data i ha
on a
single line (regardless of the compact parameter), so I don't believe
that was the rationale behind this behaviour.
On 9/11/18 1:05 PM, Max Zettlmeißl wrote:
On Tue, Sep 11, 2018 at 1:58 PM, Nicolas Hug wrote:
pprint({x: x for x in range(15)}, compact=True)
would be be printed i
Is there a reason why the 'compact' parameter is ignored when pretty
printing a dict? For example:
pprint({x: x for x in range(15)}, compact=True)
would be be printed in 15 lines while it could fit on 2.
Is this a bug or was this decided on purpose?
Thank you!
--
https://mail.python.org/mai
recommended?
We used zeep to communicate with SOAP webservices.
We choose it over suds because it supports python3.
I also happen to have a bug, and the maintainer quickly accepted my
patch, so according to me it's a good choice.
--
(°> Nicolas Évrard
( ) Liège
`¯
--
https://mail.python.org
uture.
--
Nicolas Évrard - B2CK SPRL
E-mail/Jabber: nicolas.evr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
https://mail.python.org/mailman/listinfo/python-list
his issue (I realize it's not something of
the utmost importance but rather a "philosophical" question).
--
Nicolas Évrard - B2CK SPRL
E-mail/Jabber: nicolas.evr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
https://mail.python.org/mailman/listinfo/python-list
ir HIS software).
Reporting is done through relatorio (http://relatorio.openhex.org/),
which uses ODF templates to generate ODF reports (or other format
thanks to unoconv) the client is written in GTk (we're writing one in
JavaScript right now (and I miss python badly)).
--
(°> Nicolas Évrard
ck on the black square (i.e. t1), the message
"click at..." gets printed on the console. When I click on the red
square (i.e. t2), nothing happens.
Bug or feature?
--Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
u compare "Scheme
language" and "Clojure language", you don't see Clojure at all.
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 3, 10:33 pm, a...@pythoncraft.com (Aahz) wrote:
> I'm curious why you went with FSEvents rather than kqueue. My company
> discovered that FSEvents is rather coarse-grained: it only tells you that
> there has been an event within a directory, it does *not* tell you
> anything about the chang
* Alan G Isaac [2009-07-19 14:46:12 +]:
> Again, my question is about the class not its instances,
> but still, checking as you suggest gives the same answer.
That's what I get for answering before my coffee!
Cheers,
--
Nicolas Dandrimont
"Linux poses a real challenge
ined classes are hashable, by id. You can
override this behaviour by defining the __hash__ special method on
your object.
HTH,
--
Nicolas Dandrimont
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Jul 15, 2009 at 12:39:48PM +0200, Nicolas Chauvat wrote:
> Here is the ticket:
> https://www.logilab.net/elo/ticket/9634
Apologies: http://www.logilab.org/ticket/9634
--
Nicolas Chauvat
logilab.fr - services en informatique scientifique et gestion de connaissances
--
by accessing the values
> from the dictionary returned by ‘vars()’.
> ...
You are not the only one:
http://lists.logilab.org/pipermail/python-projects/2009-July/thread.html
Here is the ticket:
https://www.logilab.net/elo/ticket/9634
Thanks for the report. As usual, help and patches are wel
e 'dict' as a variable name, as it shadows
the built-in 'dict'.
If you really want to obfuscate this, you could use:
my_dict = {1: 'astring', 2: 'anotherstring'}
print "\n".join('Press %i for %s' % (key, value) for key, value
* pyt...@bdurham.com [2009-02-16 00:48:34 -0500]:
> Nicolas,
>
> > I would go for something like:
> >
> > for char in word:
> > if char in 'aeiouAEIUO':
> > char_found = True
> > break
> > else:
> > char_fo
ent, see
http://docs.python.org/reference/compound_stmts.html#for)
It is clear (imo), and it is seems to be the intended idiom for a search
loop, that short-circuits as soon as a match is found.
Cheers,
--
Nicolas Dandrimont
linux: the choice of a GNU generation
(k...@cis.ufl.edu put this on Tshirts in '93)
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
Dear python developers,
I got no answer to my previous post on this thread "Pickling classes
(not class instances)".
This issue is a show stopper for our project. Any suggestion for where
to ask?
Thanks in advance!
Best regards,
e.
Is there a specific reason for this restriction?
Would it be thinkable to move up the copy reg dispatch before the
metaclass treatment in pickle and cPickle? I did it locally, and it
fixed my problem.
If not, what would be the right way to achieve this?
Many thanks in advance!
Best regards,
Hello,
I'm working on a script able to send email using DomainKey and DKIM.
For DKIM, it's working well (Thanks Greg - pydkim) but with DomainKey,
I have trouble. There is no library yet able to sign emails.
I tried to modify the pydkim library to implement DK but everything I
have a "sig fail".
Hello,
Do you know if there is a domainkey library for python ?
thanks
--
http://mail.python.org/mailman/listinfo/python-list
On 20 juil, 07:17, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Sat, 19 Jul 2008 13:13:40 -0700, nicolas.pourcelot wrote:
> > On 18 juil, 17:52, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> >> On Fri, 18 Jul 2008 07:39:38 -0700, nicolas.pourcelot wrote:
> >> > So, I use somethi
On 20 juil, 23:18, John Machin <[EMAIL PROTECTED]> wrote:
> On Jul 21, 4:33 am, [EMAIL PROTECTED] wrote:
>
> > > (1) You are searching through lists to find float objects by identity,
> > > not by value
>
> >
>
> You wrote """
> I used short lists (a list of 20 floats) and the element
> checke
> (1) You are searching through lists to find float objects by identity,
> not by value
--
http://mail.python.org/mailman/listinfo/python-list
On 18 juil, 17:52, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Fri, 18 Jul 2008 07:39:38 -0700, nicolas.pourcelot wrote:
> > So, I use something like this in 'sheet.objects.__setattr__(self,
> > name, value)':
> > if type(value) == Polygon:
> > for edge in value.edges:
> >
> What is your (concrete) use case, by the way?
I try to make it simple (there is almost 25000 lines of code...)
I have a sheet with geometrical objects (points, lines, polygons,
etc.)
The sheet have an object manager.
So, to simplify :
>>> sheet.objects.A = Point(0, 0)
>>> sheet.objects.B = P
On 18 juil, 13:13, Peter Otten <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > In fact, 'any(myobject is element for element in mylist)' is 2 times
> > slower than using a for loop, and 'id(myobject) in (id(element) for
> > element in mylist)' is 2.4 times slower.
>
> This is not a meanin
On 18 juil, 12:26, Peter Otten <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > I think something like
> id(myobject) in (id(element) for element in mylist)
> > would also work, also it's not so readable, and maybe not so fast
> > (?)...
>
> > An "is in" operator would be nice...
>
>
In fact, 'any(myobject is element for element in mylist)' is 2 times
slower than using a for loop, and 'id(myobject) in (id(element) for
element in mylist)' is 2.4 times slower.
--
http://mail.python.org/mailman/listinfo/python-list
On 18 juil, 11:30, Peter Otten <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Hi,
>
> > I want to test if an object IS in a list (identity and not equality
> > test).
> > I can if course write something like this :
>
> > test = False
> > myobject = MyCustomClass(*args, **kw)
> > for elem
Hi,
I want to test if an object IS in a list (identity and not equality
test).
I can if course write something like this :
test = False
myobject = MyCustomClass(*args, **kw)
for element in mylist:
if element is myobject:
test = True
break
and I can even write a isinlist(elt,
ot;post"
prepend(C.f,pre)
append(C.f,post)
C().f()
---
how comes that test() only outputs:
pre
f
rather than what I expected:
pre
f
post
Thanks very much in advance,
cheers,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
oted string" (e.g. 'foo' or "bar") is so named by
opposition to triple-quoted (e.g. '''foo''' or """bar""") strings.
Regards,
--
Nicolas Dandrimont
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
s. Is that a bug
> in the interpreter perhaps?
The fact is, that triple-quoted strings can span on multiple lines, and
that single-quoted strings cannot (without the line ending with a "\").
So no, it's not a bug in the interpreter.
Regards,
--
Nicolas Dandrimont
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
n
> order to produce the correct mathematical result.
Again, the mathematical result is correct. -123^0 is -(123^0), not
(-123)^0.
Regards,
--
Nicolas Dandrimont
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
2007/11/6, Nicolas.Chauvat <[EMAIL PROTECTED]>:
>
> Le Mon, 29 Oct 2007 20:39:29 -0700, sandipm a écrit:
>
> > seeing posts from students on group. I am curious to know, Do they teach
> > python in academic courses in universities?
>
> I am teaching assistant for the course
>
> http://www.etudes.ec
Default Gateway IP address using Python
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/162994import
win32api raise the error "module not exsit"and socket.gethostbyname(name)the router doesn't have a hostname.cheers ;)-- Nicolas GSkype: nicolasg_
mobile: +30 69 45 714 578
--
Hi all, I was just wondering if someone here had any experience with
some of these implementations of the snmp protocol?
pysnmp, libsnmp, snmpy.
Does anybody know of another implementation?
thanks in advance!!!
--
miya
--
http://mail.python.org/mailman/listinfo/python-list
or there is something better in mind ?
>
> is that webservice or webserver?
> if webservice try ZSI of it's a webserver why don't you try CherryPy?
> >
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
>
--
Nicolas G
mobile: +30 69 45 714 578
--
http://mail.python.org/mailman/listinfo/python-list
2006/8/22, Brian Beck <[EMAIL PROTECTED]>:
> Nicolas, check out the unicodedata module:
> http://docs.python.org/lib/module-unicodedata.html
>
> Find "import unicodedata" on this page for how to use it:
> http://www.amk.ca/python/howto/unicode
>
> I'
python? I mean, I give a character and python replys
me with the language in which the character occurs.
Thanks in advance
--
http://www.nicolas.pontoizeau.org/
Nicolas Pontoizeau - Promotion EFREI 2005
--
http://mail.python.org/mailman/listinfo/python-list
hi,
I am programming a filter for websites. to check if an
url is in the blacklist, i have used a csv file. i
have try to use sqlite but it looks as fast as csv
files.
Can you tell me if sqlite is faster than csv files ?
or not ?
thanks
_
Hi !
I'm trying to add the HTTP basic authentification to my web spider but
it doesn't work...
The HTTPBasicAuthHandler don't send the headers for authentification
:-(
Here is the code : http://devloop.lyua.org/releases/lswww_urllib2.py
def
__init__(self,rooturl,firsturl=[],forbidden=[],proxy={},
t would be nice not to put those ">>>" and "..." to make copy
> and paste easier. Okay, I know we can do "".join(line[4:] for line in
> text), but that's just my humble opinion.
>
Note that there's a "special paste" in wxPython PyShell, with which you
can copy/paste these lines.
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
ls one statement at a time.
The callable could have something like a __namespacetype__ that could be
use instead of dict. That type would have to implement __setitem__.
Regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
a patch and see what
> happens. I'll make a brief comment on it along the above lines, but
> since I'm not a committer, it's not really worth your time to try to
> convince me. ;)
I might do it, but even if I'm not a commiter, I'll continue trying to
convinc
Steven Bethard wrote:
> Nicolas Fleury wrote:
>
>> I was wondering if it would make sense to make staticmethod objects
>> callable, so that the following code would work:
>>
>> class A:
>> @staticmethod
>> def foo(): pass
>> bar =
Felipe Almeida Lessa wrote:
> Em Ter, 2006-02-28 às 15:17 -0500, Nicolas Fleury escreveu:
>
>>class A:
>> @staticmethod
>> def foo(): pass
>> bar = foo()
>
>
> # Why not:
>
> def foo(): pass
>
> class A:
> bar = foo()
&g
, but would it still make sense to implement
__call__ for that specific use case? Would it be error-prone in any way?
Thx and regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
ality and ease of use of their
built-in and third party libraries. I use C++ only for my core data
structure (namely a tuned version of a ternary search tree which I use
to build full text indices).
Regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
ise he could be charged of cheating by using a more
productive language :).
Regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
Josh wrote:
> We have a program written in VB6 (over 100,000 lines of code and
> 230 UI screens) that we want to get out of VB and into a better
> language. The program is over 10 years old and has already been
> ported from VB3 to VB6, a job which took over two years. We would
> like to port it t
1 : 5.315
Method 2 : 3.855
Method 3 : 7.815
Using dict.merge() : 1.425
So using generator expressions is a bad idea, and using the new
dict.merge() method gives an appreciable performance boost (~ x 3.73
here).
Regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
:
a = dict(a=1,c=3)
b = dict(a=0,b=2)
a.merge(b)
assert a == dict(a=1,b=2,c=3)
Does this seem a good idea to you guys ?
Regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
>On 26 Dec 2005 21:39:11 -0800, "Mondal" <[EMAIL PROTECTED]> declaimed
>the following in comp.lang.python:
>
>
>
>c=MySQLdb.Connect(host='localhost',user='root',passwd='',db='shop',port=3306)
>
>
>
> So what is that - doing in the port number
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
Peter Otten said:
> Here is a non-recursive approach:
>
> def tolist(arg):
>if isinstance(arg, list):
>return arg
>return [arg]
>
> def f(arg1, arg2, more_args):
>for arg1 in tolist(arg1):
>for arg2 in tolist(arg2):
># real code
>
> If it were my code I would
k about changing the recursive call too. Is there a way that
I can do a recursive call and say something like "keep all the same
arguments except this one" ?
Thanks
Nicolas
--
http://n0x.org/ - [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
On 29 Oct 2005 21:27:39 -0700, [EMAIL PROTECTED] wrote :
> http://pleac.sourceforge.net/ probably is what you're looking for. It
> shows how to to stuff from the perl cookbook in a plethora of other
> languages, including Python.
>
> Kind regards Terji Petersen
>
Hello,
As mentioned in the ori
Hello,
I'm looking (without success so far) for code sources for common
problems in different languages, but especially Python, C, Fortran, Ada
and Matlab.
It would help people coming from other languages to understand the
'python way of thinking'.
Priority is clean code, performance is not an i
Hello,
I'm trying to find a clear and fast equivalent to the index method of
plain python list :
>> a = [5,1,4,3,4]
>> a.index(4)
2
I have to use it on a Numeric array, so the best I've come up with is
(rather ugly I think) :
>> from Numeric import array, equal, nonzero
>> a = array([5,1,4,3,4])
de or
> writing an interface to existing optimize simulation code. Although
> most likely not suitable for your applicaion but a good example of
> this type of program is Mathematica. It is written in two parts a user
> interface and a kernel that does all of the high power math.
>
&g
n, fine, let's
do the entire thing in Python/C. If we decided to go for Simulink, fine,
let's do the whole thing in Simulink/Matlab/C. Matlab, for algorithms,
can do almost the same things than Python and sometimes much better, so
if you have already Simulink (and so have the license) why go for
Hello Phil,
I'm currently looking to see if I can build upon SimPy, thus making it
an hybrid system simulator. That would be a great step for the
community.
Main difficulty would be to build a framework which isn't clumsy, like
you said.
I have close to no experience in Python and object oriented
; Simulink is a framework widely used by the control engineers ...
> It is not *perfect* but the ODEs piece is probably the best
> part of the simulator. Why were you not convinced ?
>
> You may also have a look at Scicos and Ptolemy II. These
> simulators are open-source ... but
chanical systems to solving partial
> differentail equations.
>
> Howard
>
> Nicolas Pernetty wrote:
> > Hello,
> >
> > I'm looking for any work/paper/ressource about continuous system
> > simulation using Python or any similar object oriented lang
On Thu, 06 Oct 2005 22:30:00 -0700, Robert Kern <[EMAIL PROTECTED]>
wrote :
> Dennis Lee Bieber wrote:
> > On Fri, 7 Oct 2005 01:12:22 +0200, Nicolas Pernetty
> > <[EMAIL PROTECTED]> declaimed the following in
> > comp.lang.python:
> >
> > > I
Hello Phil,
Yes I have considered Octave. In fact I'm already using Matlab and
decided to 'reject' it for Python + Numeric/numarray + SciPy because I
think you could do more in Python and in more simple ways.
Problem is that neither Octave, Matlab and Python offer today a
framework to build conti
Hello,
I'm looking for any work/paper/ressource about continuous system
simulation using Python or any similar object oriented languages (or
even UML theory !).
I'm aware of SimPy for discrete event simulation, but I haven't found
any work about continuous system.
I would like to develop a generi
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
win32pipe.popen4()
>
> while win32pipe.popen() does almost what you want.
Have you tried subprocess?
Regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
Martin v. Löwis wrote:
> Nicolas Fleury wrote:
>
>>Well, I'm using the alternatives.
>
> Perhaps not to the full power.
Not perhaps, surely;) Who does anyway;)
> So you don't want to write the makeArrayType function, right?
>
> How about this:
&g
Bengt Richter wrote:
> On Mon, 08 Aug 2005 16:18:50 -0400, Nicolas Fleury <[EMAIL PROTECTED]> wrote:
>>I wrote the PEP to see if was the only one that would benefit from
>>generic types *before* having optional static typing in the language.
>>
>>It seems I'm
Bengt Richter wrote:
> On Sun, 07 Aug 2005 21:41:33 -0400, Nicolas Fleury <[EMAIL PROTECTED]> wrote:
>>I mean should angle brackets <> like in C++, or another operator, be
>>used instead?
>
> I am getting the feeling that your PEP is about a means to do somet
tic-like typing in frameworks
interacting with other languages with generic types. So I would already
benefit from such a capability, and yes, there's workarounds. I'm
clearly in a minority with such a need, but the first point fo the PEP
is to extend [] syntax, so that it is possible to prototype generic
types using [] operators.
Regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
in that case:
def makeType(a, b, c=someDefault):
arguments = locals()
class MyObject:
pass # Complete definition here
MyObject.__dict__.update(arguments)
return MyObject
Regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
In the end, it looks
very much like the mess in the example. Maybe I'm missing a solution
using decorators. I've defined a few classes like that, and I can live
with it, but having a syntax to do it more easily, I would use it right
away.
I guess it can also be useful for people interfacing with COM or typed
contexts.
Regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
list syntax as parenthesis calling trailer syntax.
I totally agree and that's what I mean. The formulation of the PEP is
wrong, I should almost not talk about __getitem__ since as you said it
can have any signature. The PEP is about extending [] syntax to call
automtically __getitem__ function with more complex signatures.
>>Should other operators that square brackets be used for
>>specialization?
>
> Didn't quite parse that ;-) You mean list comprehensions? Or ??
I mean should angle brackets <> like in C++, or another operator, be
used instead?
Regards and thx for your feedback,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
The PEP validity is also very much influenced if optional static typing
is planned to be added to the language. I realize defending this PEP is
much harder without static typing and my use cases imply typing of some
sort anyway.
Regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
Hi everyone, I would to know what do you think of this PEP. Any comment
welcomed (even about English mistakes).
PEP:XXX
Title: Specialization Syntax
Version:$Revision: 1.10 $
Last-Modified: $Date: 2003/09/22 04:51:49 $
Author: Nicolas Fleury
Status: Draft
Type
Finally i found the solution in Rpy-list : there is a bug in
python2.4-rpy_0.4.1.
An alternative solution which works fine it's to use the R get(str)
function instead of using directly the variable (i.e r.tab) like that :
r.get('tab')
This bug is fixed in the rpy_0.4.6 rele
Finally i found the solution in Rpy-list : there is a bug in
python2.4-rpy_0.4.1.
An alternative solution which works fine it's to use the R get(str)
function instead of using directly the variable (i.e r.tab) like that :
r.get('tab')
Nicolas Lebas a écrit :
> hello,
&g
Nicolas Lebas a écrit :
>hello,
>
>i don't know if this is the best list to send this question, but i'm
>already trying to ask.
>
>I need to import variables from .RData files (arrays or variables).
>I'm trying to use the rpy module, but without success
27;tab', '.Traceback', 'v']
> r.tab
segmentation fault !
I don't understand very well what does python crash.
If someone has an idea to solve my problem or to give me a method which
permit to import arrays and variables from .RData files with another module.
Thanks
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
hello,
i'm using actually pyqt 3.x to create several tools under linux.
I plan to propose those tools also for windows and mac os x under GPL
agreement.
My question is : does anybody know when pyqt 4 will be distributed ?
thanks
Nicolas
--
http://mail.python.org/ma
t;But is there a better way? A call which specifically checks if data
> is available?
Hello,
You might want to use select.select.
See http://effbot.org/librarybook/select.htm for an example with sockets.
Nicolas.
--
http://mail.python.org/mailman/listinfo/python-list
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:
ste with/without the
preceding >>>.
Regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
think however it is bad. Better solutions to me would be:
colour.setRgb(0, 255, 0)
or
c = myVeryLongNameColour
c.red = 0; c.blue = 255; c.green = 0
Regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
intercepted.
Oups, sorry, I tried it but wrote "raise exception" instead of "raise".
Yes, that's a very good idea indeed. I'll change to that.
Thx,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
original error. I
would like to avoid also writing in the caller something like
sys.exc_info()[-1].
Regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
doing z:
While doing y:
While doing x:
Test
I would like to know how to code the reraise function so that the lines
48, 50 and 52 don't appear in the stack. Is it possible?
Thx and regards,
Nicolas
--
http://mail.python.org/mailman/listinfo/python-list
Gruëzi, Gerald ;-)
Well, ok, but I don't understand why I should first convert a pure
unicode string into a byte string.
The encoding ( here, latin-1) seems an arbitrary choice.
Your solution works, but is it a workaround or the real way to use
strxfrm ?
It seems a little artificial to me, but pe
I am trying to use strxfm with unicode strings, but it does not work.
This is what I did:
>>> import locale
>>> s=u'\u00e9'
>>> print s
é
>>> locale.setlocale(locale.LC_ALL, '')
'French_Switzerland.1252'
>>> locale.strxfrm(s)
Traceback (most recent call last):
File "", line 1, in -toplevel-
ready there:
for x in :
BLOCK1
if :
ALSO-BLOCK
break
else:
BLOCK2
If find "else" fine, since the only times I used it is in searches:
for x in
BLOCK1
if : break
else:
raise Exception('Not found')
In that case, 'else' soun
1 - 100 of 127 matches
Mail list logo