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__":
    reader = FileReader("not_exist_file.txt")
    text = reader.read()
    assert text == ""

    with open("hello.txt", "w") as f:
        f.write("Hello, World!")

    reader = FileReader("hello.txt")
    text = reader.read()
    assert text == "Hello, World!"
Exemplo n.º 5
0
from solution import FileReader

if __name__ == '__main__':
    pth = input('Введите путь до файла: \n')
    file = FileReader(pth)
    print(file.read())
Exemplo n.º 6
0
from solution import FileReader

reader = FileReader('not_exist_file.txt')

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))

print(reader.get_path())
Exemplo n.º 7
0
from solution import FileReader

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

reader = FileReader("some_path")
content = reader.read()
print(content)
Exemplo n.º 9
0
from solution import FileReader

reader = FileReader('file/not/found/')
print(reader.read())
reader = FileReader('../week2/storage.py')
print(reader.read())
Exemplo n.º 10
0
from solution import FileReader

reader = FileReader('not_exist_file.txt')
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)
'some text'
type(reader)
Exemplo n.º 11
0
def _main():
    reader = FileReader('example.txt')
    print(reader.read())
Exemplo n.º 12
0
from solution import FileReader
reader = FileReader('not_sfda.txt')
text = reader.read()
print(text)