class documentation

class path(str):

View In Hierarchy

Represents a path which behaves like a string.
Method __repr__ Undocumented
Method abspath Returns the absolute path.
Method basename Undocumented
Method bytes Returns the bytes in the file.
Method copytree Recursively copy a directory to the given destination. If the given destination does not exist it will be created.
Method exists Returns True if the path exist.
Method isabs Returns True if the path is absolute.
Method isdir Returns True if the path is a directory.
Method isfile Returns True if the path is a file.
Method islink Returns True if the path is a symbolic link.
Method ismount Returns True if the path is a mount point.
Method joinpath Joins the path with the argument given and returns the result.
Method lexists Returns True if the path exists unless it is a broken symbolic link.
Method listdir Undocumented
Method makedirs Recursively create directories.
Method movetree Recursively move the file or directory to the given destination similar to the Unix "mv" command.
Method open Undocumented
Method read​_bytes Returns the bytes in the file.
Method read​_text Returns the text in the file.
Method rmtree Removes the file or directory and any files or directories it may contain.
Method stat Returns a stat of the file.
Method text Returns the text in the file.
Method unlink Removes a file.
Method utime Undocumented
Method write​_bytes Writes the given bytes to the file.
Method write​_text Writes the given text to the file.
Property parent The name of the directory the file or directory is in.
def __repr__(self):

Undocumented

Returns
strUndocumented
def abspath(self):
Returns the absolute path.
Returns
pathUndocumented
def basename(self):

Undocumented

Returns
strUndocumented
def bytes(self):
Returns the bytes in the file.
Returns
builtins.bytesUndocumented
def copytree(self, destination, symlinks=False):
Recursively copy a directory to the given destination. If the given destination does not exist it will be created.
Parameters
destination:strUndocumented
symlinks:boolIf True symbolic links in the source tree result in symbolic links in the destination tree otherwise the contents of the files pointed to by the symbolic links are copied.
def exists(self):
Returns True if the path exist.
Returns
boolUndocumented
def isabs(self):
Returns True if the path is absolute.
Returns
boolUndocumented
def isdir(self):
Returns True if the path is a directory.
Returns
boolUndocumented
def isfile(self):
Returns True if the path is a file.
Returns
boolUndocumented
def islink(self):
Returns True if the path is a symbolic link.
Returns
boolUndocumented
def ismount(self):
Returns True if the path is a mount point.
Returns
boolUndocumented
def joinpath(self, *args):
Joins the path with the argument given and returns the result.
Parameters
*args:AnyUndocumented
Returns
pathUndocumented
def lexists(self):
Returns True if the path exists unless it is a broken symbolic link.
Returns
boolUndocumented
def listdir(self):

Undocumented

Returns
List[str]Undocumented
def makedirs(self, mode=511, exist_ok=False):
Recursively create directories.
Parameters
mode:intUndocumented
exist​_ok:boolUndocumented
def movetree(self, destination):

Recursively move the file or directory to the given destination similar to the Unix "mv" command.

If the destination is a file it may be overwritten depending on the os.rename semantics.

Parameters
destination:strUndocumented
def open(self, mode='r', **kwargs):

Undocumented

Parameters
mode:strUndocumented
**kwargs:AnyUndocumented
Returns
IOUndocumented
def read_bytes(self):
Returns the bytes in the file.
Returns
builtins.bytesUndocumented
def read_text(self, encoding='utf-8', **kwargs):
Returns the text in the file.
Parameters
encoding:strUndocumented
**kwargs:AnyUndocumented
Returns
strUndocumented
def rmtree(self, ignore_errors=False, onerror=None):
Removes the file or directory and any files or directories it may contain.
Parameters
ignore​_errors:boolIf True errors are silently ignored, otherwise an exception is raised in case an error occurs.
onerror:CallableA callback which gets called with the arguments func, path and exc_info. func is one of os.listdir, os.remove or os.rmdir. path is the argument to the function which caused it to fail and exc_info is a tuple as returned by sys.exc_info.
def stat(self):
Returns a stat of the file.
Returns
AnyUndocumented
def text(self, encoding='utf-8', **kwargs):
Returns the text in the file.
Parameters
encoding:strUndocumented
**kwargs:AnyUndocumented
Returns
strUndocumented
def unlink(self):
Removes a file.
def utime(self, arg):

Undocumented

Parameters
arg:AnyUndocumented
def write_bytes(self, bytes, append=False):
Writes the given bytes to the file.
Parameters
bytes:strUndocumented
append:boolIf True given bytes are added at the end of the file.
def write_text(self, text, encoding='utf-8', **kwargs):
Writes the given text to the file.
Parameters
text:strUndocumented
encoding:strUndocumented
**kwargs:AnyUndocumented
@property
parent: path =
The name of the directory the file or directory is in.