How to use variable's value in a Linux path to display contents?

后端 未结 1 450
挽巷
挽巷 2021-01-29 09:42

I am stuck at using python variable in Linux path to display contents, any advice/guidance/hints would be very helpful.

Below is my python script:

#!/bin         


        
相关标签:
1条回答
  • 2021-01-29 09:53

    TypeError:not enough arguments for format string

    You need to use tuple/list/etc for format string, eg:

    os.system('hadoop fs -cat /bla/bla/%s/bla/%s/file.txt ' % (db, path))
    
    0 讨论(0)
提交回复
热议问题