"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])
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
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
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
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
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
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
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&
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
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
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. (
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
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
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
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
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
"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]>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
"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
32 matches
Mail list logo