Feature request: path completion with pathlib objects
See original GitHub issueSo, I love how ipython
can path-complete strings to dig through your folders.
But I increasingly work with pathlib.Path objects for their increased readability and useful object attributes to access sub-paths.
Would it be possible to have ipython to be able to path-complete on a pathlib.Path folder?
So, I would like to be able to do something like this:
from pathlib import Path
root = Path("/abc/myfolder")
f1 = root / "f342<TAB>"
f2 = root / "f569<TAB>"
Hope this is understandable? With <TAB> I mean I press the TAB key at that point, to have ipython complete that string part of the full path.
Cheers!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
File paths completion in Python pathlib.Path objects : PY-39983
File paths completion in Python pathlib.Path objects ; Type, Feature ; State, Submitted S ; Assignee, Andrey Vlasovskikh ; Subsystem, Code Insight ;...
Read more >Python 3's pathlib Module: Taming the File System
In this tutorial, you have seen how to create Path objects, read and write files, manipulate paths and the underlying file system, as...
Read more >How to enable the pathlib.Path autocompletion in VSCode ...
I would like to take advantage of this feature in the file editor too. Is there a way to activate it, or is...
Read more >pathlib — Object-oriented filesystem paths — Python 3.11.1 ...
Source code: Lib/pathlib.py This module offers classes representing filesystem paths with semantics appropriate for different operating systems.
Read more >Easier Python paths with pathlib - Linux Journal
Rather than working with strings, instead you work with "Path" objects, which not only allows you to use all of your favorite path-...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Opps! Sorry.
I wrapped the
Path
constructor in a line magic for doing a similar thing interactively.With that set up, you can then do stuff like this (with tab completion):
It’s of pretty limited use, but it lets you create paths using tab completion when working interactively.