smpl_io.io.read

smpl_io.io.read(to_be_read)[source]

Open either a file or URI and return the content. Reads the file to_be_read.

Parameters

fnamestr

file name.

Returns

str

content of the file.

Examples

>>> read("nonexistent.txt")
''
>>> write("test.out","hi")
>>> read("test.out")
'hi'
>>> read("https://raw.githubusercontent.com/APN-Pucky/smpl_io/master/LICENSE").split("\n")[0].strip()
'GNU GENERAL PUBLIC LICENSE'
Parameters:

to_be_read (str) –