Re: reading from sys.stdin

2007-04-14 Thread Marc 'BlackJack' Rintsch
? Not the whole file is read but a block of it. If you type in enough to fill the buffer the iteration can start without an EOF on `sys.stdin`. See the second example in [EMAIL PROTECTED] which demonstrates that not the whole file is read at once by the iterator. Ciao, Marc 'BlackJack

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-14 Thread Marc 'BlackJack' Rintsch
. And some modules are already imported before your module is imported because they are built-in or loaded to be able to import your module in the first place. And what about modules that are written in C? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: reading from sys.stdin

2007-04-13 Thread Marc 'BlackJack' Rintsch
x Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlite3 question

2007-04-12 Thread Marc 'BlackJack' Rintsch
an integer with the number of affected rows. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: No zlib in Python 2.4.4

2007-04-11 Thread Marc 'BlackJack' Rintsch
package installed? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: tuples, index method, Python's design

2007-04-11 Thread Marc 'BlackJack' Rintsch
. The homogeneous objects in lists must not be of the same type but share some behavior so it makes sense to apply some operation on all the elements. For example get the length of each item or sum them all up. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: menu drop down icons (inactive) look horrible in Windows Classic Theme

2007-04-10 Thread Marc 'BlackJack' Rintsch
shotty inactive icons in the Windows Classic Theme? ANY help appreciated. What the heck are you talking about? Tkinter? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Database in memory

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

Re: Managing a file buffer

2007-04-09 Thread Marc 'BlackJack' Rintsch
not without moving all following data down, but then the file pointer within `gstreamer` is wrong. Can't `gstreamer` be fed through a pipe? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess.Popen output to file?

2007-04-07 Thread Marc 'BlackJack' Rintsch
are used for. Untested: f = open('dump.txt', 'wb') p = Popen(('mysqldump', '--option', '--another-option'), stdout=f) r = p.wait() Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Storing of folder structure in SQL DB

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

Re: How can I time how much each thread takes?

2007-04-04 Thread Marc 'BlackJack' Rintsch
thread program? If you want wall time then use `time.time()` in the `run()` method of the threads to calculate the difference between start and end and set an attribute with the elapsed time on the `MyThread` objects. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman

Re: Parsing Problems

2007-04-03 Thread Marc 'BlackJack' Rintsch
but that you simply print the string representation of the list which does not meet your requirements. You want to join the list elements with a comma:: print 'supported=%s' % ','.join(ser) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: raw_input just continues anyway?

2007-04-03 Thread Marc 'BlackJack' Rintsch
()` is reading from `stdin` so the very first line you pipe in will be assigned to `bucket_name`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Clean Durty strings

2007-04-02 Thread Marc 'BlackJack' Rintsch
expressions: def main(): soup = BeautifulSoup(source, convertEntities=BeautifulSoup.HTML_ENTITIES) print ' '.join(''.join(soup(text=True)).split()) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Game programming for kids: looking for open source 2D game development kit

2007-03-30 Thread Marc 'BlackJack' Rintsch
behaviour to them. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: New to Python - Easy way to open a text file

2007-03-30 Thread Marc 'BlackJack' Rintsch
() if not line: break # do something with the line of text such as print it. f.close() f = open(r'pathToFile) for line in f: # do something with the line of text such as print it. f.close() Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Inserting '-' character in front of all numbers in a string

2007-03-30 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], kevinliu23 wrote: 2a 3ab into -2a -3ab. In [8]: '-' + ' -'.join('2a 3ab 4xy'.split()) Out[8]: '-2a -3ab -4xy' Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with class variables

2007-03-29 Thread Marc 'BlackJack' Rintsch
instance variable, not class variables. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to wait for string input

2007-03-29 Thread Marc 'BlackJack' Rintsch
( ) and msvcrt.getch( ). Is there something equivalent to wait for string inputs? The builtin `raw_input()`? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: encoding confusions

2007-03-29 Thread Marc 'BlackJack' Rintsch
make sense to encode a string in 'latin-1' because it must be decoded first and the automatic decoding assumes ASCII and barfs if there's something non-ascii in the string. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: shutil.copy Problem

2007-03-27 Thread Marc 'BlackJack' Rintsch
of this be? Shouldn't shutil simply be reading and writing the bytes and not character decoding them? Do you really get this error from the code above or just in the real program? Are the paths hard coded in the real program too? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman

Re: Fortran vs Python - Newbie Question

2007-03-27 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Mark Morss wrote: Well, the discussion was about Python vs. Fortran, and Pyrex, as I understand it, is a tool for linking C to Python. I think it's more than that. It's more a subset of Python with a little static typing. Ciao, Marc 'BlackJack' Rintsch -- http

Re: how to abort on syntax errors

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

Re: replace illegal xml characters

2007-03-21 Thread Marc 'BlackJack' Rintsch
? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: How to set SA_RESTART flag in Python

2007-03-21 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Marco wrote: I want to set SA_RESTART flag to restart a system-call. How to do this in Python? You question seems to lack a little bit context. Are you talking about system calls into the Linux kernel? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org

Re: How to copy a ClassObject?

2007-03-20 Thread Marc 'BlackJack' Rintsch
to make 'tmp' a copy of First, I tried using copy.copy and copy.deepcopy, but that doesn't work. P.S. Yes, I can do a: class tmp(First): pass but I'd rather make a copy than a subclass. Why? Python isn't a prototype based programming language. Ciao, Marc 'BlackJack

Re: check if files are the same on Windows

2007-03-19 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Beliavsky wrote: […] How should one check that files are the same in Python? The files are plain text. Take a look at the `filecmp` module. Pay attention to the shallow argument of `filecmp.cmp()` and the default value! Ciao, Marc 'BlackJack' Rintsch -- http

Re: Webcams and python

2007-03-18 Thread Marc 'BlackJack' Rintsch
`time.sleep()` into the loop. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: list comprehension help

2007-03-18 Thread Marc 'BlackJack' Rintsch
. And if the names give the right hints `db.sync()` may be a potentially expensive operation. Try to call it at a lower frequency if possible. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: list comprehension help

2007-03-18 Thread Marc 'BlackJack' Rintsch
forces the changes to be written to disks, so all caching and buffering of the operating system is prevented. So this may slow down the program considerably. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: To count number of quadruplets with sum = 0

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

Re: Mastering Python

2007-03-16 Thread Marc 'BlackJack' Rintsch
://www.diveintopython.org/ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: what are Python equivalent to MATLAB persistent or C++ static?

2007-03-15 Thread Marc 'BlackJack' Rintsch
): self.i_am_an_instance_attribute = 'Viking' And C++static local variables don't exist in Python. There are ways to emulate them with mutable default arguments, but that's at least debatable. Use a class instead. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickle Problem

2007-03-15 Thread Marc 'BlackJack' Rintsch
at 0xb5a3fd4c In [44]: x() Out[44]: __main__.DemoClass object at 0xb5a3fc2c You have to call the class object and the method to see any effects. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: dict.items() vs dict.iteritems and similar questions

2007-03-15 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], skip wrote: Are you sure? There's no guarantee that an iterator will terminate: len(list(itertools.cycle(range(10 You have infinite memory? ;-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: right-format of integer output as text

2007-03-15 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], dmitrey wrote: how can I implement this one in the simpliest way? Thank you in advance, In [45]: '%10d' % 1 Out[45]: ' 1' In [46]: '%10d' % 42 Out[46]: '42' In [47]: '%10d' % 1 Out[47]: ' 1' Ciao, Marc 'BlackJack' Rintsch -- http

Re: Grep Equivalent for Python

2007-03-14 Thread Marc 'BlackJack' Rintsch
(Memtotal:): name, amt, unit = line.split() print name, amt, unit break Of course it's cleaner to assign the file object to a name and close the file explicitly after the loop. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: question about class methods

2007-03-14 Thread Marc 'BlackJack' Rintsch
of an object. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: most complete xml package for Python?

2007-03-14 Thread Marc 'BlackJack' Rintsch
. So those editors have some problem with XML. I'm not impressed by such code. ;-) It's like complaining about: In [100]: '\x61' Out[100]: 'a' It's the same information, just a different representation. Both are within the specs. Ciao, Marc 'BlackJack' Rintsch -- http

Re: File locking

2007-03-12 Thread Marc 'BlackJack' Rintsch
but also on the file system in use. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: UTF-8 output problems

2007-03-10 Thread Marc 'BlackJack' Rintsch
refuses to guess. If an encoding could be determined the `sys.stdout.encoding` attribute is set to the name, otherwise it's `None`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: number generator

2007-03-10 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Raymond Hettinger wrote: On Mar 9, 7:32 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: In [EMAIL PROTECTED], cesco wrote: Given two positive integers, N and M with N M, I have to generate N positive integers such that sum(N)=M. No more constraints. Break

Re: number generator

2007-03-09 Thread Marc 'BlackJack' Rintsch
to generate (N-1) random numbers that add up to (M-X). You have to think a little bit about the suitable range part though. The necessary functions to draw random numbers are in the `random` module. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this right? Multiple imports of same module.

2007-03-09 Thread Marc 'BlackJack' Rintsch
). Is that right? Yes, that's correct. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help with a string plz! (newbie)

2007-03-09 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], israphelr wrote: So I created a program, that gets a string from a user and then prints the string in reverse order. In [57]: 'reversed string'[::-1] Out[57]: 'gnirts desrever' Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: splitting common functions into a sepperate module

2007-03-08 Thread Marc 'BlackJack' Rintsch
state/data and related functions into one object is a key concept of OOP. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: heapq.heappush and pop to use key

2007-03-08 Thread Marc 'BlackJack' Rintsch
) with the original `heapq` module. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: catching exceptions from an except: block

2007-03-07 Thread Marc 'BlackJack' Rintsch
CantDoIt -- Why do you think this is an abuse? I think it's a perfectly valid use of a loop. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: catching exceptions from an except: block

2007-03-07 Thread Marc 'BlackJack' Rintsch
by a `StopIteration` exception. Looks like flow control to me. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Building a dictionary from a tuple of variable length

2007-03-05 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], bg_ie wrote: Therefore, how do I build the tuple of Falses to reflect the length of my t tuple? In [1]: dict.fromkeys(('one', 'two', 'three'), False) Out[1]: {'three': False, 'two': False, 'one': False} Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org

Re: Dictionary of Dictionaries

2007-03-05 Thread Marc 'BlackJack' Rintsch
In [21]: a Out[21]: {'two': {'x': 42}, 'one': {'x': 42}} In [22]: a['one'] is a['two'] Out[22]: True Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: pop method question

2007-03-04 Thread Marc 'BlackJack' Rintsch
the ``+`` operator to return either an immutable or entirely new object, while `add()` can be something on containers that mutates the object. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple content-types break cgi.py

2007-03-04 Thread Marc 'BlackJack' Rintsch
. ;-) SCNR, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Perl and Python, a practical side-by-side example.

2007-03-03 Thread Marc 'BlackJack' Rintsch
and falseness. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Sort with extra variables

2007-03-03 Thread Marc 'BlackJack' Rintsch
% Compared to what? Compared to a sort that doesn't do what you want? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: class declaration shortcut

2007-03-01 Thread Marc 'BlackJack' Rintsch
way to give some information in stack traces or when doing introspection. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: class declaration shortcut

2007-03-01 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Bjoern Schliessmann wrote: Michele Simionato wrote: On Mar 1, 9:40 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] In [EMAIL PROTECTED], Bjoern Schliessmann But what's it (__name__) good for? As objects don't know to which name they are bound, that's a good way

Re: xml minidom redundant children??

2007-03-01 Thread Marc 'BlackJack' Rintsch
not interested to change xml file.) They have been created because the text is in the XML source. Line breaks are valid text. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Unpacking problem

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

Re: html sql client

2007-03-01 Thread Marc 'BlackJack' Rintsch
for the `description` attribute of cursors? Section `Cursor Objects`: http://www.python.org/dev/peps/pep-0249/ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: How to use cmp() function to compare 2 files?

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

Re: classobj?

2007-02-26 Thread Marc 'BlackJack' Rintsch
()['SomeClass'] vs. some_dict['SomeClass']) and you don't risk that some of your dynamically created classes overwrites an existing one with the same name. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: select which lib for iNet?

2007-02-25 Thread Marc 'BlackJack' Rintsch
also has APIs for such things that work cross platform it might be better to use those, because you can separate GUI and logic better. It's hard to replace the Qt libraries with a Gtk, wxPython or web GUI if you still need Qt for networking or database access. Ciao, Marc 'BlackJack' Rintsch

Re: RegExp performance?

2007-02-25 Thread Marc 'BlackJack' Rintsch
or after the ISBN, there just have to be at least one. BTW with the star it even matches *no* non-digit too! So the re looks like this: '\D(\d{10}|\d{9}X)\D' Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Rational numbers

2007-02-23 Thread Marc 'BlackJack' Rintsch
not expect changes to that package. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding non ascii characters in a set of files

2007-02-23 Thread Marc 'BlackJack' Rintsch
checkfile(filename): f = codecs.open(filename,encoding='ascii') try: for num, line in enumerate(f): pass except UnicodeError: print 'problem: line %d' % num f.close() Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python

Re: WHAT IS THIS?

2007-02-17 Thread Marc 'BlackJack' Rintsch
installing an uninstalling software is: If you don't know what it does and… 1. …it is not installed then don't install it. 2. …it is installed then don't uninstall it. Or things may break. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: WHAT IS THIS?

2007-02-17 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], James Stroud wrote: Better would be to remove windows xp and get another operating system. Yeah XP is sooo ooold, the OP should install Vista. Or did you mean a real OS instead of just another one? ;-) SCNR, Marc 'BlackJack' Rintsch -- http://mail.python.org

Re: why I don't like range/xrange

2007-02-16 Thread Marc 'BlackJack' Rintsch
no effect on the loop test. Which IMHO is a good thing. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: WHAT IS THIS?

2007-02-16 Thread Marc 'BlackJack' Rintsch
://effbot.org/pyfaq/installed-why-is-python-installed-on-my-machine.htm Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: reference data in a dictionary

2007-02-14 Thread Marc 'BlackJack' Rintsch
, but with a list comprehension:: result = [the_dict[key] for key in ('row1', 'row2', 'row3')] Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: How to access an absolute address through Python?

2007-02-11 Thread Marc 'BlackJack' Rintsch
* memory address unless you run DOS. Modern operating systems tend to use some virtualisation of memory. :-) What's your goal? What do you expect at the memory address you want to access? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Glob returning an empty list when passed a variable

2007-02-10 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: With some number: In [2]: % 3s % 'a' Out[2]: ' a' The space still doesn't have any effect here: In [66]: %3s % 'a' Out[66]: ' a' Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python for me?

2007-02-08 Thread Marc 'BlackJack' Rintsch
/Cookbook/Python/Recipe/415504 And a library called `poker-eval` with Python bindings: http://pokersource.org/ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Regexp not performing the same in FTP versus Python

2007-02-08 Thread Marc 'BlackJack' Rintsch
]: fnmatch.translate('.??[oOdDnNmM]*') Out[8]: '\\...[oOdDnNmM].*$' Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting a class name from within main

2007-02-07 Thread Marc 'BlackJack' Rintsch
of printing it from within the main without creating an object of the MyClass type. I need to assign the name of the class within my script, to a variable in main. Yes:: print MyClass.__name__ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling J from Python

2007-02-07 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Gosi wrote: I like to use J for many things and I think that combining Python and J is a hell of a good mixture. I was able to follow this sentence up to and including the word hell… :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo

Re: Inheriting str object

2007-02-05 Thread Marc 'BlackJack' Rintsch
'hello WORLD', but s is no longer myStr, it's a regular str! What can I do? Return a `myStr` instance instead of a regular `str`: def hello(self): return myStr('hello ' + self) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: C parsing fun

2007-02-05 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], karoly.kiripolszky wrote: and the great thing is that the algorithm can be used with any language that structures the code with brackets, like PHP and many others. But it fails if brackets appear in comments or literal strings. Ciao, Marc 'BlackJack' Rintsch

Re: confused about resizing array in Python

2007-02-04 Thread Marc 'BlackJack' Rintsch
like Python's list type. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Where Does One Begin?

2007-02-04 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: On Feb 3, 2:16 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: In [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: pygame is probily a good program to start with as long as you keep in mind that it is possible that up to 50% of the p.c

Re: Where Does One Begin?

2007-02-03 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: pygame is probily a good program to start with as long as you keep in mind that it is possible that up to 50% of the p.c. laptops may not be able to run it. Huh? Care to explain this? Ciao, Marc 'BlackJack' Rintsch -- http

Re: HELP NEEDED ... Regd. Regular expressions PyQt

2007-02-03 Thread Marc 'BlackJack' Rintsch
without a regular expression. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining encoding of a file

2007-02-03 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Tony Houghton wrote: In Linux it's possible for filesystems to have a different encoding from the system's setting. Given a filename, is there a (preferably) portable way to determine its encoding? No. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org

Re: division by 7 efficiently ???

2007-02-01 Thread Marc 'BlackJack' Rintsch
operator operator.div(14, 7) :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: division by 7 efficiently ???

2007-02-01 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Krypto wrote: The correct answer as told to me by a person is (N3) + ((N-7*(N3))3) How could it be correct if it uses `-`? You ruled out `-` and `/` in your first post. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Random passwords generation (Python vs Perl) =)

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

Re: another newbie question: why should you use *args ?

2007-01-31 Thread Marc 'BlackJack' Rintsch
. for args in zip(list[1:], color[1:]): plot(*args) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Help me understand this

2007-01-30 Thread Marc 'BlackJack' Rintsch
the integer literal and the dot operator works too: In [1]: 2 .__add__(1) Out[1]: 3 Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: decode overwrite variable?

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

Re: import from future

2007-01-28 Thread Marc 'BlackJack' Rintsch
.with_statement _Feature((2, 5, 0, 'alpha', 1), (2, 6, 0, 'alpha', 0), 32768) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: python+ncurses: I can't display accents

2007-01-27 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Fabrice DELENTE wrote: As support for 8-bit (and even unicode) is important for my script, is there any hope? Should I switch to slang instead of curses? Take a look at urwid: http://excess.org/urwid/ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org

Re: import from future

2007-01-27 Thread Marc 'BlackJack' Rintsch
Out[5]: _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192) In [6]: help(__future__) snipped help output Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on using isinstance

2007-01-24 Thread Marc 'BlackJack' Rintsch
a list or dictionary but some object that *acts* like a list or dictionary. Or you even expect just some aspects of the type's behavior. For example that it is something you can iterate over. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: raise UnicodeError, label too long

2007-01-24 Thread Marc 'BlackJack' Rintsch
exactly are you doing? How does a (unicode?) string look like that triggers this exception? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: instancemethod

2007-01-22 Thread Marc 'BlackJack' Rintsch
even simpler: cursor objects are iterable after the `execute()` call. So you don't need the number of rows:: gert.excecute('select * from person') for row in gert: print row gert.close() Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python

Re: Code reformater?

2007-01-22 Thread Marc 'BlackJack' Rintsch
that TABs are messed up, which is not a problem with other languages, but is a problem with Python. Too bad. Well then don't use code from people using TABs. If it's indented by four spaces per level, like suggested by the style guide, there's no problem with TABs. Ciao, Marc 'BlackJack

Re: beep or sound playing under linux

2007-01-22 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], hg wrote: Is there a way to do that ? Maybe this helps: http://paste.pocoo.org/show/316/ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Standard streams

2007-01-19 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], raghu wrote: what is standard streams in case of python? Do you mean `sys.stdin`, `sys.stdout` ans `sys.stderr`? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

<    6   7   8   9   10   11   12   13   14   15   >