What are basic file operations in Python? I can never remember. #5

Closed
opened 2025-12-30 12:44:47 +00:00 by jadudm · 1 comment
Owner

I always forget all the basics. This is because I keep switching languages.

I always forget all the basics. This is because I keep switching languages.
Author
Owner

extract a filename from a path

print(os.path.basename(your_path))

resources

### extract a filename from a path ``` print(os.path.basename(your_path)) ``` ### resources * https://stackoverflow.com/a/8384838
jadudm added the python label 2025-12-30 12:50:45 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jadudm/how-to-do-computer-things#5