簡體   English   中英

python 中 r 的 ls() function 是什么?

[英]what is the equivalent of ls() function of r in python?

基本上 ls() 在 r 中所做的是它用於列出工作目錄中存在的所有對象的名稱。 我想在 python 中做同樣的事情,有人可以幫我嗎? 我是 python 新手;-;

你可以使用os.listdir()

import os

print(os.listdir('.')) # here '.' for current directory.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM