mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 00:33:00 +00:00
chezmoi: reorganise repo
This commit is contained in:
parent
b391e03c87
commit
67a78879db
278 changed files with 102 additions and 182 deletions
21
home/dot_config/ipython/profile_default/startup/magic_ps.py
Normal file
21
home/dot_config/ipython/profile_default/startup/magic_ps.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
from IPython.core.magic import register_line_magic
|
||||
|
||||
@register_line_magic
|
||||
def ps(cmd):
|
||||
output = get_ipython().getoutput(f"pwsh -NoProfile -Command {cmd}")
|
||||
# If no variable is assigned to the output, print it
|
||||
if get_ipython().last_execution_result is None:
|
||||
print("\n".join(output))
|
||||
else:
|
||||
return "\n".join(output)
|
||||
|
||||
|
||||
|
||||
@register_line_magic
|
||||
def nu(cmd):
|
||||
output = get_ipython().getoutput(f"nu -c {cmd}")
|
||||
# If no variable is assigned to the output, print it
|
||||
if get_ipython().last_execution_result is None:
|
||||
print("\n".join(output))
|
||||
else:
|
||||
return "\n".join(output)
|
||||
Loading…
Add table
Add a link
Reference in a new issue