Re: Python vs. Lisp -- please explain

2006-02-19 Thread Alexander Schmolck
[EMAIL PROTECTED] writes: > Hi, I've been thinking about Python vs. Lisp. I've been learning > Python the past few months and like it very much. A few years ago I > had an AI class where we had to use Lisp, and I absolutely hated it, > having learned C++ a few years prior. They didn't teach Lis

Re: Python vs. Lisp -- please explain

2006-02-19 Thread Alexander Schmolck
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > DH a écrit : > (snip) > > It is by design. Python is dynamically typed. It is essentially an > > interpreted scripting language like javascript or ruby or perl, > > > It's not a "scripting" language, and it's not interpreted. Of course it is. Wh

Re: Python vs. Lisp -- please explain

2006-02-19 Thread Alexander Schmolck
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote: > > > What's far more interesting to me, however, is that I think there a good > > reasons to suspect python's slowness is more of a feature than a flaw: I'd > > n

Re: Python vs. Lisp -- please explain

2006-02-19 Thread Alexander Schmolck
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote: > > > You might want to argue about whether scriping language is a meaningful and > > useful concept, but it's really hard to see how you could talk about > > "scripting &g

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Alexander Schmolck
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote: > > > My point was that Guido probably (and fortunately!) was unaware of the > > extent > > to which you can have both dynamism and speed For the convenience of other readers, allow

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Alexander Schmolck
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > Alexander Schmolck a écrit : > > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > > > > >>DH a écrit : > >>(snip) > >> > >>>It is by design. Python is dynamically typed. It is

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Alexander Schmolck
"Donn Cave" <[EMAIL PROTECTED]> writes: > Quoth Alexander Schmolck <[EMAIL PROTECTED]>: > | "Fredrik Lundh" <[EMAIL PROTECTED]> writes: > ... > |> the only even remotely formal definition I've ever seen is "language with > |>

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Alexander Schmolck
Torsten Bronger <[EMAIL PROTECTED]> writes: > I was rather stunned, too, when I read his line of thought. > Nevertheless, I think it's not pointless, albeit formulated in an > awkward way. Of course, Python has not been deliberately slowed > down. Indeed -- and I'm really not sure what defect in

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Alexander Schmolck
"Kay Schluehr" <[EMAIL PROTECTED]> writes: > Alexanders hypothesis is completely absurd. You're currently not in the best position to make this claim, since you evidently misunderstood what I wrote (I certainly did not mean to suggest that Guido *deliberately* chose to make python slow; quite th

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Alexander Schmolck
"Michele Simionato" <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote: > > As common lisp and scheme demonstrate you can have high level of dynamism > > (and > > in a number of things both are more dynamic than python) and still get very > >

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Alexander Schmolck
"Michele Simionato" <[EMAIL PROTECTED]> writes: > I replied to this message yesterday, but it did not appear, so let's > try again. > > I agree with your points, but I would not say that Lisp is > intrinsically more dynamic than Python as a language; Neither would I -- I don't think either is ob

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Alexander Schmolck
Rocco Moretti <[EMAIL PROTECTED]> writes: > I think it's worth pointing out that not all dynamicism is equal, when it > comes to difficulty in compiling to machine code. No kidding (do you have any idea how this thread started out?). > Lisp, like the good functional language that it is, has (pri

Re: Searching for uniqness in a list of data

2006-03-01 Thread Alexander Schmolck
"rh0dium" <[EMAIL PROTECTED]> writes: > Hi all, > > I am having a bit of difficulty in figuring out an efficient way to > split up my data and identify the unique pieces of it. > > list=['1p2m_3.3-1.8v_sal_ms','1p2m_3.3-1.8_sal_log'] > > Now I want to split each item up on the "_" and compare i

Re: Searching for uniqness in a list of data

2006-03-01 Thread Alexander Schmolck
Alexander Schmolck <[EMAIL PROTECTED]> writes: > The easiest way to do this is to have a nested dictionary of prefixes: for > each prefix as key add a nested dictionary of the rest of the split as value > or an empty dict if the split is empty. Accessing the dict with an userinput

is there a python object which can interpret java-script?

2005-05-09 Thread Alexander Fillips
Hi, my short question: is there a python object which can interpret java-script? the whole story ;-) I wrote some streaming-scripts for the xbox mediaplayer which supports python. for a new script i tried to filter the stream-url from an website. it seems, that the site ist using java-script

Re: is there a python object which can interpret java-script?

2005-05-09 Thread Alexander Fillips
Kartic wrote: > The Great 'Alexander Fillips' uttered these words on 5/9/2005 7:34 AM: > >> Hi, >> >> my short question: >> >> is there a python object which can interpret java-script? >> >> the whole story ;-) >> >>

Re: Python Polymorphism

2005-05-13 Thread Alexander Schmolck
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Carlos Moreira wrote: > >> Supose that I want to create two methos (inside a >> class) with exactly same name, but number of >> parameters different: > > that's known as multimethods, or multiple dispatch. No -- multiple dispatch is something entirel

trouble with copy/deepcopy

2005-05-16 Thread Alexander Zatvornitskiy
dict() __ostatok_m=dict() ... def my_copy(self): d2=copy.deepcopy(self) d2.__gr_on_transp=self.__gr_on_transp.copy() d2.__ostatok_m=self.__ostatok_m.copy() return d2 It's work well, but I don't understand why previous is wrong and how to do it in right way. Alexand

trouble with copy/deepcopy

2005-05-17 Thread Alexander Zatvornitskiy
able is NOT shared between copies: class C: q=int() c1=C() c2=C() c1.q=5 c2.q=10 print c1.q #5 print c2.q #10 After deepcopy of c1 or c2, all classes have own copy of q. After replacing integer q on dictionary, results are the same. There is an error? Alexander, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

trouble with copy/deepcopy

2005-05-22 Thread Alexander Zatvornitskiy
Привет Mike! 17 мая 2005 в 16:38, Mike Meyer в своем письме к Alexander Zatvornitskiy писал: MM> Actually, it is shared - but only for reference. If you assign to it, MM> you'll create an instance variable of the same name. As Peter MM> explained, if you remove the instance varia

Re: regexp for sequence of quoted strings

2005-05-25 Thread Alexander Schmolck
gry@ll.mit.edu writes: > I have a string like: > {'the','dog\'s','bite'} > or maybe: > {'the'} > or sometimes: > {} > > [FYI: this is postgresql database "array" field output format] > > which I'm trying to parse with the re module. > A single quoted string would, I think, be: > r"\{'([^']|\\'

eric3 question

2005-05-30 Thread Alexander Zatvornitskiy
The questions are - how to fix it and how to ask user for press a key without troubles with eric? msvcrt.kbhit don't work also. Thank you in advance Alexander, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

eric3 question

2005-06-01 Thread Alexander Zatvornitskiy
ally much faster than asking on c.l.py, ML> although not educational for as many people... ;) Anyway, now you know that eric3 use (possibly) little bit buggy mechanism for redirection of input/output. It's cool:) Alexander, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

eric3 question

2005-06-01 Thread Alexander Zatvornitskiy
ine()=="q": >> smthing(else) FP> prompt = "enter q to quit, or smthing else to continue" FP> req = raw_input(prompt) FP> if req == "q": FP> raise SystemExit() FP> smthing(else) Thank you, raw_input works fine

Tackling setup.py - A bug??

2007-06-09 Thread Alexander Petrov
Clientmodule.o \ -Lp4api6.1 -lclient -lrpc -lsupp -o build/lib.macosx-10.3-ppc-2.5/ P4Client.so \ -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -framework Carbon Not quite the same but close enough. HERE is where the bug shows up If I rerun this same EXACT command at the command line - followed by a setup.py install it works. Can someone with a larger python brain than mine please help me figure this out? It's bugging the crap out fo me... -- BR. Alexander 'zowers' Petrov.jabber:[EMAIL PROTECTED]icq:69694782 http://zowers.googlepages.com/mailto:[EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-09 Thread Alexander Schmolck
Josiah Carlson <[EMAIL PROTECTED]> writes: > James Stroud wrote: >> Terry Reedy wrote: >>> In Python, you have a choice of recursion (normal or tail) >> >> Please explain this. I remember reading on this newsgroup that an advantage >> of ruby (wrt python) is that ruby has tail recursion, implying

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-10 Thread Alexander Schmolck
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 09 Jun 2007 22:42:17 +0100, Alexander Schmolck wrote: > >>> As for why tail calls are not optimized out, it was decided that being able >>> to have the stack traces (with variable information, etc.) was more

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-12 Thread Alexander Schmolck
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Mon, 11 Jun 2007 01:28:09 +0100, Alexander Schmolck wrote: > >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >> >>> On Sat, 09 Jun 2007 22:42:17 +0100, Alexander Schmolck wrote: >>> >>

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-12 Thread Alexander Schmolck
"Anders J. Munch" <[EMAIL PROTECTED]> writes: > Like Steven said, tail-call optimisation is not necessary as you can always > hand-optimise it yourself. Care to demonstrate on some code written in CPS (a compiler or parser, say)? 'as -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-25 Thread Alexander Schmolck
Douglas Alan <[EMAIL PROTECTED]> writes: >> Python has built-in abstractions for a few container types like >> lists and dicts, and now a new and more general one (iterators), so >> it's the next level up. > > Common Lisp has had all these things for ages. Rubbish. Do you actually know any common

Memory leak in PyQt application

2007-06-28 Thread Alexander Eisenhuth
h on closing QWindow. (QtCore.dll) - One thing I ask me is weather garbage collection is done in the PyQt main loop? What hints do you have to find the leak? Help is very very welcome Regards Alexander -- http://mail.python.org/mailman/listinfo/python-list

Decorating instance methods

2007-07-09 Thread Alexander Draeger
Hello everybody, I'm very interesting in using the decorator concept, but I can't convert it in useful things. I have read many about decorators and have seen a lot of examples, but I search a possibility, to decorate methods of classes with reference to the instances. For example: I have a class

Re: bool behavior in Python 3000?

2007-07-10 Thread Alexander Schmolck
Steven D'Aprano <[EMAIL PROTECTED]> writes: > I mean, really, does anyone *expect* True+True to give 2, or that 2**True > even works, without having learnt that Python bools are ints? I doubt it. Sure, why not? It's pretty damn useful. Ever heard of things like "indicator functions", "Iverson bra

Re: Tuple vs List: Whats the difference?

2007-07-11 Thread Alexander Schmolck
Shafik <[EMAIL PROTECTED]> writes: > Hello folks, > > I am an experienced programmer, but very new to python (2 days). I > wanted to ask: what exactly is the difference between a tuple and a > list? I'm sure there are some, but I can't seem to find a situation > where I can use one but not the oth

Re: bool behavior in Python 3000?

2007-07-12 Thread Alexander Schmolck
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Expressions like (i == j) used to return 0 and 1, and it was to avoid > breaking hacks like the above that bools were implemented as a subclass of > int, not because being able to write the above was a specific feature > requested. In the hypothetical

Re: [ANN] mlabwrap-1.0final

2007-04-22 Thread Alexander Schmolck
Stef Mientki <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote: > > I'm pleased to finally announce mlabwrap-1.0: > > Project website > > > --- > > <http://mlabwrap.sourceforge.net/> > > Description > > > --

Re: List objects are un-hashable

2007-04-27 Thread Alexander Schmolck
Andy <[EMAIL PROTECTED]> writes: > Hi, I'm trying to search and print any no# of Python keywords present > in a text file (say - foo.txt), and getting the above error. Sad for > not being able to decipher such a simple problem (I can come up with Without looking at the docs, it seems save to assu

Re: Emacs and pdb after upgrading to Ubuntu Feisty

2007-05-06 Thread Alexander Schmolck
levander <[EMAIL PROTECTED]> writes: > Anybody can tell me who to get pdb working under emacs on Ubuntu > Feisty? This is not a direct answer to your question, but I'd recommend you try ipython (apt-get'able) and ipython.el; (manual install). Just enter ``pdb on`` in the interactive shell to end

Re: Emacs and pdb after upgrading to Ubuntu Feisty

2007-05-08 Thread Alexander Schmolck
levander <[EMAIL PROTECTED]> writes: > Okay, thanks Alexander and Bernstein. I'll lookinto Emacs 23, but I'm > worried about compatibility with modes. Does all the stuff that works > in Emacs 21 work in 23? I've switched from 21 to 23 a few weeks ago and don&

Re: Designing a graph study program

2007-05-09 Thread Alexander Schliep
hich we would like to make available from our website. Full disclosure: I am the author of Gato Best, Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: Designing a graph study program

2007-05-10 Thread Alexander Schliep
andrea <[EMAIL PROTECTED]> writes: > On 9 Mag, 09:10, Alexander Schliep <[EMAIL PROTECTED]> wrote: >> Check outhttp://gato.sf.net(LGPL license). It does exactly what you >> want to do and there is a binary for MacOS X. Algorithms are implemented >> using G

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-13 Thread Alexander Schmolck
Jarek Zgoda <[EMAIL PROTECTED]> writes: > Martin v. Löwis napisał(a): > >> So, please provide feedback, e.g. perhaps by answering these >> questions: >> - should non-ASCII identifiers be supported? why? > > No, because "programs must be written for people to read, and only > incidentally for machi

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-13 Thread Alexander Schmolck
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > PEP 1 specifies that PEP authors need to collect feedback from the > community. As the author of PEP 3131, I'd like to encourage comments > to the PEP included below, either here (comp.lang.python), or to > [EMAIL PROTECTED] > > In summary, this PEP

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-14 Thread Alexander Schmolck
Neil Hodgson <[EMAIL PROTECTED]> writes: > Paul Rubin wrote: >>> Plenty of programming languages already support unicode identifiers, >> >> Could you name a few? Thanks. > >C#, Java, Ecmascript, Visual Basic. (i.e. everything that isn't a legacy or niche language) scheme (major implementat

Re: Lists vs tuples (newbie)

2007-05-21 Thread Alexander Schmolck
Szabolcs <[EMAIL PROTECTED]> writes: > Thanks for all the replies! > > Phoe6 wrote: >> 1) Return values from a function. When you return multiple values >> from a function. You store them as a tuple and access them >> individually rather then in the list, which bear the danger of being >> modifie

Re: matplotlib, usetex

2007-05-25 Thread Alexander Schmolck
Bill Jackson <[EMAIL PROTECTED]> writes: > > The problem does not exist when text.usetex is False. Ideas? I have no idea whether this will resolve your problem, but you could try updating to 0.90 (BTW what happens if you do axis([0,128,0,128])). cheers, 'as -- http://mail.python.org/mailman/l

Re: matplotlib, usetex

2007-05-27 Thread Alexander Schmolck
Bill Jackson <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote the following on 05/25/2007 02:33 PM: >> I have no idea whether this will resolve your problem, but you could try >> updating to 0.90 (BTW what happens if you do axis([0,128,0,128])). > > The p

PyQt: Is signal / slot really working across threads?

2007-05-29 Thread Alexander Eisenhuth
Hello pyqt users, i tried to use signal / slot across threads. With the following example I want to emit a signal when the thread loop is entered. The connected slot is never called. Why? Any help is very welcome ... Alexander import time import sys import PyQt4 from PyQt4.QtCore import

Re: PyQt: Is signal / slot really working across threads?

2007-05-29 Thread Alexander Eisenhuth
Ok, thanks. Phil Thompson schrieb: > On Tuesday 29 May 2007 11:58 am, Alexander Eisenhuth wrote: >> Hello pyqt users, >> >> i tried to use signal / slot across threads. With the following example I >> want to emit a signal when the thread loop is entered. The connec

Anyone else has seen "forrtl: error (200) ..."

2007-05-30 Thread Alexander Eisenhuth
MSC v.1310 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> raw_input() Traceback (most recent call last): File "", line 1, in KeyboardInterrupt >>> Any idea ? Thanks Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: Anyone else has seen "forrtl: error (200) ..."

2007-05-31 Thread Alexander Eisenhuth
an dll is loaded, a underlying software layer passes Ctrl+C to the fortran dll instead to python? (I can reproduce that in doing a ctrl+c while my script is currently at time.sleep(10) Thanks, Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 8 style enforcing program

2007-05-31 Thread Alexander Eisenhuth
g > spaces considered more desirable than using tabs for indentation? > Pylint is one of them (http://www.logilab.org/857) With spaces you get always the same len of the line, where tabs can use 2,4,8 spaces, dependingt on the settings of the IDE Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the "functional" way of doing this?

2007-08-01 Thread Alexander Schmolck
beginner <[EMAIL PROTECTED]> writes: > Hi, > > If I have a number n and want to generate a list based on like the > following: > > def f(n): > l=[] > while n>0: > l.append(n%26) > n /=26 > return l > > I am wondering what is the 'functional' way to do the same. Thi

Re: Fatest standard way to sum bytes (and their squares)?

2007-08-12 Thread Alexander Schmolck
Erik Max Francis <[EMAIL PROTECTED]> writes: > For a file hashing system (finding similar files, rather than identical ones), > I need to be able to efficiently and quickly sum the ordinals of the bytes of > a file and their squares. Because of the nature of the application, it's a > requirement

Re: Fatest standard way to sum bytes (and their squares)?

2007-08-13 Thread Alexander Schmolck
Erik Max Francis <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote: > >> Is this any faster? >> >> ordSum, orsSumSq = (lambda c:c.real,c.imag)(sum(complex(ord(x),ord(x)<<1) >> for x in data)) > > That's pretty clever, but I neglected to

Re: decorators - more than just syntactic sugar

2007-08-13 Thread Alexander Schmolck
Michele Simionato <[EMAIL PROTECTED]> writes: > On Aug 11, 8:30 pm, Helmut Jarausch <[EMAIL PROTECTED]> wrote: >> Hi, >> >> are decorators more than just syntactic sugar in python 2.x and what >> about python 3k ? > > Well, I argued may times that syntactic sugar is important (all Turing > complet

Re: Fatest standard way to sum bytes (and their squares)?

2007-08-13 Thread Alexander Schmolck
Alexander Schmolck <[EMAIL PROTECTED]> writes: > Erik Max Francis <[EMAIL PROTECTED]> writes: > >> Alexander Schmolck wrote: >> >>> Is this any faster? >>> >>> ordSum, orsSumSq = (lambda c:c.real,c.imag)(sum(complex(ord(x),ord(x)&

What does r"""any text""" mean ?

2007-08-15 Thread Alexander Eisenhuth
... as you can find in os.py at line 1 ? Regards Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: best GUI library for vector drawing program

2007-08-17 Thread Alexander Schmolck
[x-posts removed] chewie54 <[EMAIL PROTECTED]> writes: > I should have also mentioned that is for a commercial application. That > doesn't rule Qt or PyQt out, but this is a startup company with very little > income so my first choice would be to use some GUI library that is free to > use for comme

Re: Calling a matlab script from python

2007-09-05 Thread Alexander Schmolck
n o s p a m p l e a s e <[EMAIL PROTECTED]> writes: > Suppose I have a matlab script mymatlab.m. How can I call this script > from a python script? You could use . 'as -- http://mail.python.org/mailman/listinfo/python-list

Re: Class design (information hiding)

2007-09-07 Thread Alexander Eisenhuth
Bruno Desthuilliers schrieb: > Nope. It's either 'interface' (no leading underscore), 'implementation' > (single leading underscore), 'implementation with some protection > against accidental overriding' (two leading underscores). What do you mean with 'implementation'? What does it express? -

Class design (information hiding)

2007-09-07 Thread Alexander Eisenhuth
'_A__z', '__doc__', '__init__', '__module__', '_getX', '_z', 'doAnything', 'z'] I was a bit surprised about '_A__getY' and '_A__z'. What would you say to a C++ Programmer about class in

How to set docstrings for extensions supporting PyNumberMethods?

2007-03-03 Thread Nick Alexander
m on the wrong list, please let me know! Thanks, Nick Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: How to set docstrings for extensions supporting PyNumberMethods?

2007-03-04 Thread Nick Alexander
On Mar 4, 12:14 am, "Ziga Seilnacht" <[EMAIL PROTECTED]> wrote: > NickAlexanderwrote: > > Hello, > > > I am writing a python extension (compiled C code) that defines an > > extension type with PyNumberMethods. Everything works swimmingly, > > except I can't deduce a clean way to set the docstring

Howto pass exceptions between threads

2007-03-05 Thread Alexander Eisenhuth
he python docu, so I ask for the solutions, concepts, hints ... you solved the problem. Regards Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: Howto pass exceptions between threads

2007-03-06 Thread Alexander Eisenhuth
John Nagle schrieb: > Alexander Eisenhuth wrote: >> Hallo Alltogether, >> >> I've searched in this mailing list, but it seems to me that there is >> no general approach to pass exceptions from one thread to another. > >Very few languages have that. >

Re: Try to get help on pymat

2007-03-06 Thread Alexander Schmolck
"CHRIS CHEW" <[EMAIL PROTECTED]> writes: > I am trying to get my pymat to work. The Python script did not interface to > matlab yet. What are the required script to get the interface to work? Please > send me email at [EMAIL PROTECTED] You might want to have a look at . c

Howto find dict members from a list of keys

2007-03-08 Thread Alexander Eisenhuth
Hello, what algo do you use, when you want to find the dict values from d, with members of l. Following example: >>> d = {1:2,2:3,3:4,4:5,5:6,6:7,7:8,8:9,9:10} >>> l = [7,8] >>> found_dic_members = >>> print found_dict_members [8,9] Thanks Alexande

Re: Howto find dict members from a list of keys

2007-03-08 Thread Alexander Eisenhuth
Yes it was the silly on-liner ... it was a bit ago I used it last time ... thanks Gabriel Genellina schrieb: > En Thu, 08 Mar 2007 05:37:48 -0300, Steven D'Aprano > <[EMAIL PROTECTED]> escribió: > >> On Thu, 08 Mar 2007 05:26:22 -0300, Gabriel Genellina wrote: >> >>> found_dic_members = [d[key]

Re: Python equivalents to MATLAB str2func, func2str, ischar, isfunc?

2007-03-14 Thread Alexander Schmolck
"dmitrey" <[EMAIL PROTECTED]> writes: > I can't find these via web serch > > thank you in advance, > Dmitrey str2func: getattr(some_module, 'f') func2str: f.__name__ ischar: isinstance(x, basestring) and len(x) == 1 isfunc: callable(x) # is most likely to be what you want 'as -- http://mail.p

Re: Python equivalents to MATLAB str2func, func2str, ischar, isfunc?

2007-03-14 Thread Alexander Schmolck
"dmitrey" <[EMAIL PROTECTED]> writes: > Thank you > (however in MATLAB ischar is the same as isstr) Right, sorry. > but what if I don't know the name of module? > I.e. I have > > def myfunc(param): ... > #where param can be both funcName or a function, and I want to obtain > both name and func,

String formatting with fixed width

2007-03-16 Thread Alexander Eisenhuth
"%.03f" % f >>> s '21.100' But there are missing ' '. How can I get that? (For bigger numbers than 999 they might be cut: 1021 -> 021) Alexander -- http://mail.python.org/mailman/listinfo/python-list

String formatting with fixed width

2007-03-16 Thread Alexander Eisenhuth
"%.03f" % f >>> s '21.100' But there are missing ' '. How can I get that? (For bigger numbers than 999 they might be cut: 1021 -> 021) Thanks, Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: String formatting with fixed width

2007-03-16 Thread Alexander Eisenhuth
Thanks for your fast reply. I'm fine with your "%7.03f" solution. (negatives are not significant) Alexander Eisenhuth schrieb: > Hello alltogether, > > is it possible to format stings with fixed width of let's say 7 > character. T need a floating point with

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Alexander Schmolck
"Luis M. González" <[EMAIL PROTECTED]> writes: > On Mar 31, 8:38 am, Bjoern Schliessmann [EMAIL PROTECTED]> wrote: > > Mark Dufour wrote: > > > Shed Skin allows for translation of pure (unmodified), implicitly > > > statically typed Python programs into optimized C++, and hence, > > > >

Re: zip list with different length

2007-04-04 Thread Alexander Schmolck
[EMAIL PROTECTED] writes: C> hi > suppose i have 2 lists, a, b then have different number of elements, > say len(a) = 5, len(b) = 3 > >>> a = range(5) > >>> b = range(3) > >>> zip(b,a) > [(0, 0), (1, 1), (2, 2)] > >>> zip(a,b) > [(0, 0), (1, 1), (2, 2)] > > I want the results to be > [(0, 0), (1,

Re: zip list with different length

2007-04-04 Thread Alexander Schmolck
MC <[EMAIL PROTECTED]> writes: > Hi! > > Brutal, not exact answer, but: > > a = range(5) > b = range(3) > print zip(a+[None]*(len(b)-len(a)),b+[None]*(len(a)-len(b))) You reinvented map(None,a,b). 'as -- http://mail.python.org/mailman/listinfo/python-list

Re: String manipulation

2007-04-04 Thread Alexander Schmolck
All the code is untested, but should give you the idea. [EMAIL PROTECTED] writes: > Hi all! > > I have a file in which there are some expressions such as "kindest > regard" and "yours sincerely". I must create a phyton script that > checks if a text contains one or more of these expressions an

Re: String manipulation

2007-04-04 Thread Alexander Schmolck
Alexander Schmolck <[EMAIL PROTECTED]> writes: > That doesn't work. What about "kindest\nregard"? I think you're best of > reading the whole file in (don't forget to close the files, BTW). I should have written "that may not always work, depending of wh

Re: String manipulation

2007-04-04 Thread Alexander Schmolck
[EMAIL PROTECTED] writes: > Thank you very much, your code works perfectly! One thing I forgot: you might want to make the whitespace handling a bit more robust/general e.g. by using something along the lines of set_phrase.replace(' ', r'\w+') 'as -- http://mail.python.org/mailman/listinfo/p

Re: String manipulation

2007-04-05 Thread Alexander Schmolck
[EMAIL PROTECTED] writes: > On 4 Apr, 21:47, Alexander Schmolck <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] writes: > > > Thank you very much, your code works perfectly! > > > > One thing I forgot: you might want to make the whitespace handling a bit

Re: block scope?

2007-04-08 Thread Alexander Schmolck
Neal Becker <[EMAIL PROTECTED]> writes: > One thing I sometimes miss, which is common in some other languages (c++), > is idea of block scope. It would be useful to have variables that did not > outlive their block, primarily to avoid name clashes. This also leads to > more readable code. I h

Re: itertools, functools, file enhancement ideas

2007-04-08 Thread Alexander Schmolck
[EMAIL PROTECTED] (Alex Martelli) writes: > > 4. functools enhancements (Haskell-inspired): > >Let f be a function with 2 inputs. Then: > > a) def flip(f): return lambda x,y: f(y,x) > > b) def lsect(x,f): return partial(f,x) > > c) def rsect(f,x): return partial(flip(f), x)

[ANN] mlabwrap-1.0final

2007-04-11 Thread Alexander Schmolck
eedback and keep informed about new releases is mlabwrap-user: <https://lists.sourceforge.net/lists/listinfo/mlabwrap-user> the list is low-volume and subscription is recommended. Discussion of mlabwrap development takes place on the scipy-dev (please mention mlabwrap in the subject line):

Re: NLTK, Random Sentence Generators?

2007-04-12 Thread Oleg Alexander
On Apr 12, 4:36 am, Passer By <[EMAIL PROTECTED]> wrote: > James Stroud <[EMAIL PROTECTED]> writes: > > Passer By wrote: > > > James Stroud <[EMAIL PROTECTED]> writes: > > > >>Passer By wrote: > > > >>>Has any created or not of examples of random sentence generators > > >>>using n-gram models (or o

PyQt disconnect signal / slot

2007-09-25 Thread Alexander Eisenhuth
Hello PyQt experts, do i have to disconnect all signal/slots, after the emitting object is deleted, or does it the QObject destructor? Thanks Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt disconnect signal / slot

2007-09-25 Thread Alexander Eisenhuth
Phil, thanks for that quick reply Phil Thompson schrieb: > On Tuesday 25 September 2007, Alexander Eisenhuth wrote: >> Hello PyQt experts, >> >> do i have to disconnect all signal/slots, after the emitting object is >> deleted, or does it the QObject destructor? >

Heap problems in Mulithreaded Python extension

2007-02-01 Thread Alexander Eisenhuth
at happens is, that inside the extension (C++) from time to time _CrtIsValidHeapPointer(...) fails. Any comments/experience on "python and threaded extensions" is very welcome. Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: Heap problems in Mulithreaded Python extension

2007-02-01 Thread Alexander Eisenhuth
ok, once more my "scheme" python extension - import extension extension.init() ->PyEval_InitThreads(); setup 3 threads (pthreads) and do a lot of things, but no python api c

Build Python 2.5 wit VC6.0 ?

2007-02-02 Thread Alexander Eisenhuth
Hi everybody, does somebody have experience in building with VC6.0. On my first try there where missing C-Modules. Is that true. VC6.0 is not supported? Thanks a lot. Regards Alexander PC: What Python version supports VC6.0? -- http://mail.python.org/mailman/listinfo/python-list

Re: in place-ness of list.append

2007-02-05 Thread Alexander Schmolck
[EMAIL PROTECTED] writes: > > "Bart" == Bart Van Loon <[EMAIL PROTECTED]> writes: > > >> Such an operation will be O(N**2), > > Bart> why is that? > > The a[:] operation makes a copy of a (as will the x = a + [n] idiom). I'm pretty confident append itself (and a+[n]) are linear in

Re: in place-ness of list.append

2007-02-05 Thread Alexander Schmolck
Alexander Schmolck <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] writes: > > > >>>>> "Bart" == Bart Van Loon <[EMAIL PROTECTED]> writes: > > > > >> Such an operation will be O(N**2), > > > > Bart>

Re: Calling J from Python

2007-02-05 Thread Alexander Schmolck
[EMAIL PROTECTED] writes: > Gosi> J is in many ways similar to Python. > > Gosi> J has very many advanced operations. > > Gosi> http://www.jsoftware.com/ > > Doesn't look like open source of any variety. If a person uses Python with > various add-ons (RPy, numpy, matplotlib, etc) w

Re: Calling J from Python

2007-02-05 Thread Alexander Schmolck
Robin Becker <[EMAIL PROTECTED]> writes: > Dennis Lee Bieber wrote: > > On Mon, 05 Feb 2007 17:52:27 +0100, Bjoern Schliessmann > > <[EMAIL PROTECTED]> declaimed the following > > in comp.lang.python: > > > > >> Mh, just looking at some "advanced" J source taken from > >> wikipedia.org makes me f

Re: Calling J from Python

2007-02-05 Thread Alexander Schmolck
Larry Bates <[EMAIL PROTECTED]> writes: > And why is that superior to this: > > def avg(l): > return float(sum(l))/len(l) > > >>>avg([1,2,3,4]) > 2.5 Apart from being less to type and it is superior in that it's generalizes much better, e.g: avg&.^. NB. geomtric mean avg&.%NB. harmon

Re: Calling J from Python

2007-02-05 Thread Alexander Schmolck
Bjoern Schliessmann <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote: > > > Apart from being less to type > > Cool. Less to type. Yes. Readability is more important in many context, but for something designed for interactive experimentation and exploration lit

Re: Calling J from Python

2007-02-05 Thread Alexander Schmolck
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > No, thanks. But hopefully we have Python : > > Python 2.4.1 (#1, Jul 23 2005, 00:37:37) > [GCC 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. >

Re: Calling J from Python

2007-02-09 Thread Alexander Schmolck
[restoring context] "Ant" <[EMAIL PROTECTED]> writes: > > On Feb 6, 12:21 am, greg <[EMAIL PROTECTED]> wrote: > > > > Alexander Schmolck wrote: > > > For example I once wrote this (slow) code to display > > > part of a mandelbrot fractal: &

[ANN] wxCocoaDialog v0.3

2007-02-16 Thread Alexander Stigsen
wxCocoaDialog v0.3 http://code.google.com/p/wxcocoadialog/ wxCocoaDialog is an multi-platform port of the CocoaDialog application for OS X, that allows the use of common GUI controls such as file selectors, text input, progress bars, yes/no confirmations and more with a command-line applicatio

What is bad with "Relative imports"

2007-02-23 Thread Alexander Eisenhuth
--- __init__.py - import misc # provoke PyLint warning Player = misc.Player ... with Sound.Utils.Player() ?? Thaks for your experience and comments Regards Alexander -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   >