TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки
Python Заметки avatar

TGINSIGHT POST

Post #37

@pythonotes

Python Заметки

Views431Post view count
PostedFeb 1402/14/2020, 09:00 AM
Post content

Post content

Чтобы запустить два контекст менеджера одновременно можно написать так: with open('script.py') as inp: with open('_bkp.py', 'w') as out: out.write(inp.read()) А можно и более компактно в одну команду: with open('script.py') as inp, open('_bkp.py', 'w') as out: out.write(inp.read()) #tricks