RE: What is the role of F in dict(E, **F)

2005-09-05 Thread Marc Boeren
> As I understand update() is used to merge two dictionaries, > for example > >>> D={'a':1, 'b':2} > >>> E={'b':4,'c':6} > >>> D.update(E) > >>> D > {'a': 1, 'c': 6, 'b': 4} > >>> > > But what is the role of **F? >>> D={'a':1, 'b':2} >>> E={'b':4,'c':6} >>> D.update(E, a=3) >>> D {'a': 3, 'c'

RE: RE Despair - help required

2005-08-25 Thread Marc Boeren
Hi, > Don't think it will do much good. I need to get them from a file and > extract the last folder in the path. For example: > if I get "c:\dos\util" > I want to extract the string "\util" Still, os.path is your friend: import os filepath = r'C:\dos\util' base, last = os.path.split(file

RE: Strings for a newbie

2005-05-27 Thread Marc Boeren
Hi Malcolm, > It's not the amout of code thats a probelm, it's following the > logic and structure thats important. > As I said Python.. UGH! Do you find .. s = "This is a sentence of words" .. a = s.split(' ') less readable or logical than .. s = "This is a sentence of words" .. For i = 1

RE: Why are tuples immutable?

2004-12-16 Thread Marc Boeren
> def __cmp__ (self, other): > # I wish there was a less verbose way to do this! > if self.block < other.block: > return -1 > if self.block > other.block: > return 1 > if self.lot < other.lot: > return -1 > if self.lot >

RE: comment out more than 1 line at once?

2004-11-30 Thread Marc Boeren
> Riko Wichmann wrote: > > > Dear all, > > > > is there a way in Python to comment out blocks of code > without putting > > a # in front of each line? Somethings like C's > > > > /* > > block of code here is commented out > > */ Well, you could fake it by doing """ block of code h