Answer the question
In order to leave comments, you need to log in
How to insert variable into subprocess?
arhiv = .....
result = subprocess.call(['tar', 'xvf' , '/home/ ??'])
The "arhiv" variable is equal to the name of the archive in the /home directory, which is parsed by date, it should be unzip.
I need instead - insert the "arhiv" variable, because the "arhiv" variable contains the file name, which is constantly changing
How to insert the arhiv variable into subprocess ? .format(arhiv) doesn't help, swears at str
python2.4
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
arhiv = '/home/' + filename
result = subprocess.call(['tar', 'xvf' , arhiv])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question