![](/img/trans.png)
[英]Equivalent of R's ls() function in Python to remove all created objects
[英]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.