with open('sample.txt', 'w') as f: print('XXXXX', file=f) with open('sample.txt') as f: print(f.readlines())
例
import ccxt
from pprint import pprint
with open(‘sample.txt’, ‘w’) as f:
print(ccxt.exchanges, file=f)
with open(‘sample.txt’) as f:
print(f.readlines())