Re: SV: Changing the size of a Button

2008-03-09 Thread Marc 'BlackJack' Rintsch
. However, i'd like to assign these values to the button so it always stays the same width as the frame. Don't do it yourself, pack with the `fill` argument set to `Tkinter.X`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Classes and modules are singletons?

2008-03-06 Thread Marc 'BlackJack' Rintsch
() b1= o.someattr reload( o ) b2= o.someattr b1 is b2 ? You are really a bit thick, a troll, or a bot. *plonk* Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Can one get for x in y to work for non builtin classes?

2008-03-03 Thread Marc 'BlackJack' Rintsch
. The end will be signaled by an `IndexError`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: help needed with regex and unicode

2008-03-03 Thread Marc 'BlackJack' Rintsch
as ISO-8859-1. Sou you should decode `content` to unicode before searching the chinese characters. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: First post from a Python newbiw

2008-03-02 Thread Marc 'BlackJack' Rintsch
On Sun, 02 Mar 2008 14:15:09 +, Steve Turner wrote: Apart from doing something like a=[0,0,0] b=[0,0,0] c=[0,0,0] d=[a,b,c] is there a better way of creating d?? a = [[0] * 3 for dummy in xrange(3)] Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo

Re: First post from a Python newbiw

2008-03-02 Thread Marc 'BlackJack' Rintsch
On Sun, 02 Mar 2008 21:58:31 +0100, Christoph Zwerschke wrote: Marc 'BlackJack' Rintsch schrieb: On Sun, 02 Mar 2008 14:15:09 +, Steve Turner wrote: Apart from doing something like a=[0,0,0] b=[0,0,0] c=[0,0,0] d=[a,b,c] is there a better way of creating d?? a = [[0] * 3

Re: Is it possible to return a variable and use it...?

2008-03-02 Thread Marc 'BlackJack' Rintsch
what you expected and what you get instead. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Character Problem

2008-03-02 Thread Marc 'BlackJack' Rintsch
? Where does the program fail? With what exception(s)? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: How about adding rational fraction to Python?

2008-03-01 Thread Marc 'BlackJack' Rintsch
thinks `x` must be a `Fractional`, a subclass of `Num`. Then comes the third line with `length` returning an `Int` and the `Fractional` `x` but there is no implementation for a `+` function on those types. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python Unable to create file

2008-03-01 Thread Marc 'BlackJack' Rintsch
: the rights to create a file at `file_path`. Remember that web servers usually have their own user. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythons Ladders

2008-02-28 Thread Marc 'BlackJack' Rintsch
language against C#, D, or Java. ;-) What's the relevance of C#, D, or Java to the OP's post? The same as C++ to the OP's post if he would have talked about C. :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: XML expat error

2008-02-28 Thread Marc 'BlackJack' Rintsch
the tutorial in the docs, at least until section 8.3 Handling Exceptions: http://docs.python.org/tut/node10.html#SECTION001030 Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythons Ladders

2008-02-27 Thread Marc 'BlackJack' Rintsch
is to learn about the computer and that basically everything is a number in the end, then C is a good choice. More portable than assembler but nearly as close to the metal. To the OP: If you try C++, don't hold that crappy language against C#, D, or Java. ;-) Ciao, Marc 'BlackJack' Rintsch

Re: XML expat error

2008-02-27 Thread Marc 'BlackJack' Rintsch
to the top level and ending the program. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: How about adding rational fraction to Python?

2008-02-27 Thread Marc 'BlackJack' Rintsch
it to a float or not. Or you make Python into a statically typed language like Haskell. But then it's not Python anymore IMHO. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: dict.get and str.xsplit

2008-02-26 Thread Marc 'BlackJack' Rintsch
'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Article of interest: Python pros/cons for the enterprise

2008-02-26 Thread Marc 'BlackJack' Rintsch
to think about it and to write in that value style, because that goes against my expectations/picture of OOP -- a graph of independent/loosely coupled objects communicating with each other. In this sense C++ looks like a quite crippled and fragile OOP language to me. Ciao, Marc 'BlackJack

Re: How about adding rational fraction to Python?

2008-02-26 Thread Marc 'BlackJack' Rintsch
holds a CS degree. So why is it creepy then!? ``3 // 4`` is for the people knowing about integer division and ``3 / 4`` gives the expected result for those who don't. Those who don't know ``//`` can write ``int(3 / 4)`` to get the same effect. Ciao, Marc 'BlackJack' Rintsch -- http

Re: dict.get and str.xsplit

2008-02-26 Thread Marc 'BlackJack' Rintsch
On Tue, 26 Feb 2008 06:33:01 -0800, castironpi wrote: On Feb 26, 8:14 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Tue, 26 Feb 2008 06:02:12 -0800, bearophileHUGS wrote: This is a real difference, that has real impact on the programs I write, so I often use the if/else approach

Re: How about adding rational fraction to Python?

2008-02-26 Thread Marc 'BlackJack' Rintsch
, credits or license for more information. 3 / 4 0.75 Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: is there enough information?

2008-02-26 Thread Marc 'BlackJack' Rintsch
On Tue, 26 Feb 2008 09:13:35 -0800, castironpi wrote: Back home, the original post would be interesting, so I wrote it. So you think of this group as your personal notepad. That explains a lot. :-/ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Return value of an assignment statement?

2008-02-24 Thread Marc 'BlackJack' Rintsch
On Sat, 23 Feb 2008 22:44:30 +, Tim Roberts wrote: Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Fri, 22 Feb 2008 11:00:17 -0800, Aahz wrote: It's just too convenient to be able to write L += ['foo'] without rebinding L. nitpickBut ``+=`` does rebind./nitpick Usually

Re: Return value of an assignment statement?

2008-02-23 Thread Marc 'BlackJack' Rintsch
and it's rebound to the instance, or if they tried it on a list in a tuple. Extending a list that's a read only property doesn't work either. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple - looking for a way to do an element exists check..

2008-02-23 Thread Marc 'BlackJack' Rintsch
(although that's debatable), but it always traverses the entire list. The ``not in`` stops if the element is found. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Return value of an assignment statement?

2008-02-22 Thread Marc 'BlackJack' Rintsch
. In Python both belong to the value. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Acting like button are being pressed (BUT THEY ARE NOT) Please Help

2008-02-22 Thread Marc 'BlackJack' Rintsch
that it could use some loops to refactor it into a **much** shorter piece of code. Then get rid of the asterisk import, ``except``\s without a specific exception to handle, and the``global`` statement before you repost the problem. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman

Re: Getting python docstings

2008-02-22 Thread Marc 'BlackJack' Rintsch
language!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Return value of an assignment statement?

2008-02-22 Thread Marc 'BlackJack' Rintsch
On Fri, 22 Feb 2008 12:32:10 +, Steven D'Aprano wrote: On Fri, 22 Feb 2008 08:12:56 +, Marc 'BlackJack' Rintsch wrote: A variable in programming languages is composed of a name, a memory location, possibly a type and a value. In C-like languages, where you put values in named

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Marc 'BlackJack' Rintsch
++. ;-) But somehow you still manage memory by writing in a style that favors value types. SCNR, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the standard for code docs?

2008-02-20 Thread Marc 'BlackJack' Rintsch
learning phase. ;-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter Confusion

2008-02-17 Thread Marc 'BlackJack' Rintsch
effects. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: a question in python curses modules

2008-02-15 Thread Marc 'BlackJack' Rintsch
()` is called at all! So if you think this clean up is necessary to leave a usable console then don't put it into a `__del__()` method! Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: a question in python curses modules

2008-02-15 Thread Marc 'BlackJack' Rintsch
On Fri, 15 Feb 2008 15:10:12 +, Sion Arrowsmith wrote: Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: When the interpreter shuts down it has to remove objects. Everything you need in a `__del__()` method must be referenced by that object to be sure that it is still there and not already

Re: fromfunc functions

2008-02-13 Thread Marc 'BlackJack' Rintsch
, arg): : return func(arg) : In [19]: f(int, '42') Out[19]: 42 In [20]: f(str.split, 'a b c') Out[20]: ['a', 'b', 'c'] Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: ways to declare empty set variable

2008-02-12 Thread Marc 'BlackJack' Rintsch
On Tue, 12 Feb 2008 14:45:43 +0100, Sun wrote: then the question is how can I declare a empty set variable as a 'var= []' do to a list variable? You don't declare variables in Python. Just create an instance of `set` and bind it to a name: var = set() Ciao, Marc 'BlackJack' Rintsch

Re: __builtins__

2008-02-08 Thread Marc 'BlackJack' Rintsch
and I didn't find answers on the net... So the real question is, why you see 'math' in `__builtins__`. It should not be there. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Why not a Python compiler?

2008-02-08 Thread Marc 'BlackJack' Rintsch
defense. :-) http://en.wikipedia.org/wiki/Chewbacca_defense Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Why not a Python compiler?

2008-02-08 Thread Marc 'BlackJack' Rintsch
On Fri, 08 Feb 2008 05:12:29 -0800, Ryszard Szopa wrote: Expressing simple loops as C for loops... You mean simple loops like ``for i in xrange(1000):``? How should the compiler know what object is bound to the name `xrange` when that loop is executed? Ciao, Marc 'BlackJack' Rintsch

Re: beginner question, function returning object.

2008-02-07 Thread Marc 'BlackJack' Rintsch
. Is either of these examples supposed to work as shown? Is it clear that either example is obviously wrong? The second is wrong. The first should work if `self` and `PIPE` are bound to appropriate objects. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python

Re: getting all user defined attributes of a class

2008-02-06 Thread Marc 'BlackJack' Rintsch
? No and there can't be since the attributes you seem to be interested in don't exist until an instance is created. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: getting all user defined attributes of a class

2008-02-06 Thread Marc 'BlackJack' Rintsch
at the `inspect` module. What's the use case? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Elementary string-parsing

2008-02-05 Thread Marc 'BlackJack' Rintsch
On Tue, 05 Feb 2008 06:19:12 +, Odysseus wrote: In article [EMAIL PROTECTED], Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: Another issue is testing. If you rely on global names it's harder to test individual functions. [...] In programs without such global names you see quite

Re: Elementary string-parsing

2008-02-04 Thread Marc 'BlackJack' Rintsch
On Mon, 04 Feb 2008 09:43:04 +, Odysseus wrote: In article [EMAIL PROTECTED], Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: def extract_data(names, na, cells): found = dict() The problem with initializing the 'super-dictionary' within this function is that I want

Re: Unexpected timing results with file I/O

2008-02-04 Thread Marc 'BlackJack' Rintsch
time. That's what I meant by people going through the doors. Maybe it was more clear in my head. But my timing shows that method two is slower on my computer. So there is no obvious winner. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Unexpected timing results with file I/O

2008-02-04 Thread Marc 'BlackJack' Rintsch
: 18.085366010665894 I guess it's really all about the disk IO as my system monitor applet shows that almost all of the time is spend in the kernel and very little in user space. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Elementary string-parsing

2008-02-04 Thread Marc 'BlackJack' Rintsch
success or failure? All the data I want should all have been stored in the found dictionary by the time the function finishes traversing the list of names. Then create the `found` dictionary in that function and return it at the end. Ciao, Marc 'BlackJack' Rintsch -- http

Re: Unexpected timing results with file I/O

2008-02-04 Thread Marc 'BlackJack' Rintsch
door; push him through the door; close his door vs. for every person: open his door for every person: push him through the door for every person: close his door Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: future multi-threading for-loops

2008-02-04 Thread Marc 'BlackJack' Rintsch
change syntax. Why not simply writing a function? def execute_parallel(f, A): for args in A: start_new_thread(target=f, args=args) def f(x): normal_suit(x) parallel(f, A) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: extending python with array functions

2008-02-04 Thread Marc 'BlackJack' Rintsch
memory. To the OP: Since Python 2.5 the `ctypes` module is another way to interface with native code in dynamic libraries from the standard library. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Unexpected timing results with file I/O

2008-02-04 Thread Marc 'BlackJack' Rintsch
On Mon, 04 Feb 2008 21:58:46 +, Steven D'Aprano wrote: On Mon, 04 Feb 2008 17:08:02 +, Marc 'BlackJack' Rintsch wrote: Surprisingly, Method 2 is a smidgen faster, by about half a second over 500,000 open-write-close cycles. It's not much faster, but it's consistent, over many tests

Re: Elementary string-parsing

2008-02-04 Thread Marc 'BlackJack' Rintsch
] = m_abbrevs.index(dlist[1]) + 1``. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: psyco question

2008-02-03 Thread Marc 'BlackJack' Rintsch
`psyco.unbind()`? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Does anyone else use this little idiom?

2008-02-03 Thread Marc 'BlackJack' Rintsch
`range` vs. `xrange` but the arguments (1,n) vs. (n). Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Does anyone else use this little idiom?

2008-02-03 Thread Marc 'BlackJack' Rintsch
... return True ... while go(3): ... print 'hello' ... hello hello hello Please try: while go(3): while go(3): print 'Think about it...' Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode literals to latin-1

2008-01-30 Thread Marc 'BlackJack' Rintsch
'.decode('unicode-escape') Out[388]: u'Fr\xf8ya' In [389]: print 'Fr\u00f8ya'.decode('unicode-escape') Frøya Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing Pubic Hair Methods

2008-01-30 Thread Marc 'BlackJack' Rintsch
the way you wrote it with parentheses is a bit misleading. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing Pubic Hair Methods

2008-01-30 Thread Marc 'BlackJack' Rintsch
, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary Keys question

2008-01-30 Thread Marc 'BlackJack' Rintsch
is the hash of the identity of an object: In [415]: class A(object): pass .: In [416]: a = A() In [417]: hash(a) Out[417]: 161029068 In [418]: hash(id(a)) Out[418]: 161029068 Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: read and readline hanging

2008-01-28 Thread Marc 'BlackJack' Rintsch
the `pexpect` module might be a solution. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: optional static typing for Python

2008-01-28 Thread Marc 'BlackJack' Rintsch
be used for other things as well. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: A question about osyco

2008-01-28 Thread Marc 'BlackJack' Rintsch
of the second call. IIRC psyco needs at least one call to analyze the function, so the first call is not speed up. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: how to make format operator % work with unicode as expected

2008-01-27 Thread Marc 'BlackJack' Rintsch
. Are you sure you are qualified to ask such a question in the first place!? :-þ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting Large File (Code/Performance)

2008-01-27 Thread Marc 'BlackJack' Rintsch
. That was an allusion to a quote misattributed to Bill Gates about DOS: 640K ought to be enough for anybody. http://en.wikiquote.org/wiki/Bill_Gates#Misattributed Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Some questions about decode/encode

2008-01-27 Thread Marc 'BlackJack' Rintsch
to unicode string, what should I do to make SAX work? Decode it and then encode it to utf-8 before feeding it to the parser. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: translating Python to Assembler

2008-01-27 Thread Marc 'BlackJack' Rintsch
, not compiled to assembler. If you want to know how this happens get the C source code of the interpreter and don't waste your time with disassembling `python.exe`. C is much easier to read and there are useful comments too. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo

Re: translating Python to Assembler

2008-01-27 Thread Marc 'BlackJack' Rintsch
On Sun, 27 Jan 2008 11:23:20 +, over wrote: Don't fucking tell me about assembler, you asshole. I can read disassembled code in my sleep. Yes you can read it, but obviously you don't understand it. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python

Re: translating Python to Assembler

2008-01-27 Thread Marc 'BlackJack' Rintsch
Kruger and David Dunning, then both of Cornell University. Their results were published in the Journal of Personality and Social Psychology in December 1999. http://en.wikipedia.org/wiki/Dunning-Kruger_effect See, there's almost always a rational explanation. ;-) Ciao, Marc 'BlackJack

Re: how to make format operator % work with unicode as expected

2008-01-27 Thread Marc 'BlackJack' Rintsch
On Sun, 27 Jan 2008 16:00:42 +, Peter Pei wrote: Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sun, 27 Jan 2008 05:32:40 +, Peter Pei wrote: You didn't understand my question, but thanks any way. Yes, it is true that %s already support

Re: translating Python to Assembler

2008-01-26 Thread Marc 'BlackJack' Rintsch
(), but apparently not. Maybe `bytecodehacks`_ + `psyco`, or PyPy!? .. _bytecodehacks: http://sourceforge.net/projects/bytecodehacks/ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: When is min(a, b) != min(b, a)?

2008-01-25 Thread Marc 'BlackJack' Rintsch
'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: read and readline hanging

2008-01-25 Thread Marc 'BlackJack' Rintsch
more input? The subprocess in a purely passive position: it is an interpreter: I send it commands and I read the answers. The python side is in charge. This doesn't answer if the interpreter doesn't flush its output buffer after every line. Ciao, Marc 'BlackJack' Rintsch -- http

Re: is possible to get order of keyword parameters ?

2008-01-25 Thread Marc 'BlackJack' Rintsch
are unordered. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Some questions about decode/encode

2008-01-24 Thread Marc 'BlackJack' Rintsch
, not a decoded string. Don't decode it yourself. However, I use another text editor to convert the file to utf-8 and SAX will parse the content successfully. Because now you feed SAX with bytes instead of a unicode string. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman

Re: piping into a python script

2008-01-24 Thread Marc 'BlackJack' Rintsch
of: read from stdin. So the interface if `fui.py` would be: 1. ./fui.py *.a 2. ls *.a | ./fui.py - 3. ls *.a | ./fui.py *.b - Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Module/package hierarchy and its separation from file structure

2008-01-23 Thread Marc 'BlackJack' Rintsch
shoot down the idiomatic answer I guess. That's what most people do. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Stripping whitespace

2008-01-23 Thread Marc 'BlackJack' Rintsch
``lala.split()``: In [97]: lala = 'LNAME PASTA ZONE' In [98]: lala.split() Out[98]: ['LNAME', 'PASTA', 'ZONE'] Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: what's this instance?

2008-01-22 Thread Marc 'BlackJack' Rintsch
? where is it coming from? I'm totally confused on it.thanks. `oops` is bound to the `ValueError` or `TypError` object if `float()` raises such an exception. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Question on sort() key function

2008-01-22 Thread Marc 'BlackJack' Rintsch
, then foo = func; and foo = func(); have different meanings. It's just the same in Python. First is the function itself, second *calls* the function. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with 'global'

2008-01-21 Thread Marc 'BlackJack' Rintsch
in a source file. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: XOR encryption

2008-01-18 Thread Marc 'BlackJack' Rintsch
of the text is not read. You have to open the file in binary mode ('rb'/'wb') instead of text mode ('r'/'w') to stop Windows from interpreting the EOF character this way. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: super, decorators and gettattribute

2008-01-13 Thread Marc 'BlackJack' Rintsch
() and .__str__. Do you maybe know what's the rationale behind not following that convention by getattr? I think you are confusing `__getattr__` and `__getattribute__` here! `getattr()` maps to `__getattr__()`, it's `__getattribute__` that's different. Ciao, Marc 'BlackJack' Rintsch -- http

Re: encrypting python modules

2008-01-11 Thread Marc 'BlackJack' Rintsch
to the clients for execution. ;-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding python code into text document question.

2008-01-10 Thread Marc 'BlackJack' Rintsch
would be: use one of the many already existing templating systems. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: adding methods at runtime

2008-01-10 Thread Marc 'BlackJack' Rintsch
self as parameter. You are not adding a method but a function. Take a look at `types.MethodType()` to create a method from a function, instance, and class. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: problem of converting a list to dict

2008-01-09 Thread Marc 'BlackJack' Rintsch
=employee','meaningless'] In [103]: mydict={} In [104]: for i in mylist[1:-1]: .: a=i.split('=') .: mydict[a[0]]=a[1] .: In [105]: mydict Out[105]: {'mike': 'manager', 'paul': 'employee', 'tom': 'boss'} Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org

Re: Pet Store

2008-01-08 Thread Marc 'BlackJack' Rintsch
, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: popen question

2008-01-08 Thread Marc 'BlackJack' Rintsch
``slow`` unbuffered or line buffered. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: python syntax:urgent

2008-01-08 Thread Marc 'BlackJack' Rintsch
), str(results)) subprocess.Popen([s]) Here you are trying to start a program named gmmscore -i ... with no arguments. That fails (unless you really have a program with that name. ;-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Point Object

2008-01-05 Thread Marc 'BlackJack' Rintsch
that they match. The right direction would be the tutorial in the docs I guess: http://docs.python.org/tut/tut.html What do you mean by the hexadecimal form? `id()` returns ordinary `int`\s and not strings. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo

Re: wxpython application ( problem ? )

2008-01-02 Thread Marc 'BlackJack' Rintsch
On Wed, 02 Jan 2008 03:24:56 -0800, vedrandekovic wrote: Here is sample of my simple script with wxpython and modules: subprocess,threading, directpython... Are you accessing the GUI from threads? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python

Re: pdf library.

2008-01-01 Thread Marc 'BlackJack' Rintsch
. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: at what complexity, a comparison fails ?

2007-12-31 Thread Marc 'BlackJack' Rintsch
are considered equal. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Fate of itertools.dropwhile() and itertools.takewhile()

2007-12-30 Thread Marc 'BlackJack' Rintsch
), lines)) Maybe these functions usually don't turn up in code that can be called recipes so often but are useful for themselves. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: OOP: How to implement listing al 'Employees'.

2007-12-29 Thread Marc 'BlackJack' Rintsch
not be a class. Maybe a function returning `Article`\s would be enough. This is not Java, not everything has to be stuffed into classes. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Optional code segment delimiter?

2007-12-29 Thread Marc 'BlackJack' Rintsch
. ;-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Happy Christmas Pythoneers

2007-12-28 Thread Marc 'BlackJack' Rintsch
define it as person.is_appropriate_sex = True And sometimes it's not that simple but a property and connected with the caller's history of `champagne.drink()` calls. The `person.is_pretty` property is most definitely linked to that call history in many instances. Ciao, Marc 'BlackJack

Re: unicode(s, enc).encode(enc) == s ?

2007-12-28 Thread Marc 'BlackJack' Rintsch
characters. Just differently encoded as bytes. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange Behavior: csv module IDLE

2007-12-28 Thread Marc 'BlackJack' Rintsch
you need the parenthesis, otherwise you are just referencing it without any effect. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing by reference

2007-12-23 Thread Marc 'BlackJack' Rintsch
does the constructor make the array of strings available to the tokenize() method? Assuming the `__init__()` above belongs to the `Toker` class then the `tokenize()` method can access it via `self.text` of course. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo

Re: checking for negative values in a list

2007-12-17 Thread Marc 'BlackJack' Rintsch
On Mon, 17 Dec 2007 06:20:23 -0800, vimal wrote: i have a list of numbers say a = [1,-1,3,-2,4,-6] how should i check for negative values in the list In [6]: a = [1, -1, 3, -2, 4, -6] In [7]: any(n 0 for n in a) Out[7]: True Ciao, Marc 'BlackJack' Rintsch -- http

<    1   2   3   4   5   6   7   8   9   10   >