> 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'
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
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
> 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 >
> 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