You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automatically detects the format of the output.
Two options here:
the capture output format is determined by the file name ending, e.g. %%capture_auto--path "foo.txt" will detect it is txt.
the capture output format is determined by the cell output, e.g. %%capture_auto--path "foo" will save the output to foo.mp4 if the output is of type video, or to foo.png if the output type is an image.
Another thought: Option 2 could be extended in the following way: if there are multiple outputs, they can be all saved in respective files, e.g. foo.txt , foo.mp4 and foo.png.
Here is an implementation start point:
@magic_arguments.magic_arguments() ################### Auto@magic_arguments.argument("--path","-p",default=None,help=("Auto detect what to capture based on file ending" ), )@cell_magicdefcapture_auto(self, line, cell):
args=magic_arguments.parse_argstring(CaptureMagic.capture_auto, line)
path_str=args.path.strip('"')
p_pathlib=path_preprocessing(path_str)
ifp_pathlib.suffix==".png":
passifp_pathlib.suffix==".mp4":
passifp_pathlib.suffix==".txt":
passifp_pathlib.suffix==".py":
pass
The text was updated successfully, but these errors were encountered:
Automatically detects the format of the output.
Two options here:
%%capture_auto--path "foo.txt"
will detect it is txt.%%capture_auto--path "foo"
will save the output tofoo.mp4
if the output is of type video, or tofoo.png
if the output type is an image.Another thought: Option 2 could be extended in the following way: if there are multiple outputs, they can be all saved in respective files, e.g.
foo.txt
,foo.mp4
andfoo.png
.Here is an implementation start point:
The text was updated successfully, but these errors were encountered: