pygauss.file_io module

Created on Mon May 18 21:01:25 2015

@author: chris sewell

class pygauss.file_io.Folder(path, server=None, username=None, passwrd=None)[source]

Bases: object

an object intended to act as an entry point to a folder path

Parameters:
  • path (str) – the path to the folder (absolute or relative)
  • server (str) – the server name
  • username (str) – the username to connect to the server
  • passwrd (str) – server password, if not present it will be asked for during initialisation
__enter__()[source]

use with statement to open ssh connection once

__exit__(type, value, traceback)[source]

use with statement to open ssh connection once

active()[source]
get_path()[source]
islocal()[source]
list_files(pattern=None, one_file=False)[source]

list files in folder

pattern : str
a pattern the file must match that can include * wildcards
read_file(file_name)[source]
save_ipyimg(img, img_name)[source]

a function for outputing an IPython Image to a file

img : IPython.display.Image
an IPyton image
img_name : str
the desired name of the file
save_mplfig(fig, fig_name, dpi=256, format='png')[source]

a function for outputing a matplotlib figure to a file

fig : Matplotlib.figure.Figure
a Matplotlib figure
fig_name : str
the desired name of the file
save_pilimg(img, img_name)[source]
write_file(file_name, overwrite=False)[source]
class pygauss.file_io.NoOutputFolder(*args, **kwargs)[source]

Bases: pygauss.file_io.Folder

a folder object which will not output any data

save_ipyimg(*arg, **kwargs)[source]
save_mplfig(*arg, **kwargs)[source]
save_pilimg(*arg, **kwargs)[source]
write_file(*arg, **kwargs)[source]