Is it possible to unpack a tuple without using variables?

后端 未结 1 643
星月不相逢
星月不相逢 2021-01-17 13:31

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 see

相关标签:
1条回答
  • 2021-01-17 14:08

    Yes, Python has argument list unpacking. Try this:

    some_class(*os.path.split(somefile))
    
    0 讨论(0)
提交回复
热议问题