Raw strings as input from File?
rhodri at wildebst.demon.co.uk
Wed Nov 25 02:11:29 CET 2009
On Tue, 24 Nov 2009 21:20:25 -0000, utabintarbo <utabintarbo at gmail.com>
> On Nov 24, 3:27 pm, MRAB <pyt... at mrabarnett.plus.com> wrote:
>> .readlines() doesn't change the "\10" in a file to "\x08" in the string
>> it returns.
>> Could you provide some code which shows your problem?
> Here is the code block I have so far:
> for l in open(CONTENTS, 'r').readlines():
> f = os.path.splitext(os.path.split(l.split('->')))
> if f in os.listdir(DIR1) and os.path.isdir(os.path.join(DIR1,f)):
> if f in os.listdir(DIR2) and os.path.isdir(os.path.join(DIR2,f)):
Ahem. This doesn't run. os.path.split() returns a tuple, and calling
os.path.splitext() doesn't work. Given that replacing the entire loop
contents with "print l" readily disproves your assertion, I suggest you
cut and paste actual code if you want an answer. Otherwise we're just
going to keep saying "No, it doesn't", because no, it doesn't.
> A minimally obfuscated line from the log file:
> smi/des/RS/Pat/10DJ/121.D5-30\1215B-B-D5-BSHOE-MM.smz ; t9480rc ;
> 11/24/2009 08:16:42 ; 1259068602
> What I get from the debugger/python shell:
> smi/des/RS/Pat/10DJ/121.D5-30/1215B-B-D5-BSHOE-MM.smz ; t9480rc ;
> 11/24/2009 08:16:42 ; 1259068602'
When you do what, exactly?
Rhodri James *-* Wildebeest Herder to the Masses
More information about the Python-list