LoginSignup
1
1

More than 1 year has passed since last update.

macOSで隠しファイルを編集する!--Python3をデフォルトで使えるようにする。

Last updated at Posted at 2019-05-06

mac:pythonコマンドでpython3を利用する

ホームディレクトリの中ある".bash_profil"にコードを書いて使えるようにします。このファイルは普段表示されていません。そこで表示させましょう!

"⌘(コマンド)"と"シフト"と ".(ドット)"を表示したいフォルダを開いて、有効になっている時に同時に押してみましょう。

".(ドット)"から始まるファイルが表示されるはずです。こうなれば普通にファイル編集が可能になるので、".bash_profil"などもCotEditerなど通常使っているものを使えます。

今回はmacにデフォルトで入っているPythonは2.7ですがエイリアスを指定してPython 3.7を"python"のコマンドで起動するようにします。

.bash_profilにalias python=python3 を記述します。これだけです。

ターミナルで"python"と打つと、python3.7が起動しました!

1
1
1

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
1