KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm using the os.path.split() function on a path in my program to get the filename and pathname of a file then passing them into another method, but my current solution seems rather ugly: path = os.path.split(somefile) some_class(path[0], path[1]) Is it possible to unpack the path tuple in a cleaner way within the call to some_class? Something like: some_class(os.path.split(somefile).unpack()) Or should I simply be going about this another way? Maybe a more pythonic way?
Tags (comma-separated)
Save Edits
Cancel