[Python] Messaggio di errore.
    Luigi Fontana 
    picchiolegno a gmail.com
       
    Lun 28 Ott 2013 23:16:24 CET
    
    
  
Scusate non capisco. Ho creato questo programma
filePath = "open_file.py"
buffer = "Lettura completa:\n"
buffer += open(filePath, 'rU').read()
print buffer
buffer = "Lettura riga per riga:\n"
inList = open(filePath, 'rU').readlines()
print inList
for line in inList:
    buffer += line
print buffer
buffer = "Lettura di bytes:\n"
file = open(filePath, 'rU')
while(1):
    bytes = file.read(5)
    if bytes:
        buffer += bytes
    else:
        break
print buffer
da IDLE mi funziona perfettamente ma da terminale (linux) mi da questo
errore
luigi a luigi-300E4C-300E5C-300E7C:~/Programmi$ python3 read_file1.py
  File "read_file1.py", line 4
    print buffer
               ^
SyntaxError: invalid syntax
Come mai ? Non dovrebbe essere un errore di sintassi.
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.python.it/pipermail/python/attachments/20131028/500aa832/attachment.html>
    
    
       
       Maggiori informazioni sulla lista 
	       Python