Re: looping through two list simultenously

2006-10-29 Thread Björn Lindström
"CSUIDL PROGRAMMEr" <[EMAIL PROTECTED]>: > folks I have two lists > > i am trying to loop thorough them simultenously. > > Is there any efficient doing this Try the built-in function zip. >>> zip(['a', 'b', 'c'], [1, 2, 3])

Re: How to coerce a list of vars into a new type?

2006-10-02 Thread Björn Lindström
that map in an assert statement, to make the intention clearer. -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: Is python very slow compared to C

2006-02-12 Thread Björn Lindström
Felipe Almeida Lessa <[EMAIL PROTECTED]>: > In the case of Python, as well as Java, the language has the same > name as the framework, and this may have lead you to mistake me. Not really, in either case. There's Python for both .NET and for the Java VM. -- Björn Lindström

Re: Calling GPL code from a Python application

2006-01-03 Thread Björn Lindström
the interpretation of the term "derived from". The FSF standpoint is that if you link to a library, you are creating a derivative of that library, in the shape of the whole process. -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, S

Re: Modifying values in a list

2005-12-29 Thread Björn Lindström
What is the reason for the output produced? > What code should be used to obtain the desired output? How about this? numbers = [1, 2, 3] print [x * 2 for x in numbers] -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentation/whitespace

2005-12-24 Thread Björn Lindström
itation syntax. The problem with that is that a few people would prefer to use this all the time, damaging the (almost) uniform indentation among Python programs. -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs bad

2005-12-06 Thread Björn Lindström
Paul Rubin <http://[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] (Björn Lindström) writes: >> Actually using tabs for eight spaces and then filling out with spaces to >> the correct indentation is the convention for Emacs Lisp. Of course, >> since everyone coding Emacs

Re: Tabs bad

2005-12-05 Thread Björn Lindström
he question is, if we > are trying to pick only one, which one causes fewer problems. Actually using tabs for eight spaces and then filling out with spaces to the correct indentation is the convention for Emacs Lisp. Of course, since everyone coding Emacs Lisp does it with the same editor, it&

Tabs bad (Was: ANN: Dao Language v.0.9.6-beta is release!)

2005-12-04 Thread Björn Lindström
cause "problems". This article should explain it: http://www.jwz.org/doc/tabs-vs-spaces.html -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: Which license should I use?

2005-11-25 Thread Björn Lindström
ll be able to sell it, just like anyone else. -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-11-24 Thread Björn Lindström
eption that describes why it doesn't make sense to change that particular object instead. As I said before, I think you're confusing the (in Python pretty non-existent) concept of encapsulation with Python's immutable types, which are immutable because the implementation demands it. (

Re: about sort and dictionary

2005-11-24 Thread Björn Lindström
s it is in Scheme, signifying that a method/function is called only for side effects. (Similar to a void function in C.) -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-11-23 Thread Björn Lindström
of wants to implement encapsulation from the back way. Anyway, as he doesn't mention anything about using this immutability for any kind of optimisation, I assume it's about "Control". -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala U

Re: Proposal for adding symbols within Python

2005-11-14 Thread Björn Lindström
strings, then just use them: > > class MyFile: > def open(self): > self.state = "opened" > def close(self): > self.state = "closed" So, I guess no one read my explanation of why this an issue about more than implementing enums (which i

Re: Proposal for adding symbols within Python

2005-11-13 Thread Björn Lindström
like ' in Lisp, could be introduced later, but I don't think that would be strictly necessary. -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: What do you use as symbols for Python?

2005-11-11 Thread Björn Lindström
each value seems cleaner, and closer to actual symbols, to me. I don't see why Python doesn't go all the way and add a real symbol type, though. I've seen way too many ugly string or integer based solutions. -- Björn Lindström <[EMAIL PROTECTED]> Student of co

Re: Circe

2005-11-07 Thread Björn Lindström
"Sargun Dhillon" <[EMAIL PROTECTED]> writes: > Me and my friends are working on a project, Circe we'd like some people > to test it: I guess you weren't aware of this. http://www.emacswiki.org/cgi-bin/wiki/Circe -- Björn Lindström <[EMAIL PROTECTED]>

Re: Getting Python Accepted in my Organisation

2005-11-04 Thread Björn Lindström
t; I'm more of the type that wouldn't read on if I have no context to > what I'm reading... Specially if there's a mix of top posts with > bottom posts... Anyway, if you keep more than a pageful of the previous message, you're probably not cutting it hard enough. Jus

Re: Python's website does a great disservice to the language

2005-11-02 Thread Björn Lindström
magazines, and newspapers in existence use it, and have found > it perfectly readable up to now. Actually it does set some fonts ("avantgarde" and "lucidasomethignorother") as first choices. I guess you, like me, and probably most people in here, doesn't have th

Re: Flat file, Python accessible database?

2005-11-01 Thread Björn Lindström
ou mean by "flat" file here, but if you mean it should be human readable, maybe the csv module is the thing. http://docs.python.org/lib/module-csv.html -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: Scanning a file

2005-10-28 Thread Björn Lindström
t stand unnecessary local variables. print file("filename", "rb").read().count("\x00\x00\x01\x00") -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the output from os.system() into a variable?

2005-10-05 Thread Björn Lindström
so something like: > > result=python_command(' command_on_the_bash ') > > Is that possible? And how to do that? Check out the commands module. http://docs.python.org/lib/module-commands.html -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Björn Lindström
hing. Isn't there a word for such a person? > > Hmmm. > > Plonk. Yeah, thanks, that's the word. -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Björn Lindström
Paul Rubin <http://[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] (Björn Lindström) writes: >> I don't see why the things you talk about would have to be part of the >> main Python distribution. Ruby on Rails seems to do pretty well without >> being included with

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Björn Lindström
ts other than Tkinter.) In short, when you have your one-click-install Pythonic IDE extravaganza, I'm sure people will download it, whether or not they can do it on python.org. -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: Art of Unit Testing

2005-08-02 Thread Björn Lindström
ever way you do it.) So, rebuilding the environment for the each before every single test is generally worth the overhead. -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: Standard Threads vs Weightless Threads

2005-08-01 Thread Björn Lindström
Erlang, seems to make dealing with massive concurrency easier. -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: flatten()

2005-07-07 Thread Björn Lindström
flatten(l): for e in l: if isinstance(e, list): for f in flatten(e): yield f else: yield e for x in flatten([0, [1, 2, [3, 4], 5], 6, 7]): whatever() -- Björn Lindström <[EMAIL PROTECTED]> Student of computational lin

Re: map vs. list-comprehension

2005-06-29 Thread Björn Lindström
ng that explains the reasons: http://www.artima.com/weblogs/viewpost.jsp?thread=98196 -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: Boss wants me to program

2005-06-27 Thread Björn Lindström
hence it is easier to create the GUI. Of course, you can do that with Python, too, with Glade (http://www.jamesh.id.au/software/libglade/) or Boa Constructor (http://boa-constructor.sourceforge.net/). (There might be more of them.) -- Björn Lindström <[EMAIL PROTECTED]> Student of computatio

Re: noob question

2005-06-25 Thread Björn Lindström
DLE IDE that comes with Python. -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, Sweden -- http://mail.python.org/mailman/listinfo/python-list

Re: oddness in super()

2005-06-19 Thread Björn Lindström
"Martin Blume" <[EMAIL PROTECTED]> writes: > A great analysis, but what's a "pogo stick" and where can I get one? http://search.ebay.com/pogo-stick -- Björn Lindström <[EMAIL PROTECTED]> Student of computational linguistics, Uppsala University, S