Max M wrote:
> I am writing a "find-free-time" function for a calendar. There are a lot
> of time spans with start end times, some overlapping, some not.
>
> To find the free time spans, I first need to convert the events into a
> list of non overlapping time spans "meta-spans".
>
"Almost" lin
sdhyok wrote:
Recently, I installed many shared libraries to run a program written in
Python.
Now, I am in the situation to run the same program but on several
different machines with the same Linux OS. To avoid the reinstallation,
I like to pack up all shared libraries into a directory. Is there a
Tim Peters wrote:
[Mike Rovner]
3 IS wrong because if you use any not BIG letter after bodyguard on both
sides, you get extra 'eCQQmSXK\n' which slow me down for 5 minutes.
Get rid of the newlines first.
On level 7, I'm not sure whether there's something more to do, or
whet
David Murmann wrote:
Shane Hathaway wrote:
That was pretty fun. Good for a Friday. Too bad it comes to an abrupt
"temporary end".
Shane
P.S. I hope I didn't hammer your server on step 3. I was missing the
mark. :-)
Interestingly step 3 is actually wrong... there is an additional
solution, whic
Couple notes:
- boost.python issues better discuss in comp.lang.python.c++ group;
- debug your extension from python first, then embed it
- don't call PyFinalize()
zghelp wrote:
but the exception occur when run to "print t.greet()"
How can I solve it?
Providing exception text will be helpful.
Mike
[EMAIL PROTECTED] wrote:
Nope. Does't work. Running Python 2.3.4 on Debian, Linux kernel 2.6.
This is actually test code for a larger project...
# flash the selected wx.TextControl
for flasher in range(4):
self.textField.SetBackgroundColour(255, 0, 0)
self.textField.Update()
time.slee
[EMAIL PROTECTED] wrote:
... SHOULD toggle On and Off four times with one-second pauses. When I
run this, the loop pauses the full eight seconds then prints the Ons
and Offs all at once. What's up with that?
Run your script as:
python -u script.py
for unbuffered output.
--
http://mail.python.org/ma
Thomas Gagne wrote:
Assuming (I don't know for certain) that MS's PR approves all messages
that leave the building, I'm wondering if this foray into dynamic
languages doesn't signal something greater on MS' part. While Sun and
Java (and C# for the most part) have remained statically-typed, do y
Beman Dawes wrote:
So are these os.path functions specified and implemented incorrectly? Should
they instead throw exceptions for the above examples?
Works for me. (Win XP SP2, Py 2.4, only have c and d drives)
>>> os.path.exists('d:\\')
True
>>> os.path.exists('e:\\')
False
>>> os.path.exists('a:
Right. Thanks for the correction.
Fredrik Lundh wrote:
Mike Rovner wrote:
if os.stat says the_file is too big:
fh = open(the_file, 'rb')
fh.seek(2008, 2)
should be
fh.seek(-2008, 2)
right?
data = fh.read()
fh.close()
assert len(data)==2008 # you may want some error processin
rbt wrote:
if os.stat says the file is too big:
read the file
trim = only keep the last 2008 bytes (This is where I get stuck)
write trim back out to the original file
Would someone demonstrate the *best* most efficient way of doing this?
if os.stat says the_file is too big:
fh = open
Jp Calderone wrote:
On Sun, 27 Mar 2005 14:39:06 -0800, James Stroud <[EMAIL PROTECTED]> wrote:
"ATT/GATA/G"
gets split to
[['A'], ['T'], ['T', 'G'], ['A'], ['T'], ['A', 'G']]
I have written a very ugly function to do this (listed below for the curious),
but intuitively I think this should only ta
vivek khurana wrote:
i am a new member on this list. I have to implement
tree data structure using python. How it can be done
in python. Is there an existing data structure which
can be used as tree? I have searched archives and
manuals but no luck.
You can start with Guido's essay
http://python
Peter Hansen wrote:
(But if you can accept those drawbacks, keep doing what you're doing.
Also consider searching the archives for discussions involving the
"dis" module (google for "dis.dis" maybe?) and see how to learn for
yourself what is atomic and what's not.)
Thanks, Peter. I googled groups o
Anthony Liu wrote:
I am wondering if it is possible to start reading from
the last line of file, and then the last but one up to
the first line.
If you can afford to keep the whole file in memory, than:
lines = open(..).readlines()
print lines[::-1]
Otherwise you can use seek() to random-access fil
Hello,
Please advise on multi-threaded list *append*:
import time, random, thread
aList = []
def main():
for i in range(10):
thread.start_new_thread(updater, (i,))
time.sleep(30)
print aList
def updater(n):
global aList
time.sleep( random.randint(1,n+1) )
aList.append(n)
if __name__
Charles Hixson wrote:
I hesitate to call this a bug, as at my level of expertise that seems
... unlikely. But I can't think of any other explanation:
Call it 'typo' ;)
print"item[0] > lvl = %d > %d = " %(item[0], lvl), bool(item[0] ==
lvl)
use bool(item[0] > lvl)
HTH,
Mike
--
http://mail.py
Reinhold Birkenfeld wrote:
I don't quite understand that. Which dict item are you extending? Don't
you need something like
dl[key].append("word")
Rigth. It was just a typo on my part. Thanks for fixing.
Mike
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
If the compiler can do some type inference, it can optimize out those
multiple calls pretty straightforwardly.
It can be tipped like that:
di = dict(int)
di.setdefault(0)
di[key] += 1
dl = dict(list)
dl.setdefault([])
dl.append("word")
dl.extend(mylist)
But the point is that if me
Ivan Van Laningham wrote:
Hi All--
Maybe I'm not getting it, but I'd think a better name for count would be
add. As in
d.add(key)
d.add(key,-1)
d.add(key,399)
etc.
IMHO inc (for increment) is better.
d.inc(key)
add can be read as add key to d
Mike
--
http://mail.python.org/mailman/listinfo/python-
20 matches
Mail list logo