The most obvious way to do this would be to print to a file object: with open('out.txt', 'w') as f: print('Filename:', filename, file=f) # Python 3.x print ...
確定! 回上一頁