當前位置:成語大全網 - 書法字典 - mac如何執行python文件?

mac如何執行python文件?

Mac執行python文件的方法:

以下面的test.py文件為例,看看如何在Mac中執行python文件。

實現方法:

方法1:

1.打開mac終端,輸入保存test.py文件的目錄。

2.使用python test.py命令執行python文件。

方法二:

1,進入ipython shell模式:

2.將文件名傳遞給%run以運行:

更多Python知識,請關註Python視頻教程專欄。