LoginSignup
2
1

More than 1 year has passed since last update.

Google Colaboratory をiPadで使うとコピーできない問題をどうにかする

Posted at

iPad で Colabo を使っているとクリップボードにコピーできなくて困るのですが、git hub のissue に回避策の記載がありました。

try:
    import google.colab

    IN_COLAB = True
except:
    IN_COLAB = False

if IN_COLAB:
    from IPython.core.magic import register_cell_magic

    @register_cell_magic
    def printcell(line, cell):
        print(cell)

このコードを実行した後、コピーしたいコードセルの先頭に

%%printcell

を記載して、そのセルを実行すると、outputにセルのコードが出力されるので、それをコピーするということ。

この対処方法に思うことはありますが、全くできないよりマシなので感謝しかありません!!

なお、物理キーボードがあるときは、

Cmd+MM ショートカットで Code セルを Text セルに変換。コピー。
Cmd+MY ショートカットで Text セルを Code セルに戻す。

という方法もあるみたいですが、こちらの動作は未確認です。

ipad safari unable to copy/paste text from a code cell #1236
https://github.com/googlecolab/colabtools/issues/1236

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1