lundi 29 juin 2015

How to define a Title in python? [duplicate]

This question already has an answer here:

I'm trying to tell python that the first line of a file is the title of the file; but when i run it the output is 'title is '.

def get_text(filename):
     text_file= open(filename,'r')
     title = text_file.readline(0)
     print('title is ', title)

Aucun commentaire:

Enregistrer un commentaire