s you already found out about that :-)
That said, are you sure a list of lists is the best data structure for what
you're trying to do? I keep being surprised by Python code that uses other
data structures in clever ways; lists of lists seem to be pretty rare!
Remco Gerlich
On Dec 6, 20
bignum = 1
> bignumer = repr(bignum)
> Searching = Search+bignumer
> Searched = eval(Searching)
> Maty = Searched[number]
>
This isn't the actual code that gave the error message - here you used [
].
>
Anyway, doing it like this is really bad and li
line above is equivalent to
text.isdigit() ? int(text) : text
in, for instance, C.
Remco Gerlich
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
The only list without references to other objects in it is [ ].
0, 1, 2, etc are objects. Every value in Python is a reference to an object.
Remco
On Jan 10, 2008 9:14 AM, Santiago Romero < [EMAIL PROTECTED]> wrote:
>
> > Would you care to precisely define "REAL size" first? Consider:
> >
Use zip() to combine them into a single list, then loop over that:
for x, y in zip(array1, array2):
...
Remco
On Jan 17, 2008 1:21 PM, Sacred Heart <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm new to Python and have come across a problem I don't know how to
> solve, enter com.lang.python :)
>
> I'
Not sure if this is sufficient for what you need, but how about
import re
re.sub(u'[\s\xa0]+', ' ', s)
That should replace all occurances of 1 or more whitespace or \xa0
characters, by a single space.
Remco
On Jan 19, 2008 12:38 PM, John Machin <[EMAIL PROTECTED]> wrote:
> I'm trying to recove
Hi,
Use
import sys
sys.stdout.write("foo")
sys.stdout.write("bar")
(and, possibly, sys.stdout.flush() to get the text to show up, it might wait
for the end of a complete line otherwise).
The alternative
import sys
print "foo",
sys.stdout.softspace=0
print "bar"
is just too hackish.
In Python
Hi,
It seems that for every group of 2 or more +-/* signs, one of the following
holds:
- The group starts with '-', everything after it should be dropped,
otherwise
- The second character is '-', everything after it should be dropped,
otherwise
- Drop everything after the first.
That should turn