smpl_io.io

Simplified input and output.

Functions

append(destination, content[, mode])

Appends to file by string or writable destiantion.

files(ending[, folder])

Get all the files in folder ending with ending.

find_file(fname[, up])

Searches for fname in all down folders or up folder to given order respectively.

gf([i])

Scientific number format.

glob_re(pattern, path)

Returns all strings that match the regex pattern.

grep(pattern, inp)

Searches for pattern in inp.

head(inp[, n])

Returns the first n lines of fname.

import_path([path])

Adds path to the sys.path.

mkdirs(fn)

Creates the neccessary directories above fn.

pn(a[, nnl])

Find variable with the same value as a in globals.

pr(a[, nnl])

Prints the passed a.

pushd(new_dir[, tmp, cd])

Move to a new directory and return to the previous one after context.

pwd()

Returns the path to the path of current file (in linux format).

read(fname)

Reads the file fname.

remove(file)

Removes file.

tail(inp[, n])

Returns the last n lines of fname.

write(destination, content[, mode, create_dir])

Write to file by string or writable destiantion.

Classes

Path(*args, **kwargs)

PurePath subclass that can make system calls.

StringIO([initial_value, newline])

Text I/O implementation using an in-memory buffer.