RE: Maintaining leading zeros with the lstrip string function?

2007-07-23 Thread Randy Kreuziger
Thanks for the basename suggestion. That almost works. I'm running into a problem with some of the directory names when they include \800x\ see below. ―- import sys, os, string teststring = 'C:\shoreline\dvd\prep area

Maintaining leading zeros with the lstrip string function?

2007-07-23 Thread Randy Kreuziger
I need just the file name from a string containing the path to a file. The name of the file starts with zeros. This is problematic because the lstrip function strips them leaving this as the result: 6128.jpg How do I strip the path without losing the leading zeros in the file name? ―

Executing a DOS program from within Python

2006-03-16 Thread Randy Kreuziger
hanks Randy Kreuziger (360) 902-2495 Voice (360) 902-2940 Fax ArcSDE Administrator Wash Dept of Fish and Wildlife -- http://mail.python.org/mailman/listinfo/python-list

Redirecting both stdout and stderr to the same file

2005-12-27 Thread Randy Kreuziger
Can stdout and stderr be redirected to the same file?  I would like to redirect both to the same file but I'm not sure how to do it.  Currenting I'm redirectiong stdout using the following code:    saveout = sys.stdout   fsock = open('runtime.log', 'w')   sys.stdout = fsock   The problem is that