要獲取當(dāng)前工作目錄,可以使用Python中的os模塊中的getcwd()函數(shù)。示例如下:
import os current_dir = os.getcwd() print("Current working directory:", current_dir)
運(yùn)行上述代碼,將輸出當(dāng)前工作目錄的路徑。
億速云公眾號(hào)
手機(jī)網(wǎng)站二維碼
Copyright ? Yisu Cloud Ltd. All Rights Reserved. 2018 版權(quán)所有
廣州億速云計(jì)算有限公司粵ICP備17096448號(hào)-1 粵公網(wǎng)安備 44010402001142號(hào)增值電信業(yè)務(wù)經(jīng)營許可證編號(hào):B1-20181529