RE: Codig style: or

2005-04-13 Thread Harper, Gina
Try PEP 8, Guido's Style Guide: http://www.python.org/peps/pep-0008.html Good luck with your boss! *gina* -Original Message- From: Sara Khalatbari [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 13, 2005 11:13 AM To: Python List Subject: Codig style: or Hi! Suppose you're writing

RE: split a directory string into a list

2005-02-25 Thread Harper, Gina
I would start with something like this: somestring = '/foo/bar/beer/sex/cigarettes/drugs/alcohol/' somelist = somestring.split('/') print somelist This is close to what you seem to want. Good luck. *gina* -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday,

RE: two questions - no common theme

2005-02-09 Thread Harper, Gina
2) os.listdir returns a list containing the names of the entries in the directory, this does include directories in the top level directory. For the complete listing try os.walk() which returns a tuple-(dirpath, dirnames, filenames -Original Message- From: Sean McIlroy [mailto:[EMAIL

RE: Why would I get a TypeEror?

2005-01-13 Thread Harper, Gina
Because you can't take the len() of an integer. Try casting a as a str: b=(1,len(str(a)))[isinstance(a,(list,tuple,dict))] -Original Message- From: It's me [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 12:35 PM To: python-list@python.org Subject: Why would I get a