Re: lacking follow-through

2008-09-07 Thread Marc 'BlackJack' Rintsch
On Mon, 08 Sep 2008 07:34:55 +1000, James Mills wrote: This is the strangest post I've seen since I've joined this list (only recently). What the ? Yeah, castironpi sometimes doesn't make much sense. Maybe because it's a bot!? :-) Ciao, Marc 'BlackJack' Rintsch -- http

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-03 Thread Marc 'BlackJack' Rintsch
extras. ;-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-03 Thread Marc 'BlackJack' Rintsch
used on Windows under the hood is called `CreateProcess()` not `CreatePipe()`. How does Windows implement popen()? [I think they call it _popen() though...] Doesn't matter because the `Popen()` implementation doesn't use `popen()`. Ciao, Marc 'BlackJack' Rintsch -- http

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-03 Thread Marc 'BlackJack' Rintsch
On Wed, 03 Sep 2008 03:09:18 -0400, Derek Martin wrote: On Wed, Sep 03, 2008 at 06:40:10AM +, Marc 'BlackJack' Rintsch wrote: On Tue, 02 Sep 2008 19:54:12 -0400, Derek Martin wrote: And if they model an action there must be some way to activate the action That's a reasonable

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-02 Thread Marc 'BlackJack' Rintsch
://opengroup.org/onlinepubs/007908775/xsh/popen.html So it's a name of a *function* and it's a little bit unsuitable for a *class*. As Jeremy wrote: the instances represent *processes* not popens, whatever that may be. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python

Re: What is module initialization?

2008-09-02 Thread Marc 'BlackJack' Rintsch
`spam.egg` but just the local binding! Could some one provide me a sample code of module intialization? And how can I ensure that module initialization is done only once? Module initialization is only done once, there's nothing to ensure. Ciao, Marc 'BlackJack' Rintsch -- http

Re: what's the difference between f(a) and f(*a)

2008-09-02 Thread Marc 'BlackJack' Rintsch
On Tue, 02 Sep 2008 06:24:21 -0700, qxyuestc wrote: showed above: the result from sum1() and sum2() is the same. So, what is the difference between f(a) and f(*a) f(a) - f([1, 2, 3]) f(*a) - f(1, 2, 3) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-02 Thread Marc 'BlackJack' Rintsch
On Tue, 02 Sep 2008 09:28:42 -0400, Derek Martin wrote: On Tue, Sep 02, 2008 at 12:27:49PM +, Marc 'BlackJack' Rintsch wrote: The Python class is a generalization of the standard Posix function of (almost) the same name: http://opengroup.org/onlinepubs/007908775/xsh/popen.html So

Re: converting a sed / grep / awk / . . . bash pipe line into python

2008-09-02 Thread Marc 'BlackJack' Rintsch
) pairs = imap(extract_numbers, clean_lines) print '\n'.join(b for a, b in pairs if a + b == 42) if __name__ == '__main__': main() Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-02 Thread Marc 'BlackJack' Rintsch
On Tue, 02 Sep 2008 11:39:09 -0400, Derek Martin wrote: On Tue, Sep 02, 2008 at 01:57:26PM +, Marc 'BlackJack' Rintsch wrote: I would argue that they don't represent processes at all; the object is a set of files which connect the standard I/O streams of a subprocess to its parent

Re: Numpy/Scipy set field of matrix?

2008-09-02 Thread Marc 'BlackJack' Rintsch
of an image in a matrix. But I can't find the appropriate operations. Work through the tutorial in the Python documentation and read some introduction to Numpy. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Inquiry regarding the name of subprocess.Popen class

2008-09-02 Thread Marc 'BlackJack' Rintsch
called process but none called popen. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Know if a object member is a method

2008-09-01 Thread Marc 'BlackJack' Rintsch
this? The most pythonic? The most pythonic might be not checking at all but simply *call* the object and deal with possible failures. What's your use case? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0b2 cannot map '\u12b'

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

Re: Python 3.0b2 cannot map '\u12b'

2008-09-01 Thread Marc 'BlackJack' Rintsch
On Mon, 01 Sep 2008 14:25:01 -0400, Terry Reedy wrote: Marc 'BlackJack' Rintsch wrote: On Mon, 01 Sep 2008 02:27:54 -0400, Terry Reedy wrote: Most likely because Python figured out that the terminal expects cp437. What does `sys.stdout.encoding` say? The interpreter in the command prompt

Re: Lining Up and PaddingTwo Similar Lists

2008-08-29 Thread Marc 'BlackJack' Rintsch
of the entries in the directory. path: path of directory to list The list is in arbitrary order. It does not include the special entries '.' and '..' even if they are present in the directory. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo

Re: Problem with list.insert

2008-08-28 Thread Marc 'BlackJack' Rintsch
. Please stop numbering names and use *meaningful* names instead! Could you describe them problem better, with sample inputs and expected outputs. There must be a better way that that unreadable mess above. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python

Re: cannot find object instance

2008-08-28 Thread Marc 'BlackJack' Rintsch
just one module or factoring out something into a third module that is imported by both old modules. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: file data to list

2008-08-28 Thread Marc 'BlackJack' Rintsch
source code and specific questions. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: [Q] How to ignore the first line of the text read from a file

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

Re: Getting references to obect instances into a list

2008-08-27 Thread Marc 'BlackJack' Rintsch
as there is a reference to them. You deleted the name `p` and thus one reference to the list with the three characters but there's still the reference from the list bound to `q` to that three character list. What did you expect for an updated q anyway? Ciao, Marc 'BlackJack' Rintsch -- http

Re: generate methods at runtime, but the wrong one gets called

2008-08-25 Thread Marc 'BlackJack' Rintsch
sort of singletons in Python. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Struct class random access

2008-08-25 Thread Marc 'BlackJack' Rintsch
. Names for the components result in much easier to understand source code, so I would prefer to use `ctypes` or `construct` to create such a record. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Private attribute

2008-08-25 Thread Marc 'BlackJack' Rintsch
: @property def gridsize(self): return 0.8 Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: why in returns values for array and keys for dictionary

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

Re: Struct class random access

2008-08-25 Thread Marc 'BlackJack' Rintsch
On Mon, 25 Aug 2008 14:49:14 -0700, castironpi wrote: I'm interested in the speed benefit, so you don't have to reconstruct the entire 'record' just to read/write one 'field'. How in ctypes? Only the field accessed is converted. Ciao, Marc 'BlackJack' Rintsch -- http

Re: PEP 8: Byte Order Mark (BOM) vs coding cookie

2008-08-24 Thread Marc 'BlackJack' Rintsch
On Sun, 24 Aug 2008 07:28:53 -0700, twyk wrote: So is it good style to omit the BOM in UTF-8 for Python 3.0? I'd say yes because it is unnecessary with UTF-8 and it messes up the she- bang line of scripts. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python

Re: How to search the Python manuals

2008-08-23 Thread Marc 'BlackJack' Rintsch
the ``def`` statement is executed: http://docs.python.org/ref/function.html#l2h-634 Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: dropwhile question

2008-08-23 Thread Marc 'BlackJack' Rintsch
as the callable returns a true value and then it stops dropping. First value is 0 and ``2 0 5`` is `False` so nothing is dropped. What have you expected? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: exception handling in complex Python programs

2008-08-20 Thread Marc 'BlackJack' Rintsch
in maillist discussions. There's the glossary in the documentation: http://docs.python.org/tut/node18.html Look under 'duck-typing', 'EAFP', and 'LBYL'. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: exception handling in complex Python programs

2008-08-20 Thread Marc 'BlackJack' Rintsch
1, in module NameError: name 'file' is not defined Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Get parameters from the URL

2008-08-20 Thread Marc 'BlackJack' Rintsch
', '') In [50]: cgi.parse_qs(urlparse.urlparse(url)[4]) Out[50]: {'age': ['28'], 'userID': ['398']} But maybe you should read about the `cgi` module and how to use it. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: python custom command interpreter?

2008-08-20 Thread Marc 'BlackJack' Rintsch
On Wed, 20 Aug 2008 18:46:42 -0400, Derek Martin wrote: How so? What could be easier than rm -rf directory? C:\rm -rf directory Illegal command: rm. Hm. ;-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Good python equivalent to C goto

2008-08-17 Thread Marc 'BlackJack' Rintsch
' print 'stmt2' label .next print 'stmt3' print 'stmt4' Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Jason Orendorff's path module

2008-08-12 Thread Marc 'BlackJack' Rintsch
the Python package index: pypi.python.org Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: for x,y in word1, word2 ?

2008-08-11 Thread Marc 'BlackJack' Rintsch
for a, b in zip('painter', 'paintor') if a == b) Out[41]: 6 Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with global variables

2008-08-08 Thread Marc 'BlackJack' Rintsch
namespace. When you call `goo()` it binds the name `foo` *within the module* to a new list. This has of course no influence on the name in the IPython namespace which is still bound to the list object that was bound to `test.foo` before. Ciao, Marc 'BlackJack' Rintsch -- http

Re: regex question

2008-08-05 Thread Marc 'BlackJack' Rintsch
', '1.000.456.344') Out[13]: '1000456344' Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: very large dictionary

2008-08-01 Thread Marc 'BlackJack' Rintsch
a database instead of a dictionary? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible to have multiple loop variables?

2008-07-30 Thread Marc 'BlackJack' Rintsch
managed2 7020 8021 Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Rant (was Re: x*x if x10

2008-07-27 Thread Marc 'BlackJack' Rintsch
several. But I *do* know that taking the python zen literally is fruitless. I think it should be taken more literally than the wrong reduction to there should be only one way. People tend to forget obvious and preferably all the time. Ciao, Marc 'BlackJack' Rintsch -- http

Re: Attack a sacred Python Cow

2008-07-27 Thread Marc 'BlackJack' Rintsch
virtual? And what's etc.? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling external program from within python

2008-07-25 Thread Marc 'BlackJack' Rintsch
and the calling program can't influence the called programs buffering except if it pretends to be a terminal, which pexpect does. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Written in C?

2008-07-23 Thread Marc 'BlackJack' Rintsch
On Wed, 23 Jul 2008 14:10:22 +0200, mk wrote: Marc 'BlackJack' Rintsch wrote: I can't even remember when I deleted something from a list in the past. Still, doesn't that strike you as.. workaround? No, I find it actually safer; I don't have to care where modifications of the list might

Re: Python Written in C?

2008-07-23 Thread Marc 'BlackJack' Rintsch
On Wed, 23 Jul 2008 09:42:29 -0700, castironpi wrote: On Jul 23, 9:11 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Wed, 23 Jul 2008 14:10:22 +0200, mk wrote: Marc 'BlackJack' Rintsch wrote: I can't even remember when I deleted something from a list in the past. Still, doesn't

Re: Iterating Through List or Tuple

2008-07-22 Thread Marc 'BlackJack' Rintsch
(days_of_week)] For iterables in general: `itertools.cycle()` Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the role of python2.6 and C++?

2008-07-21 Thread Marc 'BlackJack' Rintsch
. You really should take that detour via 2.6. There should be some of the changes from 3.0 in 2.6 that don't mess with backwards compatibility, and a script that tries to automate the conversion from 2.6 to 3.0. This spares a lot of work when porting to 3.0. Ciao, Marc 'BlackJack' Rintsch

Re: Getting the name of a variable which was used as a function parameter.

2008-07-21 Thread Marc 'BlackJack' Rintsch
) == id(a): ... print k ... hello = 123 a(hello) hello ## pretty cool. Or ugly hack. Beauty lies in the eye of the beer holder… It's totally useless but I wanted to do it for logging purposes. Don't use such things in production code, please. Ciao, Marc 'BlackJack

Re: Python Written in C?

2008-07-21 Thread Marc 'BlackJack' Rintsch
needs a bit of work. Are you saying Python is not good for writing A.I., or the A.I. isn't good at writing Python? Are you saying python is not as smart as you. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: re: question

2008-07-20 Thread Marc 'BlackJack' Rintsch
On Sun, 20 Jul 2008 18:39:52 +0100, Perl_Wizard wrote: Nobody any sensible answers. Too complicated I suppose! I've often been asked that, i'd be able to buy me a mars bar! Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Question

2008-07-19 Thread Marc 'BlackJack' Rintsch
On Sat, 19 Jul 2008 10:27:28 +0100, perl_wizard wrote: Why is Perl so much better than python? You are so much better than python? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: MethodChain

2008-07-19 Thread Marc 'BlackJack' Rintsch
-yourself-clearly/ What's called `MethodChain` there seems to be function composition in functional languages. Maybe `functools` could grow a `compose()` function. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Change PC to Win or Windows

2008-07-19 Thread Marc 'BlackJack' Rintsch
, and some other CP/M systems. I never heard any of them called a 'PC'. My recollection is that 'PC' was a term that IBM coined. The C64 that still sits on my desk has a label on it saying “commodore 64 - personal computer”. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman

Re: MethodChain

2008-07-19 Thread Marc 'BlackJack' Rintsch
On Sat, 19 Jul 2008 13:57:33 -0700, bearophileHUGS wrote: Marc 'BlackJack' Rintsch: What's called `MethodChain` there seems to be function composition in functional languages. Maybe `functools` could grow a `compose()` function. To me it looks like a quite more refined thing, it's

Re: checking if an object IS in a list

2008-07-19 Thread Marc 'BlackJack' Rintsch
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 something like this in 'sheet.objects.__setattr__(self, name, value)': if type(value

Re: None in comparison

2008-07-18 Thread Marc 'BlackJack' Rintsch
to rely on such implementation details, your program is broken. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Question on Joining of list

2008-07-18 Thread Marc 'BlackJack' Rintsch
. In words, not in not very clear code with numbered names. That's a silly idea and makes understanding the code very hard. Please use meaningful names! Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expression help

2008-07-18 Thread Marc 'BlackJack' Rintsch
above in one line, but this seems clearer. ;-) I know it's a matter of taste but I think the one liner is still clear (enough):: values = dict(s.split('=') for s in line.split() if '=' in s) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if an object IS in a list

2008-07-18 Thread Marc 'BlackJack' Rintsch
of the extra redirection of an objects `__dict__`? Oh and the `type()` test smells like you are implementing polymorphism in a way that should be replaced by OOP techniques. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: __del__ methods

2008-07-18 Thread Marc 'BlackJack' Rintsch
forget about reliable automatic clean up. Do it yourself with an explicit call to a `close()` method or something like that. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: how to avoid line return when using python -c 'print foo'

2008-07-18 Thread Marc 'BlackJack' Rintsch
deciding for you that the last printed line before program exit should end in a newline. Use `sys.write()` instead of ``print``. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: __del__ methods

2008-07-18 Thread Marc 'BlackJack' Rintsch
can't make sure nothing slips between the cracks with it. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: properly delete item during for item in...

2008-07-17 Thread Marc 'BlackJack' Rintsch
words, is item a temporary reference to myList[itemIndex] or is it actually that reference that myList has stored? The latter. Names are always bound to objects, you can't bind a name to another name or reference in Python. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman

Re: Logging in __del__()

2008-07-16 Thread Marc 'BlackJack' Rintsch
with a `__del__()` implementation are not collected! Why are you using `__del__()` anyway? Are you aware of the promises that are *not* made! It's not guaranteed when the method is called nor if it is called at all! Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo

Re: Angle brackets in command-line arguments?

2008-07-16 Thread Marc 'BlackJack' Rintsch
of the shell you are using. Including ways to protect the characters, so they reach the called program in arguments. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Amazon: Practical Django Projects by James Bennett (June 2008)

2008-07-16 Thread Marc 'BlackJack' Rintsch
and stability. It's not uncommon in open source projects to have very usable software with a version number below 1.0. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: String flags - redundant?

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

Re: Python internals question

2008-07-15 Thread Marc 'BlackJack' Rintsch
of a pointer to a struct that represents the object. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator clone

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

Re: Problems with curses

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

Re: iterator clone

2008-07-13 Thread Marc 'BlackJack' Rintsch
generating a list with all results, and the advantage of a low memory footprint is lost. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create a timer/scheduler in Python?

2008-07-12 Thread Marc 'BlackJack' Rintsch
access the GUI from multiple threads. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: strip() using strings instead of chars

2008-07-11 Thread Marc 'BlackJack' Rintsch
://', 'https://')) I would prefer a name like `remove_prefix()` instead of a variant with `strip` and abbreviations in it. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Manipulating bitsets in struct

2008-07-09 Thread Marc 'BlackJack' Rintsch
bits? Perhaps something like: struct.pack('!h(2:1:4:9)',2,0,1,100) Take a look at Construct_ instead of `struct`. .. _Construct: http://construct.wikispaces.com/ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and decimal character entities over 128.

2008-07-09 Thread Marc 'BlackJack' Rintsch
of your choice. That's why UTF-8 might have been a good idea. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: re.search much slower then grep on some regular expressions

2008-07-07 Thread Marc 'BlackJack' Rintsch
?) How come, that you think so? The '#' is usually the prompt of root accounts while ordinary users get a '$'. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: compatible image type

2008-07-04 Thread Marc 'BlackJack' Rintsch
raised by `PhotoImage` if a non compatible file was selected!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Static Class Initialization Question.

2008-07-04 Thread Marc 'BlackJack' Rintsch
this: bla = [A(*args) for args in ((), (1,), (1, 2))] map(str, bla) ['A(0,1)', 'A(1,1)', 'A(1,2)'] Looks like you want default values for the arguments of `A.__init__()`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: n00bie wants advice.

2008-07-02 Thread Marc 'BlackJack' Rintsch
On Tue, 01 Jul 2008 23:25:53 -0700, bsagert wrote: This simple script writes html color codes that can be viewed in a browser. I used short form hex codes (fff or 000, etc) and my list has only six hex numbers otherwise the results get rather large. I invite criticism as to whether my code

Re: how to judge urllib.Request is finished?

2008-07-01 Thread Marc 'BlackJack' Rintsch
be raised by `urllib2`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Having problems using Tkinter

2008-07-01 Thread Marc 'BlackJack' Rintsch
in the `Toplevel` instance. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Error from zipfile

2008-07-01 Thread Marc 'BlackJack' Rintsch
as any other file into a string, then sends it across to a network where it is saved as perusual into a file, […] Are you sure you read and save the file in binary mode, especially on windows!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Please check my understanding...

2008-07-01 Thread Marc 'BlackJack' Rintsch
call last) /home/bj/ipython console in module() type 'exceptions.TypeError': 'int' object is not iterable See, both ways need something iterable. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Looping-related Memory Leak

2008-06-30 Thread Marc 'BlackJack' Rintsch
code? Would be my first guess. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing a path to components

2008-06-07 Thread Marc 'BlackJack' Rintsch
is repeated. For example r'\foo\\bar/baz//spam.py' or: In [140]: os.path.split('foo//bar') Out[140]: ('foo', 'bar') In [141]: 'foo//bar'.split(os.sep) Out[141]: ['foo', '', 'bar'] Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing a path to components

2008-06-07 Thread Marc 'BlackJack' Rintsch
On Sat, 07 Jun 2008 02:15:07 -0700, s0suk3 wrote: On Jun 7, 3:15 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Fri, 06 Jun 2008 23:57:03 -0700, s0suk3 wrote: You can just split the path on `os.sep', which contains the path separator of the platform on which Python is running

Re: Do this as a list comprehension?

2008-06-06 Thread Marc 'BlackJack' Rintsch
, 2, 3, 3])) print list(gen) Useless use of a generator expression. This: gen = itertools.izip(itertools.count(8), [0, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3]) print list(gen) has the same effect without the intermediate generator that does nothing but passing the items. Ciao, Marc 'BlackJack

Re: Python and Harry Potter?

2008-06-05 Thread Marc 'BlackJack' Rintsch
would've expected something with more magic, like Perl. :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Marc 'BlackJack' Rintsch
On Thu, 05 Jun 2008 08:21:41 +, Antoon Pardon wrote: On 2008-06-04, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Wed, 04 Jun 2008 09:34:58 +, Antoon Pardon wrote: On 2008-06-04, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: it makes sense to me to also test if they work

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Jun 2008 15:55:38 +1000, Ben Finney wrote: Marc 'BlackJack' Rintsch [EMAIL PROTECTED] writes: On Wed, 04 Jun 2008 13:50:42 +1000, Ben Finney wrote: It seems you [alex23] have a different idea of what unit testing is for from me. For me it's about finding bugs where

Re: readline() seek() ???

2008-06-04 Thread Marc 'BlackJack' Rintsch
()` to read the 256 byte records one at a time and string slicing to extract the data. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Jun 2008 09:34:58 +, Antoon Pardon wrote: On 2008-06-04, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: it makes sense to me to also test if they work as documented. If they affect the behaviour of some public component, that's where the documentation should be. As I

Re: Q about object identity

2008-06-03 Thread Marc 'BlackJack' Rintsch
()` with it • remember second id number • garbage collect second empty list • compare both numbers Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python not have a mechanism for data hiding?

2008-06-03 Thread Marc 'BlackJack' Rintsch
to the everybody, there *are* functions that rely on them working correctly. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing HTML

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

Re: Formatting Output

2008-06-02 Thread Marc 'BlackJack' Rintsch
will be actually FLOATs, not INTs. How can i do this ? Any help welcome. Regards, Look at string methods, `join()` for example, and string formatting with the ``%`` operator. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: php vs python

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

Re: Integrating a code generator into IDLE

2008-06-01 Thread Marc 'BlackJack' Rintsch
On Sun, 01 Jun 2008 10:40:09 -0500, Sam Denton wrote: Code generators seem to be popular in Python. I don't think so. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Flaming Thunder

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

Re: question

2008-05-30 Thread Marc 'BlackJack' Rintsch
flow harder to understand, the code more difficult to test, and usually couples functions more tightly then they should. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

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