Created
June 9, 2015 21:47
-
-
Save bhamiltoncx/966fb5f97bc735ace282 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% PYTHONPATH=/tmp/path-to/third-party/py/pathlib /usr/bin/python2 | |
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36) | |
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import pathlib | |
>>> dir(pathlib) | |
['EINVAL', 'ENOENT', 'Path', 'PosixPath', 'PurePath', 'PurePosixPath', 'PureWindowsPath', 'S_ISBLK', 'S_ISCHR', 'S_ISDIR', 'S_ISFIFO', 'S_ISLNK', 'S_ISREG', 'S_ISSOCK', 'Sequence', 'WindowsPath', '_Accessor', '_Flavour', '_NormalAccessor', '_PathParents', '_PosixFlavour', '_PreciseSelector', '_RecursiveWildcardSelector', '_Selector', '_TerminatingSelector', '_WildcardSelector', '_WindowsFlavour', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '_cached', '_is_wildcard_pattern', '_make_selector', '_normal_accessor', '_posix_flavour', '_py2', '_py2_fs_encoding', '_py2_fsencode', '_windows_flavour', 'attrgetter', 'basestring', 'contextmanager', 'fnmatch', 'functools', 'intern', 'io', 'nt', 'ntpath', 'os', 'posixpath', 're', 'supports_symlinks', 'sys', 'time', 'urlquote', 'urlquote_from_bytes'] | |
>>> p = Path("/foo") | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
NameError: name 'Path' is not defined | |
>>> p = pathlib.Path("/foo") | |
>>> dir(p) | |
['__bytes__', '__class__', '__delattr__', '__div__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__rdiv__', '__reduce__', '__reduce_ex__', '__repr__', '__rtruediv__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '__truediv__', '_accessor', '_cached_cparts', '_cparts', '_drv', '_flavour', '_format_parsed_parts', '_from_parsed_parts', '_from_parts', '_hash', '_init', '_make_child', '_make_child_relpath', '_opener', '_parse_args', '_parts', '_pparts', '_raw_open', '_root', '_str', 'absolute', 'anchor', 'as_posix', 'as_uri', 'chmod', 'cwd', 'drive', 'exists', 'glob', 'group', 'is_absolute', 'is_block_device', 'is_char_device', 'is_dir', 'is_fifo', 'is_file', 'is_reserved', 'is_socket', 'is_symlink', 'iterdir', 'joinpath', 'lchmod', 'lstat', 'match', 'mkdir', 'name', 'open', 'owner', 'parent', 'parents', 'parts', 'relative_to', 'rename', 'replace', 'resolve', 'rglob', 'rmdir', 'root', 'stat', 'stem', 'suffix', 'suffixes', 'symlink_to', 'touch', 'unlink', 'with_name', 'with_suffix'] | |
>>> dir(p.match) | |
['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', '__format__', '__func__', '__get__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'im_class', 'im_func', 'im_self'] | |
>>> p.match("foo", match_entire=True) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
TypeError: match() got an unexpected keyword argument 'match_entire' | |
>>> import sys | |
>>> print sys.path | |
['', '/usr/lib/python2.6/site-packages/pathlib-1.0.1-py2.6.egg', '/tmp/path-to/third-party/py/pathlib', '/usr/lib64/python26.zip', '/usr/lib64/python2.6', '/usr/lib64/python2.6/plat-linux2', '/usr/lib64/python2.6/lib-tk', '/usr/lib64/python2.6/lib-old', '/usr/lib64/python2.6/lib-dynload', '/usr/lib64/python2.6/site-packages', '/usr/lib64/python2.6/site-packages/gtk-2.0', '/usr/lib/python2.6/site-packages', '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info'] | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment