from solution import FileReader
reader = FileReader('not_exist_file.txt')
print(reader.__dict__)
text = reader.read()
print(text)
with open('some_file.txt', 'w') as file:
    file.write('some text')
reader = FileReader('some_file.txt')
text = reader.read()
print(text)
print(type(reader))
Exemplo n.º 2
0
def read(filename):
    reader = FileReader(filename)
    text = reader.read()
    print(f"{filename} contains: '{text}'")
    print(type(reader))
Exemplo n.º 3
0
def _main():
    file = sys.argv[1]

    reader = FileReader("example.txt")
    print(reader.read())
Exemplo n.º 4
0
from solution import FileReader

if __name__ == '__main__':
    pth = input('Введите путь до файла: \n')
    file = FileReader(pth)
    print(file.read())
Exemplo n.º 5
0
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 25 12:11:49 2020

@author: Govor_000
"""

from solution import FileReader
reader = FileReader('not_exist_file.txt')
text = reader.read()  # ''
print('text_1', text)

with open('some_file.txt', 'w') as file:
    file.write('some text')

reader = FileReader('some_file.txt')
text = reader.read()
print('text_2', text)  # 'some text'
print(type(reader))  # <class 'solution.FileReader'>
Exemplo n.º 6
0
from solution import FileReader

reader = FileReader('data_storage.py')
print(reader.read())
Exemplo n.º 7
0
from solution import FileReader

reader = FileReader("some_path")
content = reader.read()
print(content)
Exemplo n.º 8
0
def _main():
    reader = FileReader('example.txt')
    print(reader.read())