pwd !echo '1. Один\n2. Два\n3. Три' > data.txt cat data.txt f = open('data.txt') f.read() f.read(10) f.seek(0) f.read(10) f.read(10) f.close() f = open('data.txt') f.readlines() f.close() f = open('data.txt') for line in f: print(line) f.close() with open('data.txt') as f: print(f.read()) a = [] i = 1 try: while True: a.append(open('data.txt')) i += 1 except OSError: print('Смог открыть лишь {} файл'.format(i)) finally: for f in a: f.close() f = open('data.txt', 'rb') b = f.read() b b.decode('UTF-8') f.close() f = open('data.txt', 'w') f.write('тест тест тест') f.write('тест тест тест') f.write('тест тест тест') f.write('тест тест тест') f.write('тест тест тест') f.close() cat data.txt open('asdf') mkdir dir open('dir') !chmod a-w data.txt open('data.txt', 'w')