Python Info 2003/3

Python
2003-03-01

Ahh, slash fixed....

So, the fix to the slashes was a trivial


  files = map( lambda x: re.sub( r'\\', '/', x ), files )

as the first line to UpstreamTool.upstreamMultipleFiles

In an ideal world, that probably should be protected to only be done when the local system's directory separator is not slash. I think that would be done as:


  dirSep = os.path.join( 'a', 'b' )[1:-1]

  if dirSep != '/':

    files = map( lambda x: re.sub( dirSep, '/', x ), files )

posted at 18:10:08    #    comment []
March
MoTuWeThFrSaSu
      1 2
3 4 5 6 7 8 9
10111213141516
17181920212223
24252627282930
31      
Feb Apr

Just odds and ends of Pythonic stuff

XML-Image Letterimage

© 2003, Hal Wine