On Feb 9, 11:01 am, Stefan Behnel stefan...@behnel.de wrote:
KlausNeuner, 09.02.2010 10:04:
my program is supposed to parse files that I have created myself and that
are on my laptop. It is not supposed to interact with anybody else
than me.
Famous last words.
Stefan
All right, I
On Feb 10, 12:55 pm, Bruno Desthuilliers bruno.
42.desthuilli...@websiteburo.invalid wrote:
KlausNeunera écrit :
All right, I admit that eval() is evil and should never be used.
Can you tell the difference between your above statement and the following:
As already pointed out in my second
Or perhaps is it me that failed to re-read a bit more of the thread
before answering - I obviously missed the irony (and made an a... of
myself), sorry :-/
There is nothing to be sorry about. I am grateful to all participants
of this thread. I know a lot more about Python than before.
--
go to hell ;-), it is part of the language, it seems to match the
aforementioned question.
Thats right. In fact, your code is the precise analogy of my Prolog
example in Python. Obviously, eval() and call() are both inherently
dangerous. They should never be used in programs that are used in
Hello,
I am writing a program that analyzes files of different formats. I
would like to use a function for each format. Obviously, functions can
be mapped to file formats. E.g. like this:
if file.endswith('xyz'):
xyz(file)
elif file.endswith('abc'):
abc(file)
...
Yet, I would prefer to
A file extension is not necessarily 3 chars long.
No, of course not. But it is, if I choose to use only (self-made) file
endings that are 3 chars long. Anyway, it was just an example.
handlers = {
.txt : handle_txt,
.py : handle_py,
# etc
}
That is exactly what I would
Hello,
Python has one feature that I really hate: There are certain special
names like 'file' and 'dict' with a predefined meaning. Yet, it is
allowed to redefine these special names as in
dict = [1:'bla']
In order to avoid problems in the future, I tried to get the list of
all those names, but
Hello,
what is the fastest way to determine whether list l (with
len(l)3) contains a certain element?
Klaus
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I need to gather information that is contained in various files.
Like so:
file1:
=
foo : 1 2
bar : 2 4
baz : 3
=
file2:
=
foo : 5
bar : 6
baz : 7
=
file3:
=
foo : 4 18
bar : 8