ease post actual
code and actual tracebacks you get.
And `MyModule` is a bad name for a package.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ot;]}),
> Link["from_episode"]
> )
> )
> #end for
What do you mean by not possible!? This compiles fine for me.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ThisCh >= '0' and ThisCh <= '9'
> or
> ThisCh == '_'
> or
> ThisCh == '.'
> )
> ...
I still down see the second dimension. If you say 2D I think of
something like a table with two columns and not a sequential condition
spread over several lines.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
return match.group(0)
>
> re.sub(keyword, matchHandler, t1)
This doesn't work because according to the OP not all 'hello's are
keywords. It seems to depend on the position if it's a keyword or not.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 10 Sep 2007 19:54:49 +1200, Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Marc 'BlackJack' Rintsch
> wrote:
>
>> On Mon, 10 Sep 2007 15:02:58 +1200, Lawrence D'Oliveiro wrote:
>>
>>> In message <[EMAIL PRO
ct
that a text read from top to bottom follows time from earliest to latest.
And as most here don't top post, a conversation with a top poster starts
to get mixed and even harder to follow.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 10 Sep 2007 20:19:08 +1200, Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Marc 'BlackJack' Rintsch
> wrote:
>
>> I see a tree structure here ...
>
> Good, you're improving.
Thanks.
>> ... but still no table.
>
&
On Mon, 10 Sep 2007 15:48:44 +0200, A.T.Hofkamp wrote:
> (I have seen references to a module called datetime, but I have never used
> such
> a module so no idea what it is or where to get it).
It's just an import away -- in the standard library. :-)
Ciao,
Marc '
rename the temporary file to the source file's name afterward.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
a Python object. You can't use arbitrary Python
objects with `ctypes`. `memcpy` expects a pointer not an object.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
char set. The mentioning of above as a "convenient property"
> is inane.
You are being silly here.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
rerror()` function.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 11 Sep 2007 05:09:58 -0700, Tim wrote:
> On Sep 10, 3:31 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>> On Mon, 10 Sep 2007 11:38:50 -0700, Tim wrote:
>> > How do I memcpy from a pointer to an array of floats in python?
>>
>> >
;pointer" object to the name
`shared_memory_pointer`.
> shared_memory_pointer =
> windll.kernel32.MapViewOfFile(hMapObject, FILE_MAP_ALL_ACCESS,
> 0, 0, TABLE_SHMEMSIZE)
And here you bind a different object to that name, so the first binding
has no effect.
Ciao,
has to scroll back and forth to keep track of the
discussion.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
oject:
http://pyenchant.sourceforge.net/
So there is either an extra package for SuSE or the OP has to build it
himself.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
can I define a formal way of transforming the non computable
> expression to computable one.
>
> My RPN only implements: + - x %
Why does this homework assignment limit the stack so severely!? ;-)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
it's possible to unload them again. But is
code really a memory problem? I've never thought "OMG memory is getting
low, I wish I could unload a module to get some space." In my experience
it's always data that eats my RAM.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
od and the class
docstring.
> I think static typing helps in trying to deduce what code is doing,
> particularly when you are looking at function definitions. You don't
> have to work to find out what type of variables it takes.
This should either be obvious or in the docstring.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
are *many* other objects that can be used in a
boolean context of an ``if`` statement for testing "trueness" and
"falseness".
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
;> Did you check how much the slowdown is?
>
> Yes, the lambda adds 50%
Compared to what? Compared to a sort that doesn't do what you want?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
expect different behaviour
from both. I expect the ``+`` operator to return either an immutable or
entirely new object, while `add()` can be something on containers that
mutates the object.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
d be "this is an iOrange" of
course. ;-)
SCNR,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, bg_ie wrote:
> Therefore, how do I build the tuple of Falses to reflect the length of
> my t tuple?
In [1]: dict.fromkeys(('one', 'two', 'three'), False)
Out[1]: {'three': False, 'two': False,
19]: {'two': {}, 'one': {}}
In [20]: a['one']['x'] = 42
In [21]: a
Out[21]: {'two': {'x': 42}, 'one': {'x': 42}}
In [22]: a['one'] is a['two']
Out[22]: True
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ept:
> continue
> raise CantDoIt
> --
Why do you think this is an abuse? I think it's a perfectly valid use of
a loop.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
tion is signaled by a
`StopIteration` exception. Looks like flow control to me.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ted concept.
Why? I thought combining state/data and related functions into one object
is a key concept of OOP.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
rm (weight, obj) with the original
`heapq` module.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
and the problem to generate (N-1)
random numbers that add up to (M-X). You have to think a little bit about
the "suitable range" part though.
The necessary functions to draw random numbers are in the `random` module.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
the module name (mod1 and mod2) and the alias MM (mod3). Is
> that right?
Yes, that's correct.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, israphelr
wrote:
> So I created a program, that gets a string from a user and then prints
> the string in reverse order.
In [57]: 'reversed string'[::-1]
Out[57]: 'gnirts desrever'
Ciao,
Marc 'BlackJack' Rintsch
--
http
ts. At least in most cases. But there
is no way to tell what encoding a file or pipe should have. So Python
refuses to guess.
If an encoding could be determined the `sys.stdout.encoding` attribute is
set to the name, otherwise it's `None`.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, Raymond
Hettinger wrote:
> On Mar 9, 7:32 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>> In <[EMAIL PROTECTED]>, cesco wrote:
>> > Given two positive integers, N and M with N < M, I have to generate N
&
hat
is not only dependent on the operating system but also on the file system
in use.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
dlines():
for line in open('/proc/meminfo'):
>> if line.startswith("Memtotal:"):
>> name, amt, unit = line.split()
>> print name, amt, unit
>> break
Of course it's cleaner to assign the file object to a name and close the
fi
"not self" is True, how can self have attributes?
Attributes are independent from the "truth" value of an object.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
s when embedding Dojo Rich Text Editors.
So those editors have some problem with XML. I'm not impressed
by such code. ;-)
It's like complaining about:
In [100]: '\x61'
Out[100]: 'a'
It's the same information, just a different representation. Both are
withi
ct):
i_am_a_class_attribute = 42
def __init__(self):
self.i_am_an_instance_attribute = 'Viking'
And C++static local variables don't exist in Python. There are ways to
emulate them with mutable default arguments, but that's at least
debatable. Use a class instead.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
object at 0xb5a3fd4c>
In [44]: x()
Out[44]: <__main__.DemoClass object at 0xb5a3fc2c>
You have to call the class object and the method to see any effects.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, skip wrote:
> Are you sure? There's no guarantee that an iterator will terminate:
>
> len(list(itertools.cycle(range(10
You have infinite memory? ;-)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, dmitrey wrote:
> how can I implement this one in the simpliest way?
> Thank you in advance,
In [45]: '%10d' % 1
Out[45]: ' 1'
In [46]: '%10d' % 42
Out[46]: '42'
In [47]: '%10d' % 1
it's faster to use that iterator
instead of `int`.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
hon: http://www.diveintopython.org/
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
gorithm to lower the cpu load?
Just throw a small `time.sleep()` into the loop.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
`maxsplit` argument to avoid splitting the line at
*every* space character.
And if the names give the right hints `db.sync()` may be a potentially
expensive operation. Try to call it at a lower frequency if possible.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ut that doesn't have a sync method.
Shelves (`shelve` module) have this API. And syncing forces the changes
to be written to disks, so all caching and buffering of the operating
system is prevented. So this may slow down the program considerably.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, Beliavsky
wrote:
> […] How should one check that files are the same in Python? The files
> are plain text.
Take a look at the `filecmp` module. Pay attention to the shallow
argument of `filecmp.cmp()` and the default value!
Ciao,
Marc 'B
but I'd rather make a copy than a subclass.
Why? Python isn't a prototype based programming language.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
cuments? What exactly is your problem?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, Marco wrote:
> I want to set SA_RESTART flag to restart a system-call. How to do
> this in Python?
You question seems to lack a little bit context. Are you talking about
system calls into the Linux kernel?
Ciao,
Marc 'BlackJack&
ceptions they shouldn't swallow.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
exceptions.UnicodeDecodeError
> 'ascii' codec can't decode byte 0xd6 in position 26: ordinal not in
> range(128)]
>
> What could the possible cause of this be? Shouldn't shutil simply be
> reading and writing the bytes and not character decoding them?
Do you
In <[EMAIL PROTECTED]>, Mark Morss
wrote:
> Well, the discussion was about Python vs. Fortran, and Pyrex, as I
> understand it, is a tool for linking C to Python.
I think it's more than that. It's more a subset of Python with a little
static typing.
Ciao,
Ma
self.b = list(self.a)
BTW this is about instance variable, not class variables.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
nput using msvcrt.kbhit( ) and msvcrt.getch( ). Is there
> something equivalent to wait for string inputs?
The builtin `raw_input()`?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ings to unicode objects and you *encode* unicode objects to strings.
It doesn't make sense to encode a string in 'latin-1' because it must be
decoded first and the "automatic" decoding assumes ASCII and barfs if
there's something non-ascii in the string.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
cts and attach
behaviour to them.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
rue:
> line = f.readline()
> if not line: break
> # do something with the line of text such as print it.
>
> f.close()
f = open(r'pathToFile)
for line in f:
# do something with the line of text such as print it.
f.close()
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, kevinliu23
wrote:
> "2a 3ab" into "-2a -3ab".
In [8]: '-' + ' -'.join('2a 3ab 4xy'.split())
Out[8]: '-2a -3ab -4xy'
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
pletely without regular expressions:
def main():
soup = BeautifulSoup(source, convertEntities=BeautifulSoup.HTML_ENTITIES)
print ' '.join(''.join(soup(text=True)).split())
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
{forget the numericals matching}.As you can see there
> are single quotes around numericals ,which is not desired .I think the
> problem lies in me using a list for storing and later printing out
> values.
It's not that you store them in the list but that you simply print the
would this cause a
> linebreak?
Yes of course. `raw_input()` is reading from `stdin` so the very first
line you pipe in will be assigned to `bucket_name`.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
> I have read example of timeit.Timer() funcion, but I don' t know how
> can i use it in a multiple thread program?
If you want wall time then use `time.time()` in the `run()` method of the
threads to calculate the difference between start and end and set an
attribute with the
t;> id+=1
>>
>> […]
>
> use os.sep instead of '/' !
Or even better `os.path.join()` instead of building the strings with ``+``.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
.
I think it is documented, that's what the `stderr` and `stdout` arguments
are used for. Untested:
f = open('dump.txt', 'wb')
p = Popen(('mysqldump', '--option', '--another-option'), stdout=f)
r = p.wait()
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
p. Or build indexes with
dictionaries.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
a from the head of a file. At least not without
moving all following data "down", but then the file pointer within
`gstreamer` is wrong. Can't `gstreamer` be fed through a pipe?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
roblem with python rewriting "shotty" inactive icons in
> the Windows Classic Theme?
>
> ANY help appreciated.
What the heck are you talking about? Tkinter?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
he zlib-dev
or zlib-devel package installed?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
table can have completely different types but
the values in a row, represented as a Python tuple, of course belong
together.
The homogeneous objects in lists must not be of the same type but share
some behavior so it makes sense to apply some operation on all the
elements. For example get the length
; are restored in advance.
This should not work because `r` should not be a `Cursor` object. The
`execute()`-Method returns an integer with the number of "affected rows".
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
the read after the loop doesn't read anything because the file
content is in the buffer of the iterator. If the test file has more
lines, I tested it with 1000, the output looks like this:
0 xx
>xx
151 xx
152 x<
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
rt. Is that about right?
Not the whole file is read but a block of it. If you type in enough to
fill the buffer the iteration can start without an EOF on `sys.stdin`.
See the second example in <[EMAIL PROTECTED]> which
demonstrates that not the whole file is read at once by the itera
modules
> only as and when they are called.
Modules are parsed when they are imported. And some modules are already
imported before your module is imported because they are built-in or
loaded to be able to import your module in the first place. And what
about modules that are written in C?
C
n plug-in to spare myself too much typing and limit
typing errors in long names.
Along with the editor there's always a terminal with IPython running to
test and explore my own code and libraries.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ttern, line)
>>
>> if (match):
>>
>> s1, s2 = match[0]
>>
>> print s2
>
> Can anyone please help me with my problem? I still can't solve it.
>
> Basically, I want to strip out the text after the first '.' in url
> address:
>
> http://www.cnn.com -> cnn.com
from urlparse import urlsplit
def get_domain(url):
net_location = urlsplit(url)[1]
return '.'.join(net_location.rsplit('.', 2)[-2:])
def main():
print get_domain('http://www.cnn.com')
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
n mons[mon]
You've already got some answers, I just want to point out that the
``global`` is unnecessary here and that `mons` as a constant should be
spelled in capital letters by convention. And maybe it's better to write
`MONTHS` instead the abbreviation.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, Gabriel
Genellina wrote:
> En Thu, 12 Apr 2007 08:43:49 -0300, Marc 'BlackJack' Rintsch
> <[EMAIL PROTECTED]> escribió:
>
>> In <[EMAIL PROTECTED]>, Jorgen Bodde
>> wrote:
>>
>>>>&g
of allowed character sets.
Defined with string containing all allowed initial characters,
an optional string containing allowed body characters (if omitted,
defaults to the initial character set), and an optional minimum,
maximum, and/or exact length.
Ciao,
Marc 'Blac
asier: multiply the string by a number.
In [12]: 'a' * 5
Out[12]: 'a'
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
now if i need to open it again and append other binary data how can i
> proceed?
Just open it in append mode: ``open('blablal', 'ab')``
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
>
> Any clue ?
There was once a bug in Python that lead to such "errors" if an encoding
comment was used. So your costumer might check his Python version and
maybe he should update.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
3, 2, 1]
> i dont get all this
>
> >>> def f(l):
> if l == []:
> print l
> return []
> else:
> return f(l[1:]) + l[:1]
>
> >>> f([1,2,3])
> []
> [3, 2, 1] # how this come here? how python save variables from each
> r
:
r4 f(0): return 1
The 1 is returned to the previus call:
r3 f(1): return 1 * 1
This can be evaluated now and is returned to its caller:
r2 f(2): return 2 * 1
Again this is evaluated and returned to its caller:
r1 f(3): return 3 * 2
And here we have the final result that is returned from
looking for the `struct` module in the standard library instead
of doing this yourself. :-)
If you insist on doing it yourself take a look at the built-in `ord()`
function.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
,".join() ? but then it must take
> a list of strings... not integers...
>
> any fast method?
Convert them to strings before joining:
In [145]: foo = [1, 2, 3]
In [146]: ','.join(map(str, foo))
Out[146]: '1,2,3'
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
be the best
> function to use. However, when I use
> string.replace(s1, "a", " ") in python to replace a with an empty space,
> it doesn't work...I just get spam back when I print s1. Any ideas?
Yes, read the documentation to find out that `replace()` does not
his copy really is "needless".
`whatever()` may change `stuff[i]` where `i` is in `x:y` and this may lead
to different results wether it iterates over a copy or the original.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 16 Sep 2007 00:40:13 +, Steven D'Aprano wrote:
> On Sun, 16 Sep 2007 00:05:58 +0000, Marc 'BlackJack' Rintsch wrote:
>
> In *general* the compiler can't tell, but in specific cases it could. A
> (hypothetical) optimizing compiler would tell the diff
ses", no side effects, no duck typing.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 16 Sep 2007 13:31:57 +, Steven D'Aprano wrote:
> On Sun, 16 Sep 2007 10:58:07 +0000, Marc 'BlackJack' Rintsch wrote:
>
>> On Sun, 16 Sep 2007 09:50:39 +, Steven D'Aprano wrote:
>>
>>> The point is rather moot, since CPytho
On Sun, 16 Sep 2007 10:17:18 -0400, Colin J. Williams wrote:
> Marc 'BlackJack' Rintsch wrote:
>
>> `getFoo()` is discouraged by PEP 8. […]
>
> Perhaps PEP 8 needs rethinking. I prefer getFoo().
Yeah, *your* preference is a very good reason to rethink PEP 8… ;-)
C
e in my folder even if i turn the "show hidden file" to on.
The `*.pyc` files are usually only created when you import a module, not
when a module is run directly.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 17 Sep 2007 01:23:20 +, Summercool wrote:
> On Sep 16, 10:36 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>>
>> The `*.pyc` files are usually only created when you import a module, not
>> when a module is run directly.
>
> how com
))
> self.nRows += 1
>
> Maybe somebody can help me. If you need, I can give more implementation
> details.
IMHO That's not enough code and/or description of the data structure(s).
And you also left out some information like the number of rows/columns and
the size of the data.
Have you already thought about using a database?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
arenthesis of the readline() function?
>
> t = string.readline() # Limit this somehow?
Do you want to limit how much of *one* line is read or the number of lines!?
The latter can be done with `itertools.islice()`.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
lve`-Module. Another option might be pickling to
individual files and store them in a ZIP archive.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
t because those are evaluated at
definition time of functions::
F.append(lambda x, i=i: x + i)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
expect d.keys() to return after a key of d has been modified?
>
> In the new model, it should be the value at the time of addition.
> That is [1,2] (not [1,2,3]). This does mean a copy of key in
> maintained internally in the dict.
A copy!? That has to be a deep copy. Which would make `dict`\s alot
slower and use more memory. Plus you can't store objects that can't be
copied anymore. That doesn't sound like a good trade off to me.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
901 - 1000 of 1811 matches
Mail list logo