7 examples of 'os.path.join python' in Python

Every line of 'os.path.join python' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
146def _path_join(*args):
147 # if os.path.join detect that component is an absolute path, it thrown away previous ones
148 return path.normpath('/'.join(args))
23@property
24def python(self):
25 return self.get_binary('python')
6def _add_to_python_path(p):
7 if p not in sys.path: sys.path.append(p)
45def _path_join(*parts):
46 """ A slightly smarter / more flexible path appender.
47 Drop any None or "." elements
48 """
49 parts = [p for p in parts if p is not None]
50 return os.path.join(*parts)
28def script_path(*args):
29 global script_dir
30 if not script_dir:
31 script_dir = os.path.join(os.path.dirname(__file__), '..', 'Scripts')
32 return os.path.join(*(script_dir,) + args)
24def join_etc(*args):
25 return os.path.join(_ETC_DIR, *args)
94def join(*args, **kwargs):
95 """
96 Return a complete, joined path, by first calling ``abspath()`` on the first
97 item to ensure the final path is complete.
98
99 Args:
100 paths (list): A list of paths to join together.
101
102 Returns:
103 list: The complete and absolute joined path.
104
105 Example:
106
107 .. code-block:: python
108
109 from cement.utils import fs
110
111 fs.join('~/some/path', 'some/other/relevant/paht')
112
113 """
114 paths = list(args)
115 first_path = abspath(paths.pop(0))
116 return os.path.join(first_path, *paths, **kwargs)

Related snippets