[winreg] How to access "(Default)" key value?

2022-05-03 Thread Nicolas Formichella
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

Re: Typing on child class' methods of a Generic base class

2022-03-12 Thread Nicolas Haller
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

Typing on child class' methods of a Generic base class

2022-03-09 Thread Nicolas Haller
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

Re: my matplotlib realtime plot doesn't show the line between the points

2020-03-31 Thread Nicolas Marat
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

my matplotlib realtime plot doesn't show the line between the points

2020-03-31 Thread Nicolas Marat
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

Re: Pretty printing dicts with compact=True

2018-09-11 Thread Nicolas Hug
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

Pretty printing dicts with compact=True

2018-09-11 Thread Nicolas Hug
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

Re: SOAP and Zeep

2016-08-01 Thread Nicolas Évrard
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

Re: E-commerce system in Python

2016-03-23 Thread Nicolas Évrard
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

Which type should be used when testing static structure appartenance

2015-11-17 Thread Nicolas Évrard
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

Re: Migrate from Access 2010 / VBA

2012-11-29 Thread Nicolas Évrard
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

clicking on turtle

2012-11-06 Thread Nicolas Graner
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

Re: Which is the best implementation of LISP family of languages for real world programming ?

2010-06-12 Thread Nicolas Neuss
u compare "Scheme language" and "Clojure language", you don't see Clojure at all. Nicolas -- http://mail.python.org/mailman/listinfo/python-list

Re: First release of pyfsevents

2009-09-03 Thread Nicolas Dumazet
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

Re: are user defined classes hashable?

2009-07-19 Thread Nicolas Dandrimont
* 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

Re: are user defined classes hashable?

2009-07-19 Thread Nicolas Dandrimont
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

Re: [Python-projects] [TIP] Teaching pylint about keyword placeholders in string formatting

2009-07-15 Thread Nicolas Chauvat
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 --

Re: [TIP] Teaching pylint about keyword placeholders in string formatting

2009-07-15 Thread Nicolas Chauvat
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

Re: Can I replace this for loop with a join?

2009-04-13 Thread Nicolas Dandrimont
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

Re: Pythonic way to determine if one char of many in a string

2009-02-16 Thread Nicolas Dandrimont
* 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

Re: Pythonic way to determine if one char of many in a string

2009-02-15 Thread Nicolas Dandrimont
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

Re: Pickling classes (not class instances)

2009-02-14 Thread Nicolas M . Thiéry
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,

Pickling classes (not class instances)

2009-01-10 Thread Nicolas M . Thiéry
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,

Python and DomainKey

2008-12-26 Thread nicolas . delanos
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".

DomainKey library for python

2008-12-25 Thread Nicolas Delanos
Hello, Do you know if there is a domainkey library for python ? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if an object IS in a list

2008-07-21 Thread nicolas . pourcelot
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

Re: checking if an object IS in a list

2008-07-20 Thread nicolas . pourcelot
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

Re: checking if an object IS in a list

2008-07-20 Thread nicolas . pourcelot
> (1) You are searching through lists to find float objects by identity, > not by value -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if an object IS in a list

2008-07-19 Thread nicolas . pourcelot
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: > >        

Re: checking if an object IS in a list

2008-07-18 Thread nicolas . pourcelot
> 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

Re: checking if an object IS in a list

2008-07-18 Thread nicolas . pourcelot
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

Re: checking if an object IS in a list

2008-07-18 Thread nicolas . pourcelot
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... > >

Re: checking if an object IS in a list

2008-07-18 Thread nicolas . pourcelot
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

Re: checking if an object IS in a list

2008-07-18 Thread nicolas . pourcelot
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

checking if an object IS in a list

2008-07-18 Thread nicolas . pourcelot
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,

Wrapping a method twice

2008-06-25 Thread Nicolas Girard
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

Re: Python doesn't recognize quote types

2008-05-10 Thread Nicolas Dandrimont
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

Re: Python, are you ill?

2008-05-10 Thread Nicolas Dandrimont
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

Re: Mathematics in Python are not correct

2008-05-08 Thread Nicolas Dandrimont
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

Re: python in academics?

2007-11-08 Thread Nicolas DERAM
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

Re: Python to tell what is the IP of my PC .

2006-11-08 Thread Nicolas G
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 --

python and snmp

2006-09-18 Thread Nicolas Miyasato
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

Re: Python web service ...

2006-08-28 Thread Nicolas G
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

Re: unicode "table of character" implementation in python

2006-08-22 Thread Nicolas Pontoizeau
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'

unicode "table of character" implementation in python

2006-08-22 Thread Nicolas Pontoizeau
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

csv file or sqlite ?

2006-07-25 Thread frevol nicolas
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 _

HTTPBasicAuthHandler doesn't work

2006-07-09 Thread nicolas . surribas
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={},

Re: PEP 359: The "make" Statement

2006-04-14 Thread Nicolas Fleury
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

Re: PEP 359: The "make" Statement

2006-04-13 Thread Nicolas Fleury
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

Re: Make staticmethod objects callable?

2006-03-01 Thread Nicolas Fleury
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

Re: Make staticmethod objects callable?

2006-02-28 Thread Nicolas Fleury
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 =

Re: Make staticmethod objects callable?

2006-02-28 Thread Nicolas Fleury
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

Make staticmethod objects callable?

2006-02-28 Thread Nicolas Fleury
, 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

Re: Python vs C for a mail server

2006-01-28 Thread Nicolas Lehuen
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

Re: Python vs C for a mail server

2006-01-28 Thread Nicolas Lehuen
ise he could be charged of cheating by using a more productive language :). Regards, Nicolas -- http://mail.python.org/mailman/listinfo/python-list

Re: VB to Python migration

2006-01-27 Thread Nicolas Kassis
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

Re: Patch : doct.merge

2005-12-28 Thread Nicolas Lehuen
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

Patch : doct.merge

2005-12-27 Thread Nicolas Lehuen
: 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

Re: MySQLdb Python API: Unable to connect

2005-12-27 Thread Nicolas Kassis
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=330­6) > > > > So what is that - doing in the port number

Re: option argument length

2005-12-04 Thread Nicolas Couture
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

Re: recursive function call

2005-11-08 Thread Nicolas Vigier
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

recursive function call

2005-11-08 Thread Nicolas Vigier
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

Re: Examples of Python code compared to other languages

2005-10-30 Thread Nicolas Pernetty
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

Examples of Python code compared to other languages

2005-10-29 Thread Nicolas Pernetty
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

Numeric array equivalent of index ?

2005-10-14 Thread Nicolas Pernetty
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])

Re: Continuous system simulation in Python

2005-10-11 Thread Nicolas Pernetty
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

Re: Continuous system simulation in Python

2005-10-10 Thread Nicolas Pernetty
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

Re: Continuous system simulation in Python

2005-10-09 Thread Nicolas Pernetty
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

Re: Continuous system simulation in Python

2005-10-08 Thread Nicolas Pernetty
; 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

Re: Continuous system simulation in Python

2005-10-07 Thread Nicolas Pernetty
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

Re: Continuous system simulation in Python

2005-10-07 Thread Nicolas Pernetty
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

Re: Continuous system simulation in Python

2005-10-07 Thread Nicolas Pernetty
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

Continuous system simulation in Python

2005-10-06 Thread Nicolas Pernetty
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

Re: Basic Server/Client socket pair not working

2005-08-29 Thread Nicolas Couture
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

Re: win32pipe.popen3

2005-08-17 Thread Nicolas Fleury
win32pipe.popen4() > > while win32pipe.popen() does almost what you want. Have you tried subprocess? Regards, Nicolas -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP: Specialization Syntax

2005-08-09 Thread Nicolas Fleury
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

Re: PEP: Specialization Syntax

2005-08-08 Thread Nicolas Fleury
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

Re: PEP: Specialization Syntax

2005-08-08 Thread Nicolas Fleury
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

Re: PEP: Specialization Syntax

2005-08-08 Thread Nicolas Fleury
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

Re: PEP: Specialization Syntax

2005-08-08 Thread Nicolas Fleury
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

Re: PEP: Specialization Syntax

2005-08-07 Thread Nicolas Fleury
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

Re: PEP: Specialization Syntax

2005-08-07 Thread Nicolas Fleury
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

Re: PEP: Specialization Syntax

2005-08-07 Thread Nicolas Fleury
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

PEP: Specialization Syntax

2005-08-07 Thread Nicolas Fleury
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

Re: getting Arrays and variables from R

2005-07-30 Thread Nicolas Lebas
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

Re: getting Arrays and variables from R [fixed]

2005-07-27 Thread Nicolas Lebas
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

Re: getting Arrays and variables from R [fixed]

2005-07-27 Thread Nicolas Lebas
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

getting Arrays and variables from R

2005-07-26 Thread Nicolas Lebas
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

pyQT 4

2005-07-25 Thread Nicolas Lebas
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

Re: Data available on socket?

2005-07-22 Thread Nicolas
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

Re: Generating a list of None

2005-07-14 Thread Nicolas Couture
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

Generating a list of None

2005-07-14 Thread Nicolas Couture
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:

Re: Better console for Windows?

2005-06-27 Thread Nicolas Fleury
ste with/without the preceding >>>. Regards, Nicolas -- http://mail.python.org/mailman/listinfo/python-list

Re: Favorite non-python language trick?

2005-06-25 Thread Nicolas Fleury
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

Re: Reraise exception with modified stack

2005-06-23 Thread Nicolas Fleury
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

Re: Reraise exception with modified stack

2005-06-23 Thread Nicolas Fleury
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

Reraise exception with modified stack

2005-06-23 Thread Nicolas Fleury
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

Re: strxfrm works with unicode string ?

2005-06-17 Thread nicolas . riesch
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

strxfrm works with unicode string ?

2005-06-17 Thread nicolas . riesch
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-

Re: "also" to balance "else" ?

2005-06-15 Thread Nicolas Fleury
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   2   >