如何新建文件夾?

|

我想把我的程序的輸出信息放到一個文件夾中。如果給定文件夾不存在,則程序應創建一個新文件夾,其文件夾名稱與程序中給出的文件夾名稱相同。這可能嗎?如果是,請告訴我如何操作。

假設我給出了 "C:Program Filesalex" 之類的文件夾路徑,而 alex 文件夾不存在然後程序應該創建 alex 文件夾並將輸出信息放在 alex 文件夾中。

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

News


Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method