> Su linux gli universal newline sono disabilitati di default. Mi sembra che > su windows siano abilitati di default ma non ne sono sicuro. Qualcuno può > fare una prova? > > python -c "print 'hello'; print 'world'" > test > python -c "print list(open('test', 'r'))" > python -c "print list(open('test', 'rU'))" > > Cosa restituiscono gli ultimi 2 comandi in windows?
Microsoft Windows XP [Versione 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\dex>python -c "print 'hello'; print 'world'" > test C:\Documents and Settings\dex>python -c "print list(open('test', 'r'))" ['hello\n', 'world\n'] C:\Documents and Settings\dex>python -c "print list(open('test', 'rU'))" ['hello\n', 'world\n'] C:\Documents and Settings\dex>python Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on win32
_______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python