Skip to content

Instantly share code, notes, and snippets.

@dietercastel
Last active November 1, 2020 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dietercastel/91aa45ab325ecc95ded8c974c8400cf7 to your computer and use it in GitHub Desktop.
Save dietercastel/91aa45ab325ecc95ded8c974c8400cf7 to your computer and use it in GitHub Desktop.
Use the (magic) wormhole tool from julia repl to transfer files easeily
# Script to run magic-wormhole (see https://github.com/warner/magic-wormhole) from Julia repl
# Author: Dieter Castel
# Installing requirements once.
# Meanwhile refactored into: https://github.com/dietercastel/Wormhole.jl
]add Conda
]add PyCall
using Conda
using PyCall
Conda.add("magic-wormhole",channel="conda-forge")
# Good to go using PyCall.
os = pyimport("os")
# Test whether it works
os.system("conda run wormhole --help")
# But output piping was broken in conda run so instead use activate.
# Conda add installs to the the 'base' environment.
os.system("conda activate base & wormhole send --text mytest")
#or
# os.system("conda activate base & wormhole send myfile.test")
# or
# os.system("conda activate base & wormhole receive YOURSTRINGHERE")
# receives in current directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment