Re: maximum recursion depth?

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

Re: while-loop?

2008-05-28 Thread Marc 'BlackJack' Rintsch
in the tutorial at http://www.python.org/doc/. Assuming 'while' should work, what's wrong with the code? Obviously the condition is alway true. Maybe you have to do something within the loop so it eventually will be false at some point!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org

Re: recursion with or without return?

2008-05-25 Thread Marc 'BlackJack' Rintsch
a return value anyway because there's an implicit ``return None`` at the end of every function. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: which datastructure for fast sorted insert?

2008-05-25 Thread Marc 'BlackJack' Rintsch
On Sun, 25 May 2008 00:10:45 -0700, notnorwegian wrote: sets dont seem to be so good because there is no way to iterate them. Err: In [82]: for x in set(['a', 'b', 'c']): : print x : a c b Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo

Re: Assignment and comparison in one statement

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

Re: Assignment and comparison in one statement

2008-05-24 Thread Marc 'BlackJack' Rintsch
of `iter()`, or `itertools.takewhile()`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Relationship between GUI and logic?

2008-05-23 Thread Marc 'BlackJack' Rintsch
application). Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: csv iterator question

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

Re: simple way to touch a file if it does not exist

2008-05-22 Thread Marc 'BlackJack' Rintsch
you don't keep the value, it gets deallocated and closed by the destructor. The language neither guarantees *when* an object will be deallocated nor that its destructor is called *at all*. It's cleaner to explicitly close the file. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org

Re: Relationship between GUI and logic?

2008-05-22 Thread Marc 'BlackJack' Rintsch
and every time you want to inform the player about something, your game logic calls that function with the message. It doesn't have to know if it will be rendered as graphic on screen, displayed as text in a terminal, or synthesized as sexy female computer voice. Ciao, Marc 'BlackJack' Rintsch

Re: ctypes help

2008-05-22 Thread Marc 'BlackJack' Rintsch
compiled your C as C++ and name mangling kicked in? Can you show a minimal C source for a DLL, how you compiled it, what you did on the Python side to call it, and how it fails? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: getting dir(x), but not as list of strings?

2008-05-21 Thread Marc 'BlackJack' Rintsch
as their actual types? Take a look at the `inspect` module. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: test mult vars to same value, how to shorten expr?

2008-05-20 Thread Marc 'BlackJack' Rintsch
]: a, b, c, d = 5, 5, 5, 6 In [82]: all(x == 5 for x in (a, b, c)) Out[82]: True In [83]: all(x == 5 for x in (a, b, c, d)) Out[83]: False Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: this worked before...' '.join([`x x` for x in range(1, 6)])

2008-05-20 Thread Marc 'BlackJack' Rintsch
)]) File ipython console, line 1 ' '.join([`x x` for x in range(1, 6)]) ^ type 'exceptions.SyntaxError': invalid syntax The backticks are syntactic sugar for the `repr()` function and ``repr(x x)`` isn't legal syntax either. Ciao, Marc 'BlackJack

Re: Compress a string

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

Re: scaling problems

2008-05-20 Thread Marc 'BlackJack' Rintsch
, and supposedly cannot possibly interact. How should such collisions happen? You don't throw all your names into the same namespace!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: scaling problems

2008-05-20 Thread Marc 'BlackJack' Rintsch
On Tue, 20 May 2008 10:47:50 +1000, James A. Donald wrote: 2. It is not clear to me how a python web application scales. Ask YouTube. :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: AttributeError: module object has no attribute

2008-05-20 Thread Marc 'BlackJack' Rintsch
-- '/xyz/py/file' isn't even a legal identifier name in Python! Ciao, Marc 'BlackJack' Rintsch. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading Java byte[] data stream over standard input

2008-05-19 Thread Marc 'BlackJack' Rintsch
string length, Java type information, or checksums encoded in that data!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading Java byte[] data stream over standard input

2008-05-19 Thread Marc 'BlackJack' Rintsch
are writing then hadoop seems to throw in some information into the stream. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-19 Thread Marc 'BlackJack' Rintsch
'is', 'not' for everything else. That's wrong. Use ``==`` and ``!=`` for testing equality/inequality and ``is`` and ``is not`` for identity testing. And testing for identity is quite rare. Rule of thumb: Use it only for known singletons like `None`. Ciao, Marc 'BlackJack' Rintsch

Re: morning in Python

2008-05-18 Thread Marc 'BlackJack' Rintsch
!? And wasn't the city object bound to the name New Amsterdam once? :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Classmethods are evil

2008-05-16 Thread Marc 'BlackJack' Rintsch
. Writing meta classes just for alternative constructors seems to be more of a mess to me. Too much magic for such a simple case for my taste. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: no inputstream?

2008-05-15 Thread Marc 'BlackJack' Rintsch
of an MP3 file. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Literate programs in Python

2008-05-14 Thread Marc 'BlackJack' Rintsch
in both directions. .. _PyLit: http://pylit.berlios.de/ .. _reStructuredText: http://docutils.sourceforge.net/ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Is using range() in for loops really Pythonic?

2008-05-14 Thread Marc 'BlackJack' Rintsch
to the name `xrange` at runtime. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: anonymous assignment

2008-05-13 Thread Marc 'BlackJack' Rintsch
On Tue, 13 May 2008 03:25:51 +, Yves Dorfsman wrote: Marc 'BlackJack' Rintsch wrote: y, _, d, _, _, _, _, _, _ = time.localtime() But you still have have a variable that's using memory for nothing. I find this unsatisfactory... Get over it… Than what's the point of wanting

Re: Is using range() in for loops really Pythonic?

2008-05-13 Thread Marc 'BlackJack' Rintsch
this? This is the thing that baffles me the most about this thread. I do it (with a special name) because static source checkers issue a warning for unused variables. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Backslash frowned upon?

2008-05-13 Thread Marc 'BlackJack' Rintsch
On Tue, 13 May 2008 03:25:06 -0700, wxPythoner wrote: Why is the \ backslash character frowned upon? Is it frowned upon? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: anonymous assignment

2008-05-12 Thread Marc 'BlackJack' Rintsch
have a variable that's using memory for nothing. I find this unsatisfactory... Get over it… Or use `operator.itemgetter()`: In [36]: operator.itemgetter(0, 2)(time.localtime()) Out[36]: (2008, 12) :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Some error messages in Python are ugly

2008-05-11 Thread Marc 'BlackJack' Rintsch
the argument. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: People still using Tkinter?

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

Re: the lvalue curse? let's play with this crazy idea ;)

2008-05-09 Thread Marc 'BlackJack' Rintsch
(#{year}-#{month}-#{day} interpolate linePrint) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie to python --- why should i learn !

2008-05-08 Thread Marc 'BlackJack' Rintsch
Hello World programs: Counterexamples for quite short greetings in other programming languages: (Free)BASIC:: Print Hello World! OCaml:: print_string Hello World! ;; Io:: Hello World! linePrint Haskell:: main = putStrLn Hello World! Ciao, Marc 'BlackJack' Rintsch -- http

Re: Newbie to python --- why should i learn !

2008-05-08 Thread Marc 'BlackJack' Rintsch
On Thu, 08 May 2008 15:49:01 +0200, pistacchio wrote: Marc 'BlackJack' Rintsch ha scritto: On Thu, 08 May 2008 04:17:01 -0700, s0suk3 wrote: Are you a newbie to Python, or to programming in general? I'll assume you are a newbie to programming in general because of that last question you

Re: pickle problem

2008-05-08 Thread Marc 'BlackJack' Rintsch
lives in the operating system's space. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle problem

2008-05-08 Thread Marc 'BlackJack' Rintsch
On Thu, 08 May 2008 23:35:04 +0200, Hrvoje Niksic wrote: Marc 'BlackJack' Rintsch [EMAIL PROTECTED] writes: On Thu, 08 May 2008 08:55:35 -0700, krustymonkey wrote: The thing is, I'm not using slots by choice. I'm using the standard lib socket class, which apparently uses slots. `socket

Re: Truncate beginning of a file

2008-05-04 Thread Marc 'BlackJack' Rintsch
for reading, reading and processing, overwriting the file with the new processed data, etc.) No. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: is +=1 thread safe

2008-05-03 Thread Marc 'BlackJack' Rintsch
On Fri, 02 May 2008 19:23:54 +0100, Arnaud Delobelle wrote: Marc 'BlackJack' Rintsch [EMAIL PROTECTED] writes: There are no modern processors with an opcode for incrementing a memory location!? At least my C64 can do that. ;-) Indeed! I remember a simple use was to make the border

Re: pygame: rect moveto?

2008-05-03 Thread Marc 'BlackJack' Rintsch
:: rect.topleft = (x, y) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: generator functions in another language

2008-05-03 Thread Marc 'BlackJack' Rintsch
obviously there must be a way to write something like generators in C. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: no cleanup on TERM signal

2008-05-02 Thread Marc 'BlackJack' Rintsch
* that method to be called. Just like `finalize()` in Java, it can't be used for deterministic destruction, so it's not that useful after all. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: is +=1 thread safe

2008-05-02 Thread Marc 'BlackJack' Rintsch
, increment the register write the value into i. There are no modern processors with an opcode for incrementing a memory location!? At least my C64 can do that. ;-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: get number that is raised to the power of

2008-05-02 Thread Marc 'BlackJack' Rintsch
of a hack and I was wondering if there was a faster way of doing it? That hack isn't even working properly because ``str(10.0**1)`` has no '+' in its string representation. Solution: n = math.log(v, 10) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: creating a list from a inconsistent text file

2008-05-02 Thread Marc 'BlackJack' Rintsch
not inconsistent. How do I convert that line into a list? Use the `csv` module in the standard library. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: computing with characters

2008-04-30 Thread Marc 'BlackJack' Rintsch
*once* on string and unicode objects. Okay that's twice. :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help on left padding

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

Re: diffing and uniqing directories

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

Re: convert images

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

Re: removing extension

2008-04-27 Thread Marc 'BlackJack' Rintsch
]: ['foo/bar'] In [16]: os.path.splitext('foo/bar') Out[16]: ('foo/bar', '') Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting an attribute without calling __setattr__()

2008-04-26 Thread Marc 'BlackJack' Rintsch
the wanted information in the documentation, like John did, you are teaching the OP how to fish. Which is a good thing. Much more helpful than your remark anyway. You might as well have kept it to yourself. :-þ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo

Re: Little novice program written in Python

2008-04-25 Thread Marc 'BlackJack' Rintsch
at `itertools.islice()` if you want/need an iterator. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem using copy.copy with my own class

2008-04-22 Thread Marc 'BlackJack' Rintsch
On Tue, 22 Apr 2008 11:13:43 -0600, Jeffrey Barish wrote: By the way, I have simplified somewhat the code in the explanation. Please simplify the code to a minimal example that still has the problem and *show it to us*. It's hard to spot errors in code that nobody except you knows. --

Re: Conditional for...in failing with utf-8, Spanish book translation

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

Re: ???Python Memory Management S***s???

2008-04-20 Thread Marc 'BlackJack' Rintsch
instance though. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Help needed - I don't understand how Python manages memory

2008-04-20 Thread Marc 'BlackJack' Rintsch
and not bare names. In your `bar()` function it is completely unnecessary for example because the name `fd4` disappears right after that line anyway. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: vary number of loops

2008-04-16 Thread Marc 'BlackJack' Rintsch
. Untested: def foo(xs): if xs: for elt in xs[0]: for ys in foo(xs[1:]): yield [elt] + ys else: yield [] Called as ``foo([A, B])``. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: py3k s***s

2008-04-16 Thread Marc 'BlackJack' Rintsch
programmers will decide that using something other than python is a better coding practice. I've seen it happen. So the average quality of Python coders raises. Cool. ;-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Game design : Making computer play

2008-04-14 Thread Marc 'BlackJack' Rintsch
the `minimax method`_ for instance. .. _minimax method: http://en.wikipedia.org/wiki/Minimax Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Java or C++?

2008-04-14 Thread Marc 'BlackJack' Rintsch
On Mon, 14 Apr 2008 00:49:13 -0700, xakee wrote: Well if you need an easier transition, go for java. But personally i would recommend you to go for C/C++. What's that C/C++!? C and C++ are quite different languages. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman

Re: How to Choose an Unlimited Web Hosting for free

2008-04-13 Thread Marc 'BlackJack' Rintsch
spread the spam to those whose news servers filtered the original message. Thanks... Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter, image not appearing in function but without function

2008-04-13 Thread Marc 'BlackJack' Rintsch
to the `PhotoImage` instance goes out of scope. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter, overwrite Label-text?

2008-04-10 Thread Marc 'BlackJack' Rintsch
()` are a bad idea because the GUI may look odd or is even unusable on other peoples computers with other screen resolutions, fonts, and font sizes. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: I am worried about Python 3

2008-04-09 Thread Marc 'BlackJack' Rintsch
as smooth as possible as far as I can tell. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: PROBLEMS WITH PYTHON IN SOME VARIABLE,FUNCTIONS,ETC.

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

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-05 Thread Marc 'BlackJack' Rintsch
, text='1', command=lambda n=1: self.display(n)) # ... def display(self, number): print number Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: making buttons the same size?

2008-04-05 Thread Marc 'BlackJack' Rintsch
. Take a look at the options of the `grid()` call and figure out how to tell that the content of the cell should fill it, so that the Buttons in the grid automatically are equally sized in each row and column. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter, add pressed buttons onto string display string, how to?

2008-04-05 Thread Marc 'BlackJack' Rintsch
\calculatorGUI.py, line 92, in Display str = number + str UnboundLocalError: local variable 'str' referenced before assignment Just like the message says: You are trying to use `str` (on the right hand side of the assignment) before anything is bound to that name. Ciao, Marc 'BlackJack

Re: Prototype OO

2008-04-03 Thread Marc 'BlackJack' Rintsch
But one can tell because the way Python's syntax is based on indentation, no one has come up with a syntax for anonymous functions without the limitations of the current ``lambda``, that doesn't need 'curly braces' and is still as readable as Python is now. Ciao, Marc 'BlackJack

Re: Understanding bmp image files

2008-04-02 Thread Marc 'BlackJack' Rintsch
reverse that step? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: non-terminating regex match

2008-04-02 Thread Marc 'BlackJack' Rintsch
and then increase the identifier character by character and watch the time of the runs grow exponentially. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Homework help

2008-04-01 Thread Marc 'BlackJack' Rintsch
length lists and returns a list of pairs. For example, zip(['a', 'b', 'c'], [10, 20, 30]) should evaluate to the list [('a', 10), ('b', 20), ('c', 30)]. Hey not even a rebinding necessary. :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner advice

2008-03-31 Thread Marc 'BlackJack' Rintsch
* stupid disclaimer. :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: question

2008-03-31 Thread Marc 'BlackJack' Rintsch
on, don't let you scare away so easily. Put him in the filter list of your news client. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: standard input, for s in f, and buffering

2008-03-31 Thread Marc 'BlackJack' Rintsch
for `lines`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] troll poll

2008-03-31 Thread Marc 'BlackJack' Rintsch
of castironpi is just irritating noise. More specifically, who is more entertaining? (check one or none) [X] - Xah Lee [ ] - castironpi Castironpibot becomes boring very quickly. Especially when it starts to answer its own posts. Ciao, Marc 'BlackJack' Rintsch -- http

Re: Command line input

2008-03-31 Thread Marc 'BlackJack' Rintsch
On Mon, 31 Mar 2008 12:39:54 -0700, hexusnexus wrote: How do I receive input from the command line in Python? Direct way `sys.argv`, comfortable way `optparse`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with format string and unicode

2008-03-28 Thread Marc 'BlackJack' Rintsch
character), the length of the resulting string (in characters) varies. How can I fix this? Use unicode strings instead. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: case insensitive lstrip function?

2008-03-28 Thread Marc 'BlackJack' Rintsch
(chars.upper()) return s[len(s)-len(s2):] else: return s.lstrip(chars) What about this: def lstrip2(string, chars, ignore_case=True): if ignore_case: chars = chars.lower() + chars.upper() return string.lstrip(chars) Ciao, Marc 'BlackJack' Rintsch -- http

Re: Pickle: several class instance objects in one file?

2008-03-27 Thread Marc 'BlackJack' Rintsch
manual... Usually `pickle` just works. Those methods can be used if you want to customize the process, for example if you don't want to pickle the entire object but just parts of it. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Does python hate cathy?

2008-03-25 Thread Marc 'BlackJack' Rintsch
to wait until the garbage collector in CPython detects the cycle, you can use `weakref`\s for one of the two pointers in each element. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Circular references not being cleaned up by Py_Finalize()

2008-03-25 Thread Marc 'BlackJack' Rintsch
On Tue, 25 Mar 2008 12:32:17 -0700, blackpawn wrote: So what's the deal here? :) I want all objects to be freed when I shut down and their destruction functions to be properly called. Then you want something that's not guaranteed by the language. Ciao, Marc 'BlackJack' Rintsch

Re: Multiline CSV export to Excel produces unrecognized characters?

2008-03-24 Thread Marc 'BlackJack' Rintsch
like the return+linefeed line endings that Windows produces when writing files in text mode? Try 'wb' as mode for the output file. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: re.search (works)|(doesn't work) depending on for loop order

2008-03-22 Thread Marc 'BlackJack' Rintsch
not a good idea anyway because usually the files and the overhead of reading is greater than the time to iterate over in memory data like the patterns. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with PARAGRAPH SEPARATOR

2008-03-20 Thread Marc 'BlackJack' Rintsch
saying that the unicode 2029 can't be encoded... Can anyone please tell me how I should handle that paragraph seperator? You have to encode the unicode object in an encoding that know this character. UTF-8 might be a candidate encoding for this. Ciao, Marc 'BlackJack' Rintsch -- http

Re: backslash in reading bytes

2008-03-20 Thread Marc 'BlackJack' Rintsch
in string literals. If you don't want this meaning, you have to escape it with another backslash. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Prototype OO

2008-03-19 Thread Marc 'BlackJack' Rintsch
On Wed, 19 Mar 2008 17:59:40 +0100, sam wrote: Can someone tell me why class-based OO is better that Prototype based, especially in scripting langage with dynamic types as Python is? Is it better!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't xmlrpclib.dumps just dump an empty value instead of nil/?

2008-03-18 Thread Marc 'BlackJack' Rintsch
. The first one has an empty string value ('') while the second one pretty clearly says that there is a parameter but has no value. Why nil/? Because there is a difference between no value and the NULL value!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo

Re: Regarding coding style

2008-03-18 Thread Marc 'BlackJack' Rintsch
binary file that contains all sources and resources of the project. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3 and PEP238 division

2008-03-18 Thread Marc 'BlackJack' Rintsch
the result should be integer or float, independent of any particular set of arguments? Seems unlikely. The interpreter can at least print out warnings when a normal division operator is called with two `int`\s at runtime. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo

Re: Strange problem with structs Linux vs. Mac

2008-03-17 Thread Marc 'BlackJack' Rintsch
compact and readable: In [92]: sys.byteorder Out[92]: 'little' Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't xmlrpclib.dumps just dump an empty value instead of nil/?

2008-03-17 Thread Marc 'BlackJack' Rintsch
' Those are valid XML and valid XML-RPC, but nil/ isn't. In XML-RPC there is no `None`, so there's the non standard `allow_none` Option to allow `None` to be represented as ``nil/``. And is an empty param/ or value/ really valid XML-RPC? Ciao, Marc 'BlackJack' Rintsch -- http

Re: Unicode/UTF-8 confusion

2008-03-16 Thread Marc 'BlackJack' Rintsch
level of encoding/escaping producing something that is not JSON anymore, so why do you want to ask a JSON encoder to deliver it? This is a feature/function you should find in a HTML templating library. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: List mutation method gotcha - How well known?

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

Re: Handling global variables (Newbie)

2008-03-15 Thread Marc 'BlackJack' Rintsch
ran my script as a module in IDLE gui. How does _file_ get defined? Do you perhaps mean '__name__'? I guess not. It makes more sense to apply path functions to `__file__` than to `__name__`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: request for Details about Dictionaries in Python

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

Re: Unicode/UTF-8 confusion

2008-03-15 Thread Marc 'BlackJack' Rintsch
if are used to delimit the string. If ' are used as delimiters then \' is a correct escaping. What is the problem with that!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Class Inheritance

2008-03-13 Thread Marc 'BlackJack' Rintsch
On Thu, 13 Mar 2008 00:06:52 -0500, Andrew Rekdal wrote: Problem is layout_ext and Layout code is dependant on a Class instance 'css'. Then pass that instance to the `Layout` class in the `__init__()` so both, the base class and the subclass use the same `CSS` instance. Ciao, Marc

Re: How to port Python code into C++ code automatically?

2008-03-13 Thread Marc 'BlackJack' Rintsch
compile a subset of Python with optional static typing to C extension modules. .. _Cython: http://www.cython.org/ .. _Pyrex: http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: gc question

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

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