mac下執(zhí)行python腳本主要分為以下四步:
首先,在python文件里首行添加#!/usr/bin/envpython
#!/usr/bin/envpython
print('hello,world!')
終端里cd進(jìn)入該python文件的目錄
添加權(quán)限:$chmod777filename.py
執(zhí)行腳本:./filename.py。
以上內(nèi)容為大家介紹了Python培訓(xùn)之mac如何啟動(dòng)python腳本,希望對(duì)大家有所幫助,如果想要了解更多Python相關(guān)知識(shí),請(qǐng)關(guān)注IT培訓(xùn)機(jī)構(gòu):千鋒教育。