1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

codeをpowerpointに貼り付けたいんだ

Posted at

概要

コードをクールにpowerpointに貼り付けたかった。

環境

Python 3.10.0
Mac OS Catalina

内容

pygmentizeを使う。
(いつインストールしたか覚えていないが、おそらくpygmentをpip installしたときか、jupyterlabでインストールされたか。)

$ pygmentize -f rtf samply.py | pbocpy

そして、Powerpointで、Ctrl-Vすれば良い。
Screen Shot 2022-08-13 at 14.31.36.png

先人に感謝。

蛇足

スタイルを指定したり

$ pygmentize -O style=paraiso-dark -f rtf sample.py | pbcopy

fileに出力したりもできる

$ pygmentize -f rtf -o sample.rtf sample.py

参考文献

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?