I'm attempting to write a program that retrieves the file name, absolute path, etc., from a file path. Is there a module I can use in order to do that? Here's a snippet of my code
import os
filepath = "home/Documents/example.py"
print("File Name: " + os.path.basename(filepath))
print("File Path: " + os.path.abspath(filepath))
print("inode: " + os.DirEntry.inode(filepath))
I looked up a few sites and videos for this but haven't found a satisfying answer. The error I get from trying that is
TypeError: descriptor 'inode' for 'posix.DirEntry' objects doesn't apply to a 'str' object
question from:
https://stackoverflow.com/questions/65894628/module-to-retrieve-the-inode-of-a-file-path 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…