Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. % PYTHONPATH=/tmp/path-to/third-party/py/pathlib /usr/bin/python2
  2. Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
  3. [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
  4. Type "help", "copyright", "credits" or "license" for more information.
  5. >>> import pathlib
  6. >>> dir(pathlib)
  7. ['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']
  8. >>> p = Path("/foo")
  9. Traceback (most recent call last):
  10. File "<stdin>", line 1, in <module>
  11. NameError: name 'Path' is not defined
  12. >>> p = pathlib.Path("/foo")
  13. >>> dir(p)
  14. ['__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']
  15. >>> dir(p.match)
  16. ['__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']
  17. >>> p.match("foo", match_entire=True)
  18. Traceback (most recent call last):
  19. File "<stdin>", line 1, in <module>
  20. TypeError: match() got an unexpected keyword argument 'match_entire'
  21. >>> import sys
  22. >>> print sys.path
  23. ['', '/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']
  24. >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement