Thank you for all your reply and support. Neil's fits the most to me. I
shrinked it to this function:
def flatten(x):
for i in range(len(x)):
if isinstance(x[i], list):
x[i:i+1] = x[i]
Thank you all again. If someone could find even a cuter way, I'd like
to see that way.
Diez B. Roggisch wrote:
> Why do you wrap a in a list? Just
>
> c = a + [b]
>
> will do it.
Yes I know, but the problem is I don't know if 'a' is a list or not. I
could make a type check, but I don't want to program in that way.
Noud
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
How can I disgrate (probably not a good word for it) a list? For
example:
a = [1,2]
b = 3
c = [a] + [b] # which makes [[1,2],3]
Then how can I change c ([[1,2],3]) into [1,2,3]? I have a simple
function for this:
def flatten(l):
r = []
s = [l]
To reply to the last part of the discussion and esspecially to Gustavo
Niemeyer, I really apriciate the way in which I had been answered. And
I won't have any questions about the re module that I had before I post
this threat.
I was frustration and should, probebly, not post this frustration. But
Thank you for your replies, it's much obvious now. I know more what I
can and can't do with the re module. But is it possible to search for
more than one string in the same line?
bv. I want to replace the with " "
with "\n" and every thing that's not between the two python
tags must begin with "
arg... I've lost 1.5 hours of my precious time to try letting re work
correcty. There's really not a single good re tutorial or documentation
I could found! There are only reference, and if you don't know how a
module work you won't learn it from a reference!
This is the problem:
>>> import re
>>
Well, thank you for your advice. So I have a couple of solutions, but
it can't become a server at its own so this means I will deal with
files.
Thank you for your advice, I'll first make it work... than the server.
Noud Aldenhoven
--
http://mail.python.org/mailman/listinfo/python-list
If I should put the parsedwebsites in, for example, a tablehash it will
be at least 5 times faster than just putting it in a file that needs to
be stored on a slow harddrive. Memory is a lot faster than harddisk
space. And if there would be a lot of people asking for a page all of
them have to open
Thank you, but it's not what I mean. I don't want some kind of client
parser thing. But I mean the page is already been parsed and ready to
be read. But I want to store this page for more use. I need some kind
of database that won't exit if the cgi-bin script has finished. This
database need to be
Hello,
I'm busy to build some kind of webpage framework written in Python. But
there's a small problem in this framework. This framework should open a
page, parse it, take some other information out of it and should store
it in some kind of fast storage. This storage need to be very fast so
every
Thank you, this really looks cool!
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I've a question. Can I execute a part of a python code and put it's
output in a string? Something like this:
s = ""
s = exec """print "Hello World" """
print s
Greetz,
Noud
--
http://mail.python.org/mailman/listinfo/python-list
nd a place where I could put my authorisation for the smtp server. So
I though I could post something and it would never be sent. But it
did...
Sorry,
Jwaixs
--
http://mail.python.org/mailman/listinfo/python-list
13 matches
Mail list logo